Datasheet
ATmega48PA/88PA/168PA [DATASHEET]
9223F–AVR–04/14
262
Figure 28-5. Programming the FUSES Waveforms
28.7.11 Programming the Lock Bits
The algorithm for programming the lock bits is as follows (refer to Section 28.7.4 “Programming the Flash” on page 258 for
details on command and data loading):
1. A: Load command “0010 0000”.
2. C: Load data low byte. Bit n = “0” programs the lock bit. If LB mode 3 is programmed (LB1 and LB2 is pro-
grammed), it is not possible to program the boot lock bits by any external programming mode.
3. Give WR
a negative pulse and wait for RDY/BSY to go high.
The Lock bits can only be cleared by executing chip erase.
28.7.12 Reading the Fuse and Lock Bits
The algorithm for reading the fuse and lock bits is as follows (refer to Section 28.7.4 “Programming the Flash” on page 258
for details on command loading):
1. A: Load command “0000 0100”.
2. Set OE
to “0”, BS2 to “0” and BS1 to “0”. The status of the fuse low bits can now be read at DATA (“0” means
programmed).
3. Set OE
to “0”, BS2 to “1” and BS1 to “1”. The status of the fuse high bits can now be read at DATA (“0” means
programmed).
4. Set OE to “0”, BS2 to “1”, and BS1 to “0”. The status of the extended fuse bits can now be read at DATA (“0”
means programmed).
5. Set OE
to “0”, BS2 to “0” and BS1 to “1”. The status of the lock bits can now be read at DATA (“0” means
programmed).
6. Set OE
to “1”.
0x40
AC
DATA
XA1
XA0
BS1
BS2
XTAL1
WR
RDY/BSY
OE
RESET +12V
0x40 0x40 DATA
A
DATA XX
C
Write Fuse Low byte Write Fuse High byte Write Extended Fuse byte
XXDATA
A
XX
C