How to program (<i>burn</i>) the code inside my 8051-derivative microcontroller?
Submitted By: Jan Waclawek FAQ Last Modified: 08/29/06
- This depends on the particular derivative of 8051 you are using. There are several groups, sorted here in historical order, the oldest first.
- Chips denoted 80(C)5x/83(C)5x/80(C)3x - these either don't have internal code memory, or it is a ROM which content is given at manufacturing time. No way to burn your code inside. You can use most of them with external code memory, though, although that is not really recommended for new designs and for newbies.
- Chips denoted 87(C)5x - these have EPROM (with one E) as a code memory. If in plastic package, they are OTP (one time programmable), if in ceramic windowed package, they can be erased using ultraviolet light and reprogrammed. To be programmed using professional, so called parallel, programmer only. Not suitable for new designs nor for newbies.
- Chips denoted 89C5x/89Cx051 - code memory is FLASH (electrically erasable/reprogrammable). To be programmed in professional (parallel) programmer only. A few "kitchenware" programmers are around, but they are usually too complex to be built by newbies successfully. Although they are quite easily and cheaply available, they are going out of fashion now (as of 2006 are obsoleted by most manufacturers) and are not recommended for new designs nor for newbies.
Beware, some derivatives are denoted 89C51 or even 8051 but with a suffix, such as RD2, or Fxxx. These are not a plain 89C51/8051, but in fact they are higher-end derivatives, most of them capable of being programmed in-situ - see below.
- All other, modern chips - code memory is FLASH, and besides parallel programming they support some (sometimes more) form of serial programming, called usually In-Situ Programming (ISP). Generally, they split into 3 groups:
- SPI-like ISP (AT89Sxx, AT89LPxx, P89LPC9xx)
These are the cheaper types of chips. The SPI-like interface consists of clock (CLK), data in both directions (MISO and MOSI) and one or more control signals (often, the reset is involved). Although these chips are cheap, easily available and the programming interface seems to be simple, there are many caveats in their programming. Not really recommended for newbies, unless professionally built programming equipment and/or development board is available.
- ISP via UART (89C51RD2-family, ADuC8xx, DS89C4x0, high-end P89LPC9xx)
These chips tend to be in the middle and upper range of 8051-derivatives, both in price and amount of integrated memory and peripherals. However, the programming interface is clean, counterpart (COM port) is readily available on PCs together with appropriate programming software, and the chance for success in programming is high. Recommended for the newbies' first project.
- proprietary protocols, JTAG* (uPSD3xxx, VERSA, some of SiLabs)
This group contains the "higher-end" derivatives, which are not typically used by newbies. "Homebrew" implementation of these protocols and/or interfaces ("cables") is not suitable for newbies; however, development boards/kits containing these chips are available, providing very good start for newbies, as these chips usually feature some sort of built-in in-circuit emulation and the development kits come with associated development environment (IDE) on PC.
- SPI-like ISP (AT89Sxx, AT89LPxx, P89LPC9xx)
-------
* Although JTAG as a hardware (clocked serial) interface is standard; the programming protocols (and "emulator protocols") are proprietary.
addition to 'programming chips'
Submitted By: Erik Malund FAQ Last Modified: 08/29/06
- C proprietary protocols, JTAG (uPSD3xxx, VERSA)
This group contains relatively rarely used chips. Not recommended for newbies.
It was years ago that SILabs announced they had sold 10.000 devboards, 10.000+ users is hardly "relatively rarely used". Who knows how many they have sold since. The SILabs chips implement an ICE function as well as the download which, in my opinion is "recommended for newbies".
Erik
Add Information to this FAQ: If you have additional information or alternative solutions to this question, you may add to this FAQ by clicking here.