4
AVR069
8015B-AVR-02/06
Field Size Value Description
Status 1 byte STATUS_CMD_FAILED
A status value indicating that
the operation failed.
The only reason for the operation to fail is that an illegal parameter is requested.
3.1.4 CMD_OSCCAL
This command performs a calibration sequence as described in application note
AVR053.
Table 3-8
. Command format
Field Size Value Description
Command ID 1 byte CMD_OSCCAL Command id
Table 3-9
. Answer format
Field Size Value Description
Answer ID 1 byte CMD_OSCCAL Answer id
Status 1 byte
STATUS_CMD_OK or
STATUS_CMD_FAILED
A status value indicating the
result of the operation
3.1.5 CMD_LOAD_ADDRESS
This command will load an address into the AVRISP mkII. The next Program Flash,
Read Flash, Program EEPROM or Read EEPROM command will operate from the
address set with this command. The command is used in all programming modes. All
the abovementioned commands will increment an internal address counter, so this
command needs only to be sent once.
Table 3-10
. Command format
Field Size Value Description
Command ID 1 byte CMD_LOAD_ADDRESS Command id
Address 4 bytes
The address, four bytes, MSB
first
For word-addressed memories (program flash), the Address parameter is the word
address.
If bit 31 is set, this indicates that the following read/write operation will be performed
on a memory that is larger than 64KBytes. This is an indication to AVRISP mkII that a
load extended address must be executed. See datasheet for devices with memories
larger than 64KBytes.
Table 3-11
. Answer format.
Field Size Value Description
Answer ID 1 byte CMD_LOAD_ADDRESS Answer id
Status 1 byte STATUS_CMD_OK
This command will always
return STATUS_CMD_OK
AVR069
5
8015B-AVR-02/06
3.1.6 CMD_FIRMWARE_UPGRADE
When the host is trying to connect to the programmer, it checks the firmware version.
A firmware upgrade is initiated if a newer version is available on the PC.
The AVRISP mkII can “reboot” into upgrade mode by using this command.
Table 3-12
. Command format
Field Size Value Description
Command ID 1 byte CMD_FIRMWARE_UPGRADE Command id
Parameter ID 9 bytes
”fwupgrade”
String to enable upgrade
mode (not null terminated)
Table 3-13
. Answer format
Field Size Value Description
Answer ID 1 byte CMD_FIRMWARE_UPGRADE Answer id
Status 1 byte
STATUS_CMD_OK or
STATUS_CMD_FAILED
A status value indicating
the result of the operation
If the status returned is STATUS_CMD_OK, the AVRISP mkII will disconnect and
enter upgrade mode.
3.1.7 CMD_RESET_PROTECTION
This command resets the short circuit protection system after a short circuit state has
been returned by the PARAM_STATUS_TGT_CONN.
Table 3-14
. Command format
Field Size Value Description
Command ID 1 byte CMD_RESET_PROTECTION Command id
Table 3-15
. Answer format
Field Size Value Description
Answer ID 1 byte CMD_RESET_PROTECTION Answer id
Status 1 byte STATUS_CMD_OK
This command will always
return STATUS_CMD_OK
3.2 ISP Programming Commands
These commands handles FLASH, EEPROM, fuse bytes, lock bits, signature and
oscillator calibration programming in ISP mode.
3.2.1 CMD_ENTER_PROGMODE_ISP
This command will make the target device enter programming mode.
XML path:
/AVRPART/ICE_SETTINGS/STK500_2/IspEnterProgMode/
Table 3-16
. Command form
Field Size Value Description
6
AVR069
8015B-AVR-02/06
Field Size Value Description
Command ID 1 byte
CMD_ENTER_PROG
MODE_ISP
Command id
timeout 1 byte XML: timeout Command time-out (in ms)
stabDelay 1 byte XML: stabDelay
Delay (in ms) used for pin
stabilization
cmdexeDelay 1 byte XML: cmdexeDelay
Delay (in ms) in connection with the
EnterProgMode command execution
synchLoops 1 byte XML: synchLoops Number of synchronization loops
byteDelay 1 byte XML: byteDelay
Delay (in ms) between each byte in
the EnterProgMode command.
pollValue
(1)
1 byte XML: pollValue Poll value:
0x53 for AVR, 0x69 for AT89xx
pollIndex 1 byte XML: pollIndex Start address, received byte:
0 = no polling, 3 = AVR, 4 = AT89xx
cmd1 1 byte Command Byte # 1 to be transmitted
cmd2 1 byte Command Byte # 2 to be transmitted
cmd3 1 byte Command Byte # 3 to be transmitted
cmd4 1 byte Command Byte # 4 to be transmitted
Note: 1. The pollValue parameter indicates after which of the transmitted bytes on the SPI
interface to store the return byte, as the SPI interface is implemented as a ring
buffer (one byte out, one byte in)
Table 3-17
. Answer format
Field Size Value Description
Answer ID 1 byte
CMD_ENTER_PROG_M
ODE_ISP
Answer id
Status 1 byte
STATUS_CMD_TOUT,
STATUS_CMD_OK or
STATUS_CMD_FAILED
A status value indicating the result
of the operation
3.2.2 CMD_LEAVE_PROGMODE_ISP
This command will make AVRISP mkII leave programming mode. The device will be
put into normal operating mode.
XML path: /AVRPART/ICE_SETTINGS/AVRISP mkII_2/IspLeaveProgMode/
Table 3-18
. Command format
Field Size Value Description
Command ID 1 byte CMD_LEAVE_PROGMODE_ISP Command id
preDelay 1 byte XML: preDelay Pre-delay (in ms)
postDelay 1 byte XML: postDelay Post-delay (in ms)
Table 3-19
. Answer format
Field Size Value Description

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