5 programming the eeprom, 6 reading the flash, 7 reading the eeprom – Rainbow Electronics ATmega8HVD User Manual
Page 138: 8 programming and reading the fuse and lock bits, 9 reading the signature bytes and calibration byte, 10 power-off sequence, Atmega4hvd/8hvd

138
8052B–AVR–09/08
ATmega4HVD/8HVD
Figure 24-4. High-voltage Serial Programming Waveforms
24.8.5
Programming the EEPROM
The EEPROM is organized in pages, see
Table 26-8 on page 148
. When programming the
EEPROM, the data is latched into a page buffer. This allows one page of data to be pro-
grammed simultaneously. The programming algorithm for the EEPROM Data memory is as
follows (refer to
Table 24-14
):
1.
Load Command “Write EEPROM”.
2.
Load EEPROM Page Buffer.
3.
Program EEPROM Page. Wait after Instr. 2 until SDO goes high for the “Page Pro-
gramming” cycle to finish.
4.
Repeat 2 through 3 until the entire EEPROM is programmed or until all data has been
programmed.
End Page Programming by Loading Command “No Operation”.
24.8.6
Reading the Flash
The algorithm for reading the Flash memory is as follows (refer to
Table 24-14
):
1.
Load Command "Read Flash".
2.
Read Flash Low and High Bytes. The contents at the selected address are available at
serial output SDO.
24.8.7
Reading the EEPROM
The algorithm for reading the EEPROM memory is as follows (refer to
Table 24-14
):
1.
Load Command “Read EEPROM”.
2.
Read EEPROM Byte. The contents at the selected address are available at serial out-
put SDO.
24.8.8
Programming and Reading the Fuse and Lock Bits
The algorithms for programming and reading the Fuse Low/High bits and Lock bits are shown
in
Table 24-14
.
24.8.9
Reading the Signature Bytes and Calibration Byte
The algorithms for reading the Signature bytes and Calibration byte are shown in
Table 24-14
.
24.8.10
Power-off sequence
Set SCI to “0”. Set RESET to “1”. Turn V
CC
power off.
MSB
MSB
MSB
LSB
LSB
LSB
0
1
2
3
4
5
6
7
8
9
10
SDI
PB0
SII
PB1
SDO
PB2
SCI
PB3