Circuit programs Atmel AVR microcontrollers

Guo-Yin Xu, XuMicro, Houston, TX -- EDN, 3/30/2000

Atmel AVR µCs feature an enhanced RISC architecture that purportedly offer the highest MIPS-per-milliwatt capability in the 8-bit µC market. Figure 1 shows an easy-to-build AVR µC-programming circuit that can program the 40-pin AT90S4414/8515, the 20-pin AT90S1200/2313, and the eight-pin AT90S2323/2343. The programmer uses only three chips. It connects to the host PC's serial port via a MAX232 RS-232 transceiver, IC1. Power comes from a 9V wall cube and the 78L05 linear regulator, VR1. The AT89C4051 µC (IC2) works with the 11.0592-MHz oscillator, and controls all programming tasks. LED1 indicates the programmer's status. The circuit exploits the fact that all AVR µCs have a built-in SPI (serial-peripheral-interface) port that you can use to effect serial programming. The SPI port uses only the system-clock (SCK), master-output/slave-input (MOSI), and master-input/slave-output (MISO) pins. The AVR data book requires that, to place a µC in serial-programming mode, you must first pull the Reset and SCK pins low (Reference 1). Then, the µC must execute a programming-enable instruction before it can execute any program of erase instructions.

Hence, you need four pins to control the programming of a µC. For instance, the control signals from the AT89C4051 port pins P1.4 to P1.7 are for 40-pin µCs, the signals from P1.0 to P1.3 are for 20-pin µCs, and the signals from P3.2 to P3.5 are for eight-pin µCs. Note that you need pullup resistors for the AT89C4051 port pins P1.0 and P1.1, because these pins normally serve as analog-signal-input lines. Jumper JP1 controls the 5V power supply for 20- and eight-pin µCs. You should remove the jumper when programming 40-pin µCs, which use a hard-wired connection to the 5V power. The circuit uses two 4-MHz ceramic resonators: CR2 for 20-pin µCs, and CR/CR3 for 40- or eight-pin µCs. Because the wires for the resonators should be as short as possible, the circuit uses no switching or jumping mechanisms. Instead, it uses one more resonator, CR2 that's hard-wired to pins 4 and 5 of the 20-pin µC pins 14 and 15 of the ZIF socket. This connection does not disturb the programming of 40-pin µCs.

In addition to the hardware in Figure 1, the programmer also needs associated software. A binary file, AVRP1.BIN, holds the finished AVR-programmer software, burned into the AT89C4051 µC by using an 8X51 EPROM/flash µC programmer (Reference 2). A DOS file, AVRP1.EXE, contains the host-PC communication program. Click here to download these routines. (DI #2504)

REFERENCE

1."8-bit RISC Microcontrollers Data Book," Atmel Corp, August 1999.

2. Xu, Guo-Yin, "8X51 EPROM/flash microcontroller programmer," Circuit Cellar Magazine, April 1998.




ADVERTISEMENT

ADVERTISEMENT

Feedback Loop


Post a CommentPost a Comment

There are no comments posted for this article.

Related Content

 

By This Author

There are no additional articles written by this author.


ADVERTISEMENT

Knowledge Center



Technology Quick Links

EDN Marketplace


©1997-2008 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy

Please visit these other Reed Business sites

ADVERTISEMENT
You will be redirected to your destination in few seconds.