108
ATmega103(L)
0945G–09/01
Serial Downloading
Both the Flash and EEPROM memory arrays can be programmed using the serial inter-
face while RESET is pulled to GND, or when PEN is low during Power-on Reset. The
serial interface consists of pins SCK, RXD/PDI (input) and TXD/PDO (output). After
RESET is set low, the Programming Enable instruction needs to be executed first before
program/erase instructions can be executed.
For the EEPROM, an auto-erase cycle is provided within the self-timed Write instruction
and there is no need to first execute the Chip Erase instruction. The Chip Erase instruc-
tion turns the content of every memory location in both the program and EEPROM
arrays into $FF.
The program and EEPROM memory arrays have separate address spaces: $0000 to
$FFFF for program memory and $0000 to $0FFF for EEPROM memory.
Either an external clock is supplied at pin XTAL1 or a crystal needs to be connected
across pins XTAL1 and XTAL2. The minimum low and high periods for the serial clock
(SCK) input are defined as follows:
Low: > 2 XTAL1 clock cycles
High: > 2 XTAL1 clock cycles
Figure 77.
Serial Programming
Note:
Instruction in and data out is not using the SPI pins as on other AVR devices. SCK uses
the SPI pin as usual.
Serial Programming
Algorithm
When writing serial data to the ATmega103(L), data is sampled by the ATmega
103/103L on the rising edge of SCK. When reading data from the ATmega103(L), data
is clocked on the falling edge of SCK. See Figure 78 for an explanation. To program and
verify the ATmega103(L) in the serial programming mode, the following sequence is
recommended (See 4-byte instruction formats in Table 44.):
1.
Power-up sequence: Apply power between V
CC
and GND while RESET and
SCK are set to “0”. The RESET signal must be kept low during the complete
serial programming session. If a crystal is not connected across pins XTAL1 and
XTAL2, apply a clock signal to the XTAL1 pin. In some systems, the programmer
cannot guarantee that SCK is held low during power-up. In this case, RESET
must be given a positive pulse of at least two XTAL1 cycles duration after SCK
has been set to “0”.
ATmega103(L)
VCC
V
CC
PE0 (PD1/RXD)
PE1 (PD0/TXD)
PB1 (SCK)
RESET
GND
XTAL1
INSTR. IN
DATA OUT
CLOCK IN