Table 30-18. JTAG Programming Instruction
Set a = address high bits, b = address low bits, c = address extended bits, H = 0 - Low byte, 1 - High Byte, o = data out,
i = data in, x = don’t care
Instruction
TDI Sequence
TDO Sequence
Notes
0100011_10000000
0110001_10000000
0110011_10000000
0110011_10000000
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
1a. Chip Erase
1b. Poll for Chip Erase Complete
2a. Enter Flash Write
0110011_10000000
0100011_00010000
0001011_cccccccc
0000111_aaaaaaaa
0000011_bbbbbbbb
0010011_iiiiiiii
xxxxxox_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
(2)
2b. Load Address Extended High Byte
2c. Load Address High Byte
2d. Load Address Low Byte
2e. Load Data Low Byte
(10)
2f. Load Data High Byte
0010111_iiiiiiii
0110111_00000000
1110111_00000000
0110111_00000000
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
2g. Latch Data
(1)
(1)
0110111_00000000
0110101_00000000
0110111_00000000
0110111_00000000
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
2h. Write Flash Page
2i. Poll for Page Write Complete
3a. Enter Flash Read
0110111_00000000
0100011_00000010
0001011_cccccccc
0000111_aaaaaaaa
0000011_bbbbbbbb
xxxxxox_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
(2)
3b. Load Address Extended High Byte
3c. Load Address High Byte
3d. Load Address Low Byte
(10)
0110010_00000000
0110110_00000000
0110111_00000000
xxxxxxx_xxxxxxxx
xxxxxxx_oooooooo
xxxxxxx_oooooooo
3e. Read Data Low and High Byte
Low byte
High byte
4a. Enter EEPROM Write
4b. Load Address High Byte
4c. Load Address Low Byte
4d. Load Data Byte
0100011_00010001
0000111_aaaaaaaa
0000011_bbbbbbbb
0010011_iiiiiiii
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
(10)
0110111_00000000
1110111_00000000
0110111_00000000
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
4e. Latch Data
(1)
(1)
0110011_00000000
0110001_00000000
0110011_00000000
0110011_00000000
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
xxxxxxx_xxxxxxxx
4f. Write EEPROM Page
362
ATmega640/1280/1281/2560/2561
2549L–AVR–08/07