Specifications
157
3706C–MICRO–2/11
AT89LP3240/6440
• When using the Internal RC Oscillator during debug, DDA is located on the XTAL1/P4.0 pin.
The P4.0 I/O function cannot be emulated in this mode.
• When using the External Clock during debug, DDA is located on the XTAL2/P4.1 pin and the
system clock drives XTAL1/P4.0. The P4.1 I/O and CLKOUT functions cannot be emulated in
this mode.
• When using the Crystal Oscillator during debug, DDA is located on the P4.3 pin and the
crystal connects to XTAL1/P4.0 and XTAL2/P4.1. The P4.3 I/O function ca
nnot be emulated
in this mode.
25. Programming the Flash Memory
The Atmel AT89LP3240/6440 microcontroller features 64K bytes of on-chip In-System Program-
mable Flash program memory and 8K bytes of nonvolatile Flash data memory. In-System
Programming allows programming and reprogramming of the microcontroller positioned inside
the end sys tem. Using a simple 4-wire SPI interfa ce, the programmer commu nicates serially
with the AT89LP3240/6440 microcontroller, reprogramming all nonvolatile memories on the
chip. In-System Programming eliminates the need for physica l removal of the chips from the
system. This will save time and money, both during development in the lab, and when upda ting
the software or parameters in the field. The programming interface of the AT89LP3240/6440
includes the following features:
•Four-wire serial SPI Programming Interface or 11-pin Parallel Interface
• Active-low Reset Entry into Programming
• Slave Select a
llows 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”.
25.1 Physical Interface
The AT89LP3240/6440 provides a standard programming command set with two physical inter-
faces: a bit-serial and a byte-para llel interface. Normal Flash programming utilizes the Serial
Peripheral Interface (SPI) pins of an AT89LP3240/6440 microcontroller. The SPI is a full-duplex
synchronous serial interface consisting of four wire
s: Serial Clock (SCK), Master-In/Slave-out
(MISO), Master-out/Slave-in (MOSI), and an active-low chip select and frame signal (SS
). When
programming an AT89LP3240/6440 device, the programmer always operates as the SPI mas-
ter, and the target system always operates as the SPI slave. To enter or remain in Programming
mode the device’s reset line (RST
) must be held active (low). With the addition of VDD and
GND, a n AT89LP3240/6440 microcontroller can be programmed with a minimum of seven con-
nections as shown in Figure 25-1.
In addition to being a chip select, the SS
pin also is used to frame a command packet. SS must
go low before the start of a command and must return high to complete the command. SS
must
NOT be tied to ground as this will prevent the interface from recognizing mutiple com-
mands. SS
should be connected to the programming master for correct operation.










