AVR069
7
8015B-AVR-02/06
Field Size Value Description
Answer ID 1 byte CMD_LEAVE_PROGMODE_ISP Answer id
Status 1 byte STATUS_CMD_OK
This command will always
return STATUS_CMD_OK
3.2.3 CMD_CHIP_ERASE_ISP
This command will perform a chip erase on the target device.
XML path: /AVRPART/ICE_SETTINGS/STK500_2/IspChipErase/
Table 3-20
. Command form
Field Size Value Description
Command ID 1 byte CMD_CHIP_ERASE_ISP Command id
eraseDelay 1 byte XML: eraseDelay
Delay (in ms) to ensure that the
erase of the device is finished
pollMethod 1 byte XML: pollMethod
Poll method, 0 = use delay1=
use RDY/BSY command
cmd1 1 byte Chip erase command byte #1
cmd2 1 byte Chip erase command byte #2
cmd3 1 byte Chip erase command byte #3
cmd4 1 byte Chip erase command byte #4
Table 3-21
. Answer format
Field Size Value Description
Answer ID 1 byte CMD_CHIP_ERASE_ISP Answer id
Status 1 byte
STATUS_CMD_OK or
STATUS_CMD_TOUT
A status value indicating the
result of the operation
3.2.4 CMD_PROGRAM_FLASH_ISP
This command will program data into the FLASH memory of the target device if it
succeeds.
XML path:
/AVRPART/ICE_SETTINGS/STK500_2/IspProgramFlash/
Table 3-22
. Command form
Field Size Value Description
Command ID 1 byte
CMD_PROGRAM_FLASH
_ISP
Command id
NumBytes 2 byte
Total number of bytes to
program, MSB first
mode 1 byte XML: mode * Mode byte*
delay 1 byte XML: delay
Delay, used for different types
of programming termination,
according to mode byte
cmd1 1 byte
Command 1 (Load Page, Write
Program Memory)
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.
AVR069
9
8015B-AVR-02/06
Table 3-23. Answer format
Field Size Value Description
Answer ID 1 byte CMD_PROGRAM_FLASH_ISP Answer id
Status 1 byte
STATUS_CMD_OK,
STATUS_CMD_TOUT or
STATUS_RDY_BSY_TOUT
A status value indicating the
result of the operation
3.2.5 CMD_READ_FLASH_ISP
This command will read data from the FLASH memory of the target device if it
succeeds.
XML path:
/AVRPART/ICE_SETTINGS/ STK500_2/IspReadFlash/
Table 3-24
. Command format
Field Size Value Description
Command ID 1 byte CMD_READ_FLASH_ISP Command id
NumBytes 2 bytes XML: blockSize
Total number of bytes to read,
MSB first
cmd1 1 byte
Read Program Memory
command byte #1. Low/High
byte selection bit (3rd bit) is
handled in the FIRMWARE.
Table 3-25
. Answer format if the command is executed
Field Size Value Description
ANSWER ID 1 byte CMD_READ_FLASH_ISP Answer id
STATUS1 1 byte STATUS_CMD_OK
Indicates success. Will always
read OK
DATA N bytes The data read from the device
STATUS2 1 byte STATUS_CMD_OK
A status value indicating the
result of the operation. Will
always read OK
Table 3-26
. Answer format if the command was not executed
Field Size Value Description
ANSWER ID 1 byte CMD_READ_FLASH_ISP Answer id
STATUS 1 byte STATUS_CMD_FAILED Indicates failure
3.2.6 CMD_PROGRAM_EEPROM_ISP
See the CMD_PROGRAM_FLASH_ISP command.
3.2.7 CMD_READ_EEPROM_ISP
See the CMD_READ_FLASH_ISP command.
3.2.8 CMD_PROGRAM_FUSE_ISP
This command programs the fuses of the target device.

ATAVRISP2

Mfr. #:
Manufacturer:
Microchip Technology / Atmel
Description:
Programmers - Processor Based AVR INSystem mkII Programming Kit
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet