.
Table 48. Serial Programming Instruction Set(1)
|
|
|
|
Instruction Format |
|
|
|
|
|
|
|
|
|
|
|
|
|
||
Instruction |
|
Byte 1 |
Byte 2 |
Byte 3 |
Byte 4 |
|
Operation |
||
|
|
|
|
|
|
|
|
|
|
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 (high or low) data o from |
|
|
|
|
|
|
|
|
|
program memory at word address |
|
|
|
|
|
|
|
|
|
a:b. |
|
|
|
|
|
|
|
|
|
|
|
Load Program Memory |
|
0100 |
H000 |
xxxx xxxx |
xxbb bbbb |
iiii iiii |
|
Write H (high or low) data i to |
|
Page |
|
|
|
|
|
|
|
program memory page at word |
|
|
|
|
|
|
|
|
|
address b. |
|
|
|
|
|
|
|
|
|
|
|
Write Program Memory |
|
0100 |
1100 |
xxxa aaaa |
bbxx xxxx |
iiii iiii |
|
Write program memory page at |
|
Page |
|
|
|
|
|
|
|
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 |
xx65 4321 |
|
Read Lock bits. “0” = programmed, |
|
|
|
|
|
|
|
|
|
“1” = unprogrammed. |
|
|
|
|
|
|
|
|
|
|
|
Write Lock Bits |
|
1010 |
1100 |
111x xxxx |
xxxx xxxx |
1165 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. |
|
|
|
|
|
|
|
|
|
|
|
Write Fuse Bits |
|
1010 |
1100 |
101x xxxx |
xxxx xxxx |
1D1B A987 |
|
Set bits D - A, 9 - 7 = “0” to |
|
|
|
|
|
|
|
|
|
program, “1” to unprogram |
|
|
|
|
|
|
|
|
|
|
|
Read Fuse Bits |
|
0101 |
0000 |
xxxx xxxx |
xxxx xxxx |
xDCB A987 |
|
Read Fuse bits. “0” = programmed, |
|
|
|
|
|
|
|
|
|
“1” = unprogrammed |
|
|
|
|
|
|
|
|
|
|
|
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 |
|
|
|
|
|
|
|
||
126 ATmega161(L)
1228B–09/01
ATmega161(L)
Serial Programming |
Figure 82. Serial Programming Timing |
Characteristics |
|
MOSI
tOVSH |
|
|
|
tSHOX |
tSLSH |
|
|
SCK
tSHSL
MISO
tSLIV
Table 49. Serial Programming Characteristics, TA = -40°C to 85°C, VCC = 2.7 - 5.5V (unless otherwise noted)
Symbol |
Parameter |
|
Min |
Typ |
Max |
Units |
|
|
|
|
|
|
|
1/tCLCL |
Oscillator Frequency |
(VCC = 2.7 - 5.5V) |
0 |
|
4 |
MHz |
|
|
(VCC = 4.0 - 5.5V) |
0 |
|
8 |
MHz |
tCLCL |
Oscillator Period |
(VCC = 2.7 - 5.5V) |
250 |
|
|
ns |
|
|
(VCC = 4.0 - 5.5V) |
125 |
|
|
ns |
tSHSL |
SCK Pulse Width High |
|
2 tCLCL |
|
|
ns |
tSLSH |
SCK Pulse Width Low |
|
2 tCLCL |
|
|
ns |
tOVSH |
MOSI Setup to SCK High |
|
tCLCL |
|
|
ns |
tSHOX |
MOSI Hold after SCK High |
|
2 tCLCL |
|
|
ns |
tSLIV |
SCK Low to MISO Valid |
|
10 |
16 |
32 |
ns |
127
1228B–09/01
..................................Operating Temperature |
-55°C to +125°C |
*NOTICE: Stresses beyond those listed under “Absolute |
|||
|
|
|
|
|
Maximum Ratings” may cause permanent dam- |
Storage Temperature ..................................... |
-65°C to +150°C |
age to the device. This is a stress rating only and |
|||
|
|
|
|
|
functional operation of the device at these or |
Voltage on Any Pin except |
RESET |
|
other conditions beyond those indicated in the |
||
with Respect to Ground ............................. |
-1.0V to VCC + 0.5V |
operational sections of this specification is not |
|||
Voltage on |
|
with Respect to Ground -1.0V to +13.0V |
implied. Exposure to absolute maximum rating |
||
RESET |
conditions for extended periods may affect |
||||
Maximum Operating Voltage |
6.6V |
device reliability. |
|||
|
|||||
DC Current per I/O Pin ............................................... |
40.0 mA |
|
|||
DC Current VCC and GND Pins ............................... |
200.0 mA |
|
|||
|
|
|
|
|
|
DC Characteristics
TA = -40°C to 85°C, VCC = 2.7V to 5.5V (unless otherwise noted)(1)(2)(3)(4)(5)
Symbol |
Parameter |
Condition |
Min |
|
Typ |
Max |
Units |
||||||
|
|
|
|
|
|
|
|
||||||
VIL |
Input Low Voltage |
(Except XTAL1) |
-0.5 |
|
|
0.3 VCC(1) |
V |
||||||
VIL1 |
Input Low Voltage |
(XTAL1) |
-0.5 |
|
|
0.2 VCC(1) |
V |
||||||
VIH |
|
|
|
|
|
|
|
|
(2) |
|
|
|
|
Input High Voltage |
(Except XTAL1, RESET) |
0.6 VCC |
VCC + 0.5 |
V |
|||||||||
|
|
||||||||||||
VIH1 |
Input High Voltage |
(XTAL1) |
0.8 VCC |
(2) |
|
VCC + 0.5 |
V |
||||||
|
|
||||||||||||
VIH2 |
|
|
|
|
|
|
|
|
(2) |
|
|
|
|
Input High Voltage |
(RESET) |
0.9 VCC |
VCC + 0.5 |
V |
|||||||||
|
|
||||||||||||
VOL |
Output Low Voltage(3) |
IOL = 20 mA, VCC = 5V |
|
|
|
0.6 |
V |
||||||
(Ports A,B,C,D) |
IOL = 10 mA, VCC = 3V |
|
|
|
0.5 |
V |
|||||||
|
|
|
|
||||||||||
|
Output High Voltage(4) |
I |
OH |
= -3 mA, V = 5V |
4.2 |
|
|
|
V |
||||
VOH |
|
|
|
CC |
|
|
|
|
|
||||
(Ports A,B,C,D) |
IOH = -1.5 mA, VCC = 3V |
2.3 |
|
|
|
V |
|||||||
|
|
|
|
||||||||||
IIL |
Input Leakage |
VCC = 5.5V, pin low |
|
|
|
8.0 |
µA |
||||||
Current I/O pin |
(absolute value) |
|
|
|
|
|
|||||||
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
||||||
IIH |
Input Leakage |
VCC = 5.5V, pin high |
|
|
|
980 |
nA |
||||||
Current I/O pin |
(absolute value) |
|
|
|
|
|
|||||||
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RRST |
Reset Pull-up Resistor |
|
|
|
|
|
|
100 |
|
|
500 |
kΩ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RI/O |
I/O Pin Pull-up Resistor |
|
|
|
|
|
|
35 |
|
|
120 |
kΩ |
|
|
|
Active mode, VCC = 3V, |
|
|
|
3.0 |
mA |
||||||
|
|
4 MHz |
|
|
|
||||||||
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
||||||
ICC |
|
Idle mode VCC = 3V, |
|
|
|
1.2 |
mA |
||||||
Power Supply Current |
4 MHz |
|
|
|
|||||||||
|
|
|
|
|
|||||||||
|
|
WDT enabled, VCC = 3V |
|
|
9 |
15.0 |
µA |
||||||
|
Power-down Mode(5) |
|
|
|
|
|
|
||||||
|
WDT disabled, VCC = 3V |
|
|
<1 |
2.0 |
µA |
|||||||
128 ATmega161(L)
1228B–09/01
ATmega161(L)
DC Characteristics (Continued)
T = -40°C to 85°C, V |
CC |
= 2.7V to 5.5V (unless otherwise noted)(1)(2)(3)(4)(5) |
|
|
|
|||
A |
|
|
|
|
|
|
|
|
Symbol |
Parameter |
|
Condition |
Min |
Typ |
Max |
Units |
|
|
|
|
|
|
|
|
||
VACIO |
Analog Comparator |
VCC = 5V |
|
|
40 |
mV |
||
Input Offset Voltage |
Vin = VCC/2 |
|
|
|||||
|
|
|
|
|
||||
IACLK |
Analog Comparator |
VCC = 5V |
-50 |
|
50 |
nA |
||
Input Leakage Current |
Vin = VCC/2 |
|
||||||
|
|
|
|
|
||||
tACPD |
Analog Comparator |
VCC = 2.7V |
|
750 |
|
ns |
||
Propagation Delay |
VCC = 4.0V |
|
500 |
|
||||
|
|
|
|
|||||
Notes: 1. “Max” means the highest value where the pin is guaranteed to be read as low.
2.“Min” means the lowest value where the pin is guaranteed to be read as high.
3.Although each I/O port can sink more than the test conditions (20 mA at VCC = 5V, 10 mA at VCC = 3V) under steady-state conditions (non-transient), the following must be observed:
1] The sum of all IOL, for all ports, should not exceed 200 mA.
2] The sum of all IOL, for ports B0 - B7, D0 - D7 and XTAL2, should not exceed 100 mA.
3] The sum of all IOL, for ports A0 - A7, ALE, OC1B and C0 - C7 should not exceed 100 mA.
If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater than the listed test condition.
4.Although each I/O port can source more than the test conditions (3 mA at VCC = 5V, 1.5 mA at VCC = 3V) under steady-state conditions (non-transient), the following must be observed:
1] The sum of all IOH, for all ports, should not exceed 200 mA.
2] The sum of all IOH, for ports B0 - B7, D0 - D7 and XTAL2, should not exceed 100 mA.
3] The sum of all IOH, for ports A0 - A7, ALE, OC1B and C0 - C7 should not exceed 100 mA.
If IOH exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to source current greater than the listed test condition.
5.Minimum VCC for power-down is 2V.
129
1228B–09/01
External Clock Drive
Waveforms
Figure 83. External Clock
VIH1
VIL1
Table 50. External Clock Drive(1)
|
|
VCC = 2.7V to 5.5V |
VCC = 4.0V to 5.5V |
|
||
Symbol |
Parameter |
Min |
Max |
Min |
Max |
Units |
|
|
|
|
|
|
|
1/tCLCL |
Oscillator Frequency |
0 |
4 |
0 |
8 |
MHz |
tCLCL |
Clock Period |
250 |
|
125 |
|
ns |
tCHCX |
High Time |
100 |
|
50 |
|
ns |
tCLCX |
Low Time |
100 |
|
50 |
|
ns |
tCLCH |
Rise Time |
|
1.6 |
|
0.5 |
µs |
tCHCL |
Fall Time |
|
1.6 |
|
0.5 |
µs |
Notes: 1. See “External Data Memory Timing” for a description of how the duty cycle influences the timing for the external data memory.
130 ATmega161(L)
1228B–09/01