Manual

128
ATmega161(L)
1228CAVR08/02
.
Note: 1. a = address high bits
b = address low bits
H =0 Low byte, 1 High Byte
o = data out
i =datain
x = dontcare
1
=lockbit1
2
=lockbit2
3
= Boot Lock Bit1
4
= Boot Lock Bit2
5
= Boot Lock Bit11
6
= Boot Lock Bit12
7 = CKSEL0 Fuse
8 = CKSEL1 Fuse
9 = CKSEL2 Fuse
B =SUTFuse
C = SPIEN Fuse
D = BOOTRST Fuse
Table 48. Serial Programming Instruction Set
(1)
Instruction
Instruction Format
OperationByte 1 Byte 2 Byte 3 Byte 4
Programming Enable 1010 1100 0101 0011 xxxx xxxx xxxx xxxx Enable Serial Programming after
RESET
goes low.
Chip Erase 1010 1100 100x xxxx xxxx xxxx xxxx xxxx Chip Erase EEPROM and Flash.
Read Program Memory 0010 H000 xxxa aaaa bbbb bbbb oooo oooo Read H (highorlow)datao from
Program memory at word address
a:b.
Load Program Memory
Page
0100 H000 xxxx xxxx xxbb bbbb iiii iiii Write H (high or low) data i to
Program memory page at word
address b.
Write Program Memory
Page
0100 1100 xxxa aaaa bbxx xxxx iiii iiii Write Program memory page at
address a:b.
Read EEPROM Memory 1010 0000 xxxx xxxa bbbb bbbb oooo oooo Read data o from EEPROM
memory at address a:b.
Write EEPROM Memory 1100 0000 xxxx xxxa bbbb bbbb iiii iiii Write data i to EEPROM memory at
address a:b.
Read Lock bits 0101 1000 xxxx xxxx xxxx xxxx xx
65 4321
Read Lock bits. 0= programmed,
1= unprogrammed.
Write Lock bits 1010 1100 111x xxxx xxxx xxxx 11
65 4321
Write Lock bits. Set bits
6
-
1
= 0
to program Lock bits.
Read Signature Byte 0011 0000 xxxx xxxx xxxx xxbb oooo oooo Read Signature byte o at address
b.
WriteFusebits 1010 1100 101x xxxx xxxx xxxx 1D1B1987 Set bits D - B, 9 - 7 = 0to
program, 1to unprogram
Read Fuse bits 0101 0000 xxxx xxxx xxxx xxxx xDCB1987 Read Fuse bits. 0= programmed,
1= unprogrammed