EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

How to program AVR or 8051 with Serial Port?

Started by xelon February 18, 2006
Hi,

I'm working on my final year project. I'm going to use AT89C51AC3 or
ATmega1280. Last term in Embedded Systems course, we used an evaluation
board(uses MSC1200Y3) that can be programmed over USB. I searched web
site of Texas Instruments and find a application note that explains how
to make it(In-System Serially Programming).

I'm wondering that can I make it too with Atmel's microcontrollers?

I have to design PCB, not going to use an evaluation board. So I have
to program the microcontroller that I will select. Both
microcontrollers have ISP feature. I want to know if i can make
programmer over the board that I'm going to design. (For example, when
a button is pressed the uC will be in programming state, when another
button is pressed, the uC will be in running state.) Or do i have to
use an external programmer? I have to program the microcontroller
without removing from the board board.

Thanks...

xelon wrote:

> Hi, > > I'm working on my final year project. I'm going to use AT89C51AC3 or > ATmega1280. Last term in Embedded Systems course, we used an evaluation > board(uses MSC1200Y3) that can be programmed over USB. I searched web > site of Texas Instruments and find a application note that explains how > to make it(In-System Serially Programming). > > I'm wondering that can I make it too with Atmel's microcontrollers? > > I have to design PCB, not going to use an evaluation board. So I have > to program the microcontroller that I will select. Both > microcontrollers have ISP feature. I want to know if i can make > programmer over the board that I'm going to design. (For example, when > a button is pressed the uC will be in programming state, when another > button is pressed, the uC will be in running state.) Or do i have to > use an external programmer? I have to program the microcontroller > without removing from the board board.
For RS232 you need a bootloader - the AC2 has that, builtin, so go to the Atmel web site, and Download their FLIP SW - that is the downloader for all their serial devices ( which includes CAN and USB loaders ) on other variants. -jg
Do I have to use a programmer board(ISP or sth)? If not, is there any
documentation to build the board which can program the microcontroller
via RS-232 also?

xelon wrote:

> Do I have to use a programmer board(ISP or sth)? If not, is there any > documentation to build the board which can program the microcontroller > via RS-232 also?
Download the Flip SW and read the data sheets ? These will show how you pgm via RS232. -jg
I already downloaded FLIP, but there is no documentation. Just a
software to send an hex file to board. But I'm asking that how to make
a (PCB) board that have programming feature. Is it possible? If it is,
how? 

I don't have any programmer, or a board yet.

Thanks

xelon wrote:

> Hi, > > I'm working on my final year project. I'm going to use AT89C51AC3 or > ATmega1280. Last term in Embedded Systems course, we used an evaluation > board(uses MSC1200Y3) that can be programmed over USB. I searched web > site of Texas Instruments and find a application note that explains how > to make it(In-System Serially Programming). > > I'm wondering that can I make it too with Atmel's microcontrollers? > > I have to design PCB, not going to use an evaluation board. So I have > to program the microcontroller that I will select. Both > microcontrollers have ISP feature. I want to know if i can make > programmer over the board that I'm going to design. (For example, when > a button is pressed the uC will be in programming state, when another > button is pressed, the uC will be in running state.) Or do i have to > use an external programmer? I have to program the microcontroller > without removing from the board board.
The datasheet of the Atmel explains how the serial downloading is done. A little controller such as an AVR will do. Rene -- Ing.Buero R.Tschaggelar - http://www.ibrtses.com & commercial newsgroups - http://www.talkto.net *** Free account sponsored by SecureIX.com *** *** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***
xelon wrote:
> I already downloaded FLIP, but there is no documentation. Just a > software to send an hex file to board. But I'm asking that how to make > a (PCB) board that have programming feature. Is it possible? If it is, > how?
You need to get the bootloader on the chip before you can serial program it. My suggestion is to build or buy a Jtag programmer first.
xelon wrote:
> I'm working on my final year project. I'm going to use AT89C51AC3 or > ATmega1280.
> I already downloaded FLIP, but there is no documentation. Just a > software to send an hex file to board. But I'm asking that how to make > a (PCB) board that have programming feature. Is it possible? If it is, > how?
Download the At89C51Ac3 datasheet, http://www.atmel.com/dyn/resources/prod_documents/doc4383.pdf and also AT89C51AC3 Bootloader data sheet : http://www.atmel.com/dyn/resources/prod_documents/doc4386.pdf Page 56 of the data sheet has the start of the section, and states "Atmel provide also a standard UART Boot loader by default." Thus the device can self-pgm, via a RS232 port, conditional on a couple of pins described in the datasheet. All your PCB has to do, is provide a RS232 connection ( usually via MAX202 or similar ) to the PC, and a means to force those pins for Loading, and then you use Flip to actually send the code. Page 8 of the Bootloader doc, gives the AutoBaud ranges for given Xtals. -jg
Thanks all

I think I have to read the datasheet of both microcontrollers to learn
this feature.

Jim Granville wrote:
> xelon wrote: > > I'm working on my final year project. I'm going to use AT89C51AC3 or > > ATmega1280. > > > I already downloaded FLIP, but there is no documentation. Just a > > software to send an hex file to board. But I'm asking that how to make > > a (PCB) board that have programming feature. Is it possible? If it is, > > how? > > Download the At89C51Ac3 datasheet, > http://www.atmel.com/dyn/resources/prod_documents/doc4383.pdf > > and also AT89C51AC3 Bootloader data sheet : > http://www.atmel.com/dyn/resources/prod_documents/doc4386.pdf > > > Page 56 of the data sheet has the start of the section, and states > "Atmel provide also a standard UART Boot loader by default."
It means booting from UART by default, not having the boot loader by default. Atmel provides the code, but you have to load it somehow. It would make thing simple otherwise, but that's not true in general. We asked for pre-programmed avr with bootloader. Atmel said we have to Jtage it ourself. Even with it pre-loaded, the bootloader gets messed up occasionally. Ideally, we want the bootloader in rom, not flash. We gave up and got a Jtag programmer eventually.
> > Thus the device can self-pgm, via a RS232 port, conditional > on a couple of pins described in the datasheet. > All your PCB has to do, is provide a RS232 connection > ( usually via MAX202 or similar ) to the PC, and a means > to force those pins for Loading, and then you use Flip to > actually send the code. > > Page 8 of the Bootloader doc, gives the AutoBaud ranges for > given Xtals. > > -jg

The 2024 Embedded Online Conference