
196
8246B–AVR–09/11
ATtiny2313A/4313
– A: Byte programming. The EEPROM array is programmed one byte at a time by
supplying the address and data together with the Write instruction. EEPROM
memory locations are automatically erased before new data is written. If polling
(RDY/BSY) is not used, the user must wait at least t
WD_EEPROM before issuing the
next byte (See
Table 21-9). In a chip erased device, no 0xFFs in the data file(s) need
to be programmed
– B: Page programming (the EEPROM array is programmed one page at a time). The
memory page is loaded one byte at a time by supplying the 6 LSB of the address
and data together with the Load EEPROM Memory Page instruction. The EEPROM
memory page is stored by loading the Write EEPROM Memory Page Instruction with
the 7 MSB of the address. When using EEPROM page access only byte locations
loaded with the Load EEPROM Memory Page instruction are altered and the
remaining locations remain unchanged. If polling (RDY/BSY) is not used, the user
must wait at least t
WD_EEPROM before issuing the next byte (See Table 21-9). In a chip erased device, no 0xFF in the data file(s) need to be programmed
6.
Any memory location can be verified by using the Read instruction, which returns the
content at the selected address at the serial output pin (MISO)
7.
At the end of the programming session, RESET can be set high to commence normal
operation
8.
Power-off sequence (if required): set RESET to “1”, and turn V
CC power off
21.3.3
Programming Instruction Set
The instruction set for serial programming is described in
Table 21-8.Table 21-8.
Serial Programming Instruction Set
Instruction
Instruction Format
Operation
Byte 1
Byte 2
Byte 3
Byte4
Programming Enable
1010 1100
0101 0011
xxxx xxxx
Enable Serial Programming after
RESET goes low.
Chip Erase
1010 1100
100x xxxx
xxxx xxxx
Chip Erase EEPROM and Flash.
Read Program Memory
0010 H000
0000 00aa
bbbb bbbb
oooo oooo
Read H (high or low) data o from
Program memory at word address a:b.
Load Program Memory Page
0100 H000
000x xxxx
xxxx bbbb
iiii iiii
Write H (high or low) data i to Program
Memory page at word address b. Data
low byte must be loaded before Data
high byte is applied within the same
address.
Write Program Memory Page
0100 1100
0000 00aa
bbbb xxxx
xxxx xxxx
Write Program Memory Page at
address a:b.
Read EEPROM Memory
1010 0000
000x xxxx
xbbb bbbb
oooo oooo
Read data o from EEPROM memory at
address b.
Write EEPROM Memory
1100 0000
000x xxxx
xbbb bbbb
iiii iiii
Write data i to EEPROM memory at
address b.
Load EEPROM Memory
Page (page access)
1100 0001
0000 0000
0000 00bb
iiii iiii
Load data i to EEPROM memory page
buffer. After data is loaded, program
EEPROM page.