3.4.1 EEPROM Data Memory Access

Using the “Read EEPROM Data Memory” command, EEPROM contents can be read one byte at a time. The command sends a memory address ($aa bb) to select a byte location in the EEPROM.

Table 3-7. Example, Reading $ab From EEPROM Location $3F
ActionMOSI, sent to the target AVRMISO, returned from the target AVR
Read $ab at address $3F$A0 00 3F xx$zz A0 00 AB

EEPROM is written one byte at a time, with the “Write EEPROM Memory” command. This command selects the byte to write just like “Read EEPROM Memory”, and transfers the data to be written in the last byte sent to the target. For some devices there is no method to detect when the write cycle has ended. The programmer should simply wait N ms before attempting to send another command to the interface (the delay N will depend on target device, and can be found in the programming section of the datasheet). For increased programming speed, polling can be used as described in the “Flash Program Memory Access” section. An example of an EEPROM Write is shown in the table below.

Table 3-8. Example, Writing $0F to EEPROM Location $11
ActionMOSI, sent to the target AVRMISO, returned from the target AVR
Write $0F at address $11$C0 00 11 0F$zz C0 00 11
Wait N ms