
Table 4-7. Command format.
Field
Command ID
NumBytes
mode
delay
Size
1 byte
2 byte
1 byte
1 byte
Values
CMD_PROGRAM_FLASH_ISP
XML: mode *
XML: delay
Description
Command id
Total number of bytes to program, MSB first
Mode byte*
Delay, used for different types of programming
termination, according to mode byte
cmd1
cmd2
cmd3
1 byte
1 byte
1 byte
Command 1 (Load Page, Write Program
Memory)
Command 2 (Write Program Memory Page)
Command 3 (Read Program Memory)
poll1
poll2
Data
1 byte
1 byte
N bytes
XML: pollVal1
XML: pollVal2
Poll Value #1
Poll Value #2 (not used for flash programming)
N data
Mode byte
The mode parameter is essential for how this command works. The bits in the mode
byte have the following meanings:
Table 4-8. Mode byte, bit descriptions.
Bit #
0
1
2
3
4
5
6
7
Description
Word/Page Mode
(0 = word, 1 =
page)
Timed delay
Value polling
RDY/BSY polling
Timed delay
Value polling
RDY/BSY polling
Write page
Mode
Word Mode
Page Mode
The Word/Page Mode bit selects if the device supports page programming or not.
The command bytes are different for word and page mode. In word mode, the ISP
commands Write Program Memory and Read Program Memory are used. In page
mode, Load Page , Write Program Memory Page and Read Program Memory are
used. The read instruction is used if Value Polling is specified in the mode bit. The
Low/High byte selection bit (3 rd bit in the Load Page, Write Program Memory
commands) is handled by STK600, so leave this bit cleared. The instruction values
are found in the SPI Serial Programming Instruction Set found in the device
datasheet.
According to the mode, different termination methods are selected – Timed delay ,
Value polling or RDY/BSY polling .
For paged operation, the Write page bit decides if a Write Program Memory Page
command should be issued after the data has been loaded into the page buffer. For
10
AVR079
8133A-AVR-04/08