Datasheet

157
ATtiny25/45/85 [DATASHEET]
2586Q–AVR–08/2013
1. Load command “Chip Erase” (see Table 20-16).
2. Wait after Instr. 3 until SDO goes high for the “Chip Erase” cycle to finish.
3. Load Command “No Operation”.
20.7.4 Programming the Flash
The Flash is organized in pages, see Table 20-12 on page 153. When programming the Flash, the program data is
latched into a page buffer. This allows one page of program data to be programmed simultaneously. The following
procedure describes how to program the entire Flash memory:
1. Load Command “Write Flash” (see Table 20-16).
2. Load Flash Page Buffer.
3. Load Flash High Address and Program Page. Wait after Instr. 3 until SDO goes high for the “Page Pro-
gramming” cycle to finish.
4. Repeat 2 through 3 until the entire Flash is programmed or until all data has been programmed.
5. End Page Programming by Loading Command “No Operation”.
When writing or reading serial data to the ATtiny25/45/85, data is clocked on the rising edge of the serial clock, see
Figure 20-5, Figure 21-6 and Table 21-12 for details.
Figure 20-4. Addressing the Flash which is Organized in Pages
Figure 20-5. High-voltage Serial Programming Waveforms
PROGRAM MEMORY
WORD ADDRESS
WITHIN A PAGE
PAGE ADDRESS
WITHIN THE FLASH
INSTRUCTION WORD
PAGE
PCWORD[PAGEMSB:0]:
00
01
02
PAGEEND
PAGE
PCWORDPCPAGE
PCMSB
PAGEMSB
PROGRAM
COUNTER
MSB
MSB
MSB LSB
LSB
LSB
012345678910
SDI
PB0
SII
PB1
SDO
PB2
SCI
PB3