8
AVR069
8015B-AVR-02/06
Field Size Value Description
cmd2 1 byte
Command 2 (Write Program
Memory Page)
cmd3 1 byte
Command 3 (Read Program
Memory)
poll1 1 byte XML: pollVal1 Poll Value #1
poll2 1 byte XML: pollVal2
Poll Value #2 (not used for flash
programming)
Data N bytes N data
*Mode byte
The mode parameter is essential for how this command works. The bits in the mode
byte have the following meanings:
Bit # Description Mode
0 Word/Page Mode (0 = word, 1 = page)
1 Timed delay
2 Value polling
3 RDY/BSY polling
Word Mode
4 Timed delay
5 Value polling
6 RDY/BSY polling
7 Write page
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 AVRISP mkII, so leave this bit cleared.
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
devices with page size bigger than what can be transferred to AVRISP mkII in one
command, several CMD_PROGRAM_FLASH_ISP commands must be issued. In
such a case, only the last command should have the Write Page mode bit set.
NOTE: Only bit 0-6 are set in the XML file, because bit 7 is not constant and must be controlled
by the PC software.
When value polling is used to determine when a programming operation is complete,
poll1 must be supplied. This value indicates which value will be read from the device
until the programmed value is read. This indicates end of programming. poll2 is used
only for EEPROM programming.