Electronic – Flash Programming for AT89S2051

flashmicrocontrollerserial

Forgive me if this is a noob question, this is my first MCU project.

After reading a few tutorials here and there, I've set up my MCU circuit and programmed a simple program in Keil μVision 4 and compiled it to HEX-80. However, I'm having problems with attempting to flash the program to the MCU.

Fundamentally I am kind of lost in how to connect the devices (PC->MCU) up. I was under the impression a simple USB->TTL (Serial)->MCU UART input was going to do it, but apparently not.

After 5 hours of search, I only found articles relating to AVR or PIC with no mention of anything remotely related to 8051. I understand the AT89S2051 has ISP functionality so I don't need a dedicated chip flash programmer. I also found that the MCU does have serial flash capabilities.

Can anyone point me in the right direction here?

Additional Details:

MCU: Atmel AT89S2051 (on breadboard)
PC: Win 7 x64 (Shouldn't matter but here it is anyway)
USB->TTL: PL2303HX (on-board chipset)

Wiring:

The RXD (TTL output) is wired to the TXD (Pin 3.1) of the UART
The TXD (TTL output) is wired to the RXD (Pin 3.0) of the UART
The GND (TTL output) is wired to the circuit ground
The +5V (TTL output) is wired to the circuit +5V
The +3.3V (TTL output) is not connected.

Programs I have tried (and failed to use):

AtmelISP
PonyProg
IspPgm

Best Answer

Where you're getting into confusion is that while ISP stands for in-system programming it often still needs a dedicated hardware programmer to provide the necessary voltages and/or protocol for programming the FLASH. For that device you'll want something such as an Atmel AT89ISP.

I've never used the AT89 series in particular but on page 32 of the AT89S2051 datasheet you'll see it's an SPI type interface that requires a clock and data in and out lines. Some FTDI devices can support SPI communications but I'm fairly sure the PL2303HX can't and after a quick check of the datasheet it only seems to mention async mode.

Generally the easiest way would be to purchase the AT89ISP programmer or I believe there are a few DIY projects and clones available. Although unless the budget is tight it's probably always easiest to start with an officially supported programmer.