Datasheet

267
ATmega48PA/88PA/168PA [DATASHEET]
9223F–AVR–04/14
If the LSB in RDY/BSY data byte out is ‘1’, a programming operation is still pending. Wait until this bit returns ‘0’ before the
next instruction is carried out.
Within the same page, the low data byte must be loaded prior to the high data byte.
After data is loaded to the page buffer, program the EEPROM page, see Figure 28-8.
Figure 28-8. Serial Programming Instruction Example
28.8.4 SPI Serial Programming Characteristics
Figure 28-9. Serial Programming Waveforms
For characteristics of the SPI module see Section 29.6 “SPI Timing Characteristics” on page 273.
Byte 1 Byte 2 Byte 3 Byte 4
Page 0
Page 1
Page 2
Adr LBSAdr MBS
Bit 15 B 0 Bit 15 B 0
Byte 1 Byte 2 Byte 3 Byte 4
Adr LBSAdr MBS
Page N-1
Program Memory/
EEPROM Memory
Serial Programming Instruction
Page Buffer
Page Number
Page Offset
Load Program Memory Page (High/Low Byte)/
Load EEPROM Memory Page (page access)
Write Program Memory Page/
Write EEPROM Memory Page
SERIAL DATA INPUT
(MOSI)
SERIAL DATA OUTPUT
(MISO)
SERIAL CLOCK INPUT
(SCK)
SAMPLE
MSB LSB
MSB LSB