Datasheet
247
ATmega48/88/168 Automotive [DATASHEET]
7530K–AVR–07/14
25.6 Serial Programming Pin Mapping
25.7 Parallel Programming
25.7.1 Enter Programming Mode
The following algorithm puts the device in parallel programming mode:
1. Apply 4.5 - 5.5V between V
CC
and GND.
2. Set RESET
to “0” and toggle XTAL1 at least six times.
3. Set the prog_enable pins listed in Table 25-9 on page 246 to “0000” and wait at least 100ns.
4. Apply 11.5 - 12.5V to RESET
. Any activity on prog_enable pins within 100 ns after +12V has been applied to
RESET
, will cause the device to fail entering programming mode.
5. Wait at least 50µs before sending a new command.
Table 25-11. Command Byte Bit Coding
Command Byte Command Executed
1000 0000 Chip erase
0100 0000 Write fuse bits
0010 0000 Write lock bits
0001 0000 Write flash
0001 0001 Write EEPROM
0000 1000 Read signature bytes and calibration byte
0000 0100 Read fuse and lock bits
0000 0010 Read flash
0000 0011 Read EEPROM
Table 25-12. No. of Words in a Page and No. of Pages in the Flash
Device Flash Size Page Size PCWORD No. of Pages PCPAGE PCMSB
ATmega48 2Kwords (4Kbytes) 32 words PC[4:0] 64 PC[10:5] 10
ATmega88 4Kwords (8Kbytes) 32 words PC[4:0] 128 PC[11:5] 11
ATmega168 8Kwords (16Kbytes) 64 words PC[5:0] 128 PC[12:6] 12
Table 25-13. No. of Words in a Page and No. of Pages in the EEPROM
Device EEPROM Size Page Size PCWORD No. of Pages PCPAGE EEAMSB
ATmega48 256 bytes 4 bytes EEA[1:0] 64 EEA[7:2] 7
ATmega88 512 bytes 4 bytes EEA[1:0] 128 EEA[8:2] 8
ATmega168 512 bytes 4 bytes EEA[1:0] 128 EEA[8:2] 8
Table 25-14. Pin Mapping Serial Programming
Symbol Pins I/O Description
MOSI PB3 I Serial data in
MISO PB4 O Serial data out
SCK PB5 I Serial clock