126
ATmega161(L)
1228B–09/01
.
Note:
1.
a
= address high bits
b
= address low bits
H
= 0 – Low byte, 1 – High Byte
o
= data out
i
= data in
x = don’t care
1
= lock bit 1
2
= lock bit 2
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
A
= BODEN Fuse
B
= BODLEVEL Fuse
C
= SPIEN Fuse
D
= BOOTRST Fuse
Table 48.
Serial Programming Instruction Set
Instruction
Instruction Format
Operation
Byte 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
H
000
xxxa
aaaa
bbbb bbbb
oooo oooo
Read
H
(high or low) data
o
from
program memory at word address
a
:
b
.
Load Program Memory
Page
0100
H
000
xxxx xxxx
xx
bb 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
bb
xx xxxx
iiii iiii
Write program memory page at
address
a
:
b
.
Read EEPROM Memory
1010 0000
xxxx xxx
a
bbbb bbbb
oooo oooo
Read data
o
from EEPROM
memory at address
a
:
b
.
Write EEPROM Memory
1100 0000
xxxx xxx
a
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 xx
bb
oooo oooo
Read Signature byte
o
at address
b
.
Write Fuse Bits
1010 1100
101x xxxx
xxxx xxxx
1
D
1
B A987
Set bits
D
-
A
,
9
-
7
= “0” to
program, “1” to unprogram
Read Fuse Bits
0101 0000
xxxx xxxx
xxxx xxxx
x
D
C
B A987
Read Fuse bits. “0” = programmed,
“1” = unprogrammed