Programming the flash memory, 1 physical interface – Rainbow Electronics AT89LP216 User Manual
Page 65
65
3621A–MICRO–6/06
AT89LP216 [Preliminary]
23. Programming the Flash Memory
The Atmel AT89LP216 microcontroller features 2K bytes of on-chip In-System Programmable
Flash program memory. In-System Programming allows programming and reprogramming of
the microcontroller positioned inside the end system. Using a simple 4-wire SPI interface, the In-
System programmer communicates serially with the AT89LP216 microcontroller, reprogram-
ming all nonvolatile memories on the chip. In-System Programming eliminates the need for
physical removal of the chips from the system. This will save time and money, both during devel-
opment in the lab, and when updating the software or parameters in the field. The ISP interface
of the AT89LP216 includes the following features:
• Four-wire SPI Programming Interface
• Active-low Reset Entry into Programming
• Slave Select allows multiple devices on same interface
• User Signature Array
• Flexible Page Programming
• Row Erase Capability
• Page Write with Auto-Erase Commands
• Programming Status Register
For more detailed information on In-System Programming, refer to the Application Note entitled
“AT89LP In-System Programming Specification”.
23.1
Physical Interface
In-System Programming utilizes the Serial Peripheral Interface (SPI) pins of an AT89LP216
microcontroller. The SPI is a full-duplex synchronous serial interface consisting of four wires:
Serial Clock (SCK), Master-In/Slave-out (MISO), Master-out/Slave-in (MOSI), and an active-low
Slave Select (SS). When programming an AT89LP216 device, the programmer always operates
as the SPI master, and the target system always operates as the SPI slave. To enter or remain
in In-System Programming mode the device’s reset line (RST) must be held active (low). With
the addition of VCC and GND, an AT89LP216 microcontroller can be programmed with a mini-
mum of seven connections as shown in
.
Figure 23-1. In-System Programming Device Connections
AT89LP216
VCC
P1.3/RST
P1.7/SCK
P1.5/MOSI
GND
Serial Clock
Serial In
RST
P1.4/SS
P1.6/MISO
Serial Out
SS