Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Programming 8051 serially

Status
Not open for further replies.

netdeamon

Newbie level 6
Joined
Jun 7, 2013
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,396
As you see in the figure, programming the 8051 through serial port DB9 connector should be a fairly easy task
Connect the two pins of 8051 to max 232 and then to DB9

So the programming circuit of 8051 should contain no more than 1 chip,some power sources,crystals,capacitors and one connector port.
But when you search online for 8051 programmer circuit, they contain many chip like 89c2051 and whatnot.

Then why cant we program the 8051 using this simple circuit?

By 8051 i mean AT89S51/52.

EDABOARD.png
 

To program a microcontroller like the AT89S51/52 using the devices UART, would require the device, the AT89S51/52 in your case, be preloaded with a bootloader.

A bootloader is software code with is initially executed during device powerup or reset which allows additional firmware to be downloaded into the device and then executed, typically utilizing a Serial Interface like USART or USB.

Absent a bootloader or if this is the first time the device is being programmed, the devices In System Programming (ISP) via the SPI interface must be utilized to download the binary into the device.

Which is why you have come across more elaborate programmers then the simple MAX232 transceiver.


There are simpler ISP programmer designs available, like the following:

ISP Downloader for AT89S51/52

Unfortunately, you will need to use the ISP/SPI interface to initially program your AT89S51/52.

AVR: In-System Programming - Atmel Corporation

In actuality, the Atmel's ISP is a bootloader with the devices SPI interface utilized as a serial programming interface.

Does this info help?

BigDog
 
First I must using a ISP to load the bootloader in 89s52. Then only I can use the simple MAX 232.
So first using the LPT25 port, I insert bootloader in 89s52, then I can use the max 232.
Just asking, will rewriting the code via simple max232 transceiver will not erase the bootloader?

So the chips like 89c2051 contain the bootloader code?

And I did not understand about the AVR link. I need to program 89s52, so r u suggesting me to use AVR ISP programmer to program 89s52?
 

First I must using a ISP to load the bootloader in 89s52. Then only I can use the simple MAX 232.
So first using the LPT25 port, I insert bootloader in 89s52, then I can use the max 232.

Yes, although once you have either built or purchased an Atmel compatible ISP programmer, you might decide to forgo the use of a custom bootloader.

Just asking, will rewriting the code via simple max232 transceiver will not erase the bootloader?

One of the drawbacks of using a custom bootloader is the application code you are developing must be proper linked for loading at a particular position in Flash/ROM.

Otherwise, yes you might inadvertently write over the bootloader.


So the chips like 89c2051 contain the bootloader code?

Essentially all reprogrammable microcontrollers contain some sort of bootloader, otherwise there would be no way to load application code into Flash or have the device boot code stored in an external ROM, etc.

To utilize an interface, like a UART, not previously intended by manufacture by which to download new app code into the device, a custom bootloader must be used.

The AT89S51/52 bootloader utilizes the device's SPI interface.

And I did not understand about the AVR link. I need to program 89s52, so r u suggesting me to use AVR ISP programmer to program 89s52?

The Atmel AVR ISP mkII is one of Atmel's commercial solutions to programming the AT89S51/52, however it is not the only solution.

The simple ISP programmer utilizing a single TTL logic IC in the other link is another.

A very popular solution is the USBasp, which if I remember correctly also supports the AT89S51/52 as well as the AVR series.

USBasp - USB programmer for Atmel AVR controllers

Commercial Versions of the USBasp:

AVR MCU Download Cable with shell USBASP

I personally use either the Atmel AVR ISP mkII or JTAGICE mkII to program the AT89S51/52 series, which these days is not very often.

I prefer the Silabs and Dallas/Maxim 8051 variants.

BigDog
 
Yes, although once you have either built or purchased an Atmel compatible ISP programmer, you might decide to forgo the use of a custom bootloader.



One of the drawbacks of using a custom bootloader is the application code you are developing must be proper linked for loading at a particular position in Flash/ROM.

Otherwise, yes you might inadvertently write over the bootloader.




Essentially all reprogrammable microcontrollers contain some sort of bootloader, otherwise there would be no way to load application code into Flash or have the device boot code stored in an external ROM, etc.

To utilize an interface, like a UART, not previously intended by manufacture by which to download new app code into the device, a custom bootloader must be used.

The AT89S51/52 bootloader utilizes the device's SPI interface.



The Atmel AVR ISP mkII is one of Atmel's commercial solutions to programming the AT89S51/52, however it is not the only solution.

The simple ISP programmer utilizing a single TTL logic IC in the other link is another.

A very popular solution is the USBasp, which if I remember correctly also supports the AT89S51/52 as well as the AVR series.

USBasp - USB programmer for Atmel AVR controllers

Commercial Versions of the USBasp:

AVR MCU Download Cable with shell USBASP

I personally use either the Atmel AVR ISP mkII or JTAGICE mkII to program the AT89S51/52 series, which these days is not very often.

I prefer the Silabs and Dallas/Maxim 8051 variants.

BigDog



Thanks for your clear explanation . Thats why people use phillips at89v51 chip. It contains a bootloader embedded inside it by phillips itself. So just hook up the at89v51 to max232 and thats it!
 

Thats why people use phillips at89v51 chip. It contains a bootloader embedded inside it by phillips itself. So just hook up the at89v51 to max232 and thats it!

That's Right.

However, if you really want a nice 8051 variant for which to develop apps, checkout the Silabs C8051F Series, up to 100 MIPS and JTAG interface for in-circuit programming/debugging.

**broken link removed**


BigDog
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top