Datasheet

187
ATmega323(L)
1457E11/01
Programming the EEPROM The programming algorithm for the EEPROM data memory is as follows (refer to Pro-
gramming the Flash on page 185 for details on Command, Address and Data loading):
1. A: Load Command 0001 0001.
2. H: Load Address High Byte ($00 - $03)
3. B: Load Address Low Byte ($00 - $FF)
4. C: Load Data Low Byte ($00 - $FF)
K: Write Data Low Byte
1. Set BS1 to 0. This selects low data.
2. Give WR
a negative pulse. This starts programming of the data byte. RDY/BSY
goes low.
3. Wait until to RDY/BSY
goes high before programming the next byte.
(See Figure 96 for signal waveforms)
The loaded command and address are retained in the device during programming. For
efficient programming, the following should be considered.
The command needs only be loaded once when writing or reading multiple memory
locations.
Address high byte needs only be loaded before programming a new 256 byte
window in the EEPROM.
Skip writing the data value $FF, that is the contents of the entire EEPROM after a
Chip Erase.
These considerations also applies to Flash, EEPROM and Signature bytes reading.
Figure 96. Programming the EEPROM Waveforms
Reading the Flash The algorithm for reading the Flash memory is as follows (refer to Programming the
Flash on page 185 for details on Command and Address loading):
1. A: Load Command 0000 0010.
2. H: Load Address High Byte ($00 - $3F)
3. B: Load Address Low Byte ($00 - $FF)
4. Set OE
to 0, and BS1 to 0. The Flash word low byte can now be read at DATA.
$11 ADDR. HIGH ADDR. LOW DA TA LOW
DATA
XA1
XA2
BS1
XTAL1
RDY/BSY
RESET
WR
OE
+12V
BS2
PAGEL