120
ATmega161(L)
1228B–09/01
3.
Wait until to RDY/BSY goes high before programming the next byte.
(See Figure 79 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 to be loaded only once when writing or reading multiple
memory locations.
•
Address high byte only needs to be loaded before programming a new 256-word
page in the EEPROM.
•
Skip writing the data value $FF, that is, the contents of the entire EEPROM after a
Chip Erase.
These considerations also apply to Flash, EEPROM and Signature bytes reading.
Figure 79.
Programming the EEPROM Waveforms
Reading the Flash
The algorithm for reading the Flash memory is as follows (refer to “Programming the
Flash” on page 117 for details on command and address loading):
1.
A: Load Command “0000 0010”.
2.
H: Load Address High Byte ($00 - $1F)
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.
5.
Set BS to “1”. The Flash word high byte can now be read at DATA.
6.
Set OE to “1”.
Reading the EEPROM
The algorithm for reading the EEPROM memory is as follows (refer to “Programming the
Flash” on page 117 for details on command and address loading):
1.
A: Load Command “0000 0011”.
2.
H: Load Address High Byte ($00 - $01)
3.
B: Load Address ($00 - $FF)
4.
Set OE to “0”, and BS1 to “0”. The EEPROM Data byte can now be read at
DATA.
5.
Set OE to “1”.
$11
ADDR. HIGH
ADDR. LOW
DATA LOW
DATA
XA1
XA2
BS1
XTAL1
RDY/BSY
RESET
WR
OE
+12V
BS2
PAGEL