Datasheet
160
2586D–AVR–02/06
ATtiny25/45/85
• Address High byte needs only be loaded before programming or reading a new 256 word
window in Flash or 256 byte EEPROM. This consideration also applies to Signature bytes
reading.
23.8.3 Chip Erase
The Chip Erase will erase the Flash and EEPROM
(1)
memories plus Lock bits. The Lock bits are
not reset until the Program memory has been completely erased. The Fuse bits are not
changed. A Chip Erase must be performed before the Flash and/or EEPROM are re-
programmed.
Note: 1. The EEPROM memory is preserved during Chip Erase if the EESAVE Fuse is programmed.
1. Load command “Chip Erase” (see Table 23-15).
2. Wait after Instr. 3 until SDO goes high for the “Chip Erase” cycle to finish.
3. Load Command “No Operation”.
23.8.4 Programming the Flash
The Flash is organized in pages, see Table 23-10 on page 155. When programming the Flash,
the program data is latched into a page buffer. This allows one page of program data to be pro-
grammed simultaneously. The following procedure describes how to program the entire Flash
memory:
1. Load Command “Write Flash” (see Table 23-15).
2. Load Flash Page Buffer.
3. Load Flash High Address and Program Page. Wait after Instr. 3 until SDO goes high for
the “Page Programming” 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 23-7, Figure 23-8 and Table 23-16 for details.
Figure 23-6. Addressing the Flash which is Organized in Pages
PROGRAM MEMORY
WORD ADDRESS
WITHIN A PAGE
PAGE ADDRESS
WITHIN THE FLASH
INSTRUCTION WORD
PAG E
PCWORD[PAGEMSB:0]:
00
01
02
PAGEEND
PAG E
PCWORDPCPAGE
PCMSB
PAGEMSB
PROGRAM
COUNTER