Datasheet

238
ATtiny828 [DATASHEET]
8371A–AVR–08/12
23.2.5 Programming the EEPROM
The EEPROM is organized in pages, see Table 95 on page 232. When programming the EEPROM, the program data is
latched into a page buffer. This allows one page of data to be programmed simultaneously. The programming algorithm
for the EEPROM data memory is as follows (see “Programming the Flash” on page 235 for details on loading command,
address and data):
z A: Load command “0001 0001”
z G: Load address high byte (0x00 – 0xFF)
z B: Load address low byte (0x00 – 0xFF)
z C: Load data (0x00 – 0xFF)
z E: Latch data (give PAGEL a positive pulse)
z K: Repeat steps B, C, and E until the entire buffer is filled
z L: Program EEPROM page:
z Set BS1 to “0”
z Give WR a negative pulse. This starts programming of the EEPROM page. RDY/BSY goes low
z Wait until to RDY/BSY goes high before programming the next page (See Figure 96 for signal waveforms)
EEPROM programming waveforms are illustrated in Figure 96, where XX means “don’t care” and letters refer to the
programming steps described above.
Figure 96. EEPROM Programming Waveforms
23.2.6 Reading the Flash
The algorithm for reading the Flash memory is as follows (see “Programming the Flash” on page 235 for details on
command and address loading):
z A: Load command “0000 0010”
z G: Load address high byte (0x00 – 0xFF)
z B: Load address low byte (0x00 – 0xFF)
z Set OE to “0”, and BS1 to “0”. The Flash word low byte can now be read at DATA
RDY/BSY
WR
OE
RESET +12V
PAGEL
BS2
0x11 ADDR. HIGH
DATA
ADDR. LOW DATA ADDR. LOW DATA XX
XA1
XA0
BS1
XTAL1
XX
AGBCEB C EL
K