Atmel STK600 Communication Protocol

AVR079: STK600 Communication Protocol
Features
Supported Commands and Command options
Command and Answer package formats

1 Introduction

This document describes the STK®600 protocol. The firmware is distributed with AVR Studio
The definition of all commands, responses, parameters and other defined values can be found in the file “command.h”. This file can be downloaded from the Atmel® web site.
All device specific values can be found in the xml files for each part. The xml files are distributed with AVR Studio. Download the latest AVR Studio 4 from the Atmel web site, chapter
®
4.14 or later.
http://www.atmel.com/products/AVR/. The xml file format is described in
12.
8-bit Microcontrollers
Application Note
Rev. 8133A-AVR-04/08

2 Overview

2.1 USB Communication

2.2 Packet Format

2.3 USB Driver

The STK600 communicates with the PC through its USB interface. The USB interface utilizes two bulk endpoints; one IN and one OUT. The USB descriptors can be found in the Appendix.
The PC sends commands to the STK600, which responds with an answer. Each command will generate an answer.
Both commands and answers can be larger than the maximum packet size for the bulk endpoints, so a command or answer can be split into several IN/OUT packets. A short packet indicates the end of a command or answer.
In order to communicate with the STK600, a driver must be installed on the host computer. A driver can be written from scratch or by using a driver development kit.

2.4 Command format

3 General Commands

3.1 CMD_SIGN_ON

AVR Studio 4 bundles a USB driver licensed from Jungo ( obtaining a license from Jungo, 3 Studio. The user can then use both AVR Studio and other tools without changing drivers.
Note: Firmware upgrades for STK600 can only be uploaded with the dedicated upgrade software bundled with AVR Studio. This requires that the driver supplied with AVR Studio to be installed.
This section describes all commands that can be entered to the STK600, and all the possible responses that each command can give back to the host.
For all commands, the STK600 will return an answer with an answer ID that is equal to the command ID. The first byte in a command is always the command ID, the first byte in an answer is always the answer ID.
These commands are not related to a specific programming mode.
This command returns a unique signature string for the STK600 with this implementation of the protocol.
rd
party software can access the same driver as AVR
www.jungo.com). By
2
AVR079
8133A-AVR-04/08
AVR079
Table 3-1. Command format.
Field Size Values Description
Command ID 1 byte CMD_SIGN_ON Command id
Table 3-2. Answer format.
Field Size Values Description
Answer ID 1 byte CMD_SIGN_ON Answer id Status 1 byte STATUS_CMD_OK Signature length 1 byte 6 Length of signature string 8 bytes “STK600” The signature string (not null-terminated)

3.2 CMD_SET_PARAMETER

The host can set a multitude of parameters in the STK600. See the 11 Parameters for a description of each parameter.
Table 3-3. Command format for one byte values.
Field Size Values Description
Command ID 1 byte CMD_SET_PARAMETER Command id Parameter ID 1 byte Which parameter to set Value 1 byte Parameter new value
Table 3-4. Command format for two byte values.
Field Size Values Description
Command ID 1 byte CMD_SET_PARAMETER Command id Parameter ID 1 byte Which parameter to set Value 1 byte Parameter new value high byte Value 1 byte Parameter new value low byte
Table 3-5. Command format for two byte values.
Field Size Values Description
Answer ID 1 byte CMD_SET_PARAMETER Answer id Status 1 byte
STATUS_CMD_OK or STATUS_CMD_FAILED
A status value indicating the result of the operation

3.3 CMD_GET_PARAMETER

The host can also read different parameters from the STK600.
Table 3-6. Command format.
Field Size Values Description
Command ID 1 byte CMD_GET_PARAMETER Command id Parameter ID 1 byte Which parameter to get
8133A-AVR-04/08
3
Table 3-7. Answer format for one byte values if command succeeded.
Field Size Values Description
Answer ID 1 byte CMD_GET_PARAMETER Answer id Status 1 byte STATUS_CMD_OK A status value indicating success Parameter value 1 byte The parameter value
Table 3-8. Answer format for two byte values if command succeeded.
Field Size Values Description
Answer ID 1 byte CMD_GET_PARAMETER Answer id Status 1 byte STATUS_CMD_OK A status value indicating success Parameter value 1 byte The parameter value high byte Parameter value 1 byte The parameter value low byte
Table 3-9. Answer format if command fails.
Field Size Values Description
Answer ID 1 byte CMD_GET_PARAMETER Answer id 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.4 CMD_OSCCAL

This command performs a calibration sequence as described in application note AVR053
Table 3-10. Command format.
Field Size Values Description
Command ID 1 byte CMD_OSCCAL Command id
Table 3-11. Answer format if command succeeded.
Field Size Values Description
Answer ID 1 byte CMD_OSCCAL Answer id Status 1 byte
STATUS_CMD_OK or STATUS_CMD_FAILED
A status value indicating success or failure.

3.5 CMD_LOAD_ADDRESS

This command will load an address into the STK600. 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 conjunction with high voltage parallel programming, high voltage serial programming and low voltage serial programming. All the abovementioned commands will increment an internal address counter, so this command needs only to be sent once.
4
AVR079
8133A-AVR-04/08
Table 3-12. Command format.
Field Size Values Description
Command ID 1 byte CMD_LOAD_ADDRESS Command id Address 4 byte 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 STK600 that a load extended address must be executed. See datasheet for devices with memories larger than 64KBytes.
Table 3-13. Answer format if command succeeded.
Field Size Values Description
Answer ID 1 byte CMD_LOAD_ADDRESS Answer id Status 1 byte STATUS_CMD_OK A status value indicating success

3.6 CMD_FIRMWARE_UPGRADE

AVR079
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 STK600 can “reboot” into upgrade mode by using this command
Table 3-14. Command format.
Field Size Values Description
Command ID 1 byte CMD_FIRMWARE_UPGRADE Command id Parameter ID 10 bytes ”fwupgrade” String to enable upgrade mode
Table 3-15. Answer format.
Field Size Values Description
Answer ID 1 byte CMD_SET_PARAMETER Answer id Status 1 byte
If the status returned is STATUS_CMD_OK, the STK600 will disconnect and enter upgrade mode.
STATUS_CMD_OK or STATUS_CMD_FAILED
A status value indicating the result of the operation

3.7 CMD_LOAD_RC_ID_TABLE

This command sends the Routing Card boardID table to the STK600 FW. Each row in this table holds first the RC_id, then the SC_id (allowed to use with that RC) and then the MAX_VTG allowed for that routingcard.
8133A-AVR-04/08
The two first bytes of the table hold the revision of the table. MSB first.
5
Table 3-16. Command format.
Field Size Values Description
Command ID 1 byte CMD_LOAD_RC_ID_TABLE Command id NumBytes
RC_ID_table 1 byte MSB rev b yte ... 1 byte LSB rev byte ... 1 byte ID of a Routing Card ... 1 byte ID of SC allowed to use with the RC ... 1 byte Max VTG for that RC
Total number of bytes to send (including the two revision bytes), MSB first
The three last lines above will be repeated until the whole table is sent.
Table 3-17. Answer format.
Field Size Values Description
Answer ID 1 byte CMD_LOAD_RC_ID_TABLE Answer id Status 1 byte STATUS_CMD_OK

3.8 CMD_LOAD_EC_ID_TABLE

This command sends the Expansion Card boardID table to the STK600 FW. Each row in this table holds first the EC_id, and then the MAX_VTG allowed for that EC.
The two first bytes of the table hold the revision of the table. MSB first.
Table 3-18. Command format.
Field Size Values Description
Command ID 1 byte CMD_LOAD_EC_ID_TABLE Command id NumBytes
EC_ID_table 1 byte rev byte MSB ... 1 byte rev byte LSB ... 1 byte ID of a Expansion Card ... 1 byte Max VTG for that EC
Total number of bytes to send (including the two revision bytes), MSB first
The two last lines above will be repeated until the whole table is sent.
Table 3-19. Answer format.
Field Size Values Description
Answer ID 1 byte CMD_LOAD_EC_ID_TABLE Answer id Status 1 byte STATUS_CMD_OK
6
AVR079
8133A-AVR-04/08
AVR079

3.9 CMD_CHECK_TARGET_CONNECTION

Table 3-20. Command format.
Field Size Values Description
Command ID 1 byte CMD_CHECK_TARGET_CONNECTION Command id
Table 3-21. Answer format.
Field Size Values Description
Answer ID 1 byte CMD_LOAD_EC_ID_TABLE Answer id Answer value 1 byte Se table below. Status of target connection Status 1 byte STATUS_CMD_OK
This command runs a target connection check and returns the status of the target connection.
The value is 6bits, where bit 0-2 indicates the status of the short circuit protection system and bit 4-5 indicates if the ISP is connected correctly to the target system.
Bit 4-5 will only indicate correct target connection if the target is powered. Bit 3 is “Don’t care”.
Table 3-22. bit descriptions.
Bit # Status
0 STATUS_CONN_FAIL_MOSI 1 STATUS_CONN_FAIL_RST 2 STATUS_CONN_FAIL_SCK 4 STATUS_ISP_READY 5 STATUS_TGT_REVERSE_INSERTED
The corresponding bit will be set ‘1’ to indicate an error. That is, if a line is short circuited, if target is not detected or the plug is inserted with a
reverse orientation. If the value 0x00 is returned it means the connection is ok. The parameter should be checked before starting a programming sequence to check
if target connection is correct (bit 4-5). It should also be checked after a programming sequence if the command failed, to
check if the operation failed because of a short circuit. A short circuit can only be detected after the command Enter Progmode has been
issued, because the control circuits of the STK600 is isolated via switches when the STK600 is in idle mode.

4 ISP Programming Commands

These commands handles FLASH, EEPROM, fuse bytes, lock bits, signature and oscillator calibration programming in ISP mode.
8133A-AVR-04/08
7

4.1 CMD_ENTER_PROGMODE_ISP

This command will make the target device enter programming mode. XML path: /AVRPART/ICE_SETTINGS/STK600/IspEnterProgMode/
Table 4-1. Command format.
Field Size Values Description
Command ID 1 byte
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
synchLoops 1 byte XML: synchLoops Number of synchronization loops byteDelay 1 byte XML: byteDelay
pollValue
pollIndex 1 byte XML: pollIndex Start address, received byte:
cmd1 cmd2 cmd3 cmd4
Notes: 1. The pollValue parameter indicates after which of the trans mitted bytes on the SPI interface to store the return byte,
(1)
1 byte XML: pollValue Poll value:
(2)
1 byte Command Byte # 1 to be transmitted
(2)
1 byte Command Byte # 2 to be transmitted
(2)
1 byte Command Byte # 3 to be transmitted
(2)
1 byte Command Byte # 4 to be transmitted
as the SPI interface is implemented as a ring buffer (one byte out, one byte in)
2. cmd1, cmd2, cmd3 and cmd4 are the instruc tion bytes found in the SPI S erial Programming Instruction Set found in the device datasheet.
CMD_ENTER_ PROGMODE_ISP
Command id
Delay (in ms) in connection with the EnterProgMode command execution
Delay (in ms) between each byte in the EnterProgMode command.
0x53 for AVR®
0 = no polling, 3 = AVR
Table 4-2. Answer format.
Field Size Values Description
Answer ID 1 byte CMD_SET_PARAMETER Answer id Status 1 byte
STATUS_CMD_TOUT, STATUS_CMD_OK or STATUS_CMD_FAILED
A status value indicating the result of the operation

4.2 CMD_LEAVE_PROGMODE_ISP

This command will make STK600 leave programming mode. The device will be put into normal operating mode.
XML path: /AVRPART/ICE_SETTINGS/STK600_2/IspLeaveProgMode/
8
AVR079
8133A-AVR-04/08
Table 4-3. Command format.
Field Size Values Description
Command ID 1 byte
preDelay 1 byte XML: preDelay Pre-delay (in ms) PostDelay 1 byte XML: postDelay Post-delay (in ms)
Table 4-4. Answer format.
Field Size Values Description
Answer ID 1 byte
Status 1 byte STATUS_CMD_OK

4.3 CMD_CHIP_ERASE_ISP

This command will perform a chip erase on the target device. XML path: /AVRPART/ICE_SETTINGS/STK600/IspChipErase/
CMD_LEAVE_PROGMODE_IS P
CMD_LEAVE_PROGMODE_IS P
Command id
Answer id
This command will always return STATUS_CMD_OK
AVR079
Table 4-5. Command format.
Field Size Values Description
Command ID 1 byte CMD_CHIP_ERASE_ISP Command id eraseDelay 1 byte XML: eraseDelay
pollMethod 1 byte XML: pollMethod Poll method, 0 = use delay
(1)
cmd1
1 byte Chip erase command byte #1
(1)
cmd2
1 byte Chip erase command byte #2
(1)
cmd3
1 byte Chip erase command byte #3
(1)
cmd4
1 byte Chip erase command byte #4
Notes: 1. cmd1, cmd2, cmd3 and cmd4 are the instruction b ytes found in the SPI Serial Pro gramming Instruction Set found in
the device datasheet.
Delay (in ms) to ensure that the erase of the device is finished
1= use RDY/BSY command
Table 4-6. Answer format.
Field Size Values 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

4.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/STK600/IspProgramFlash/
8133A-AVR-04/08
9
Table 4-7. Command format.
Field Size Values 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
cmd1 1 byte
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
Delay, used for different types of programming termination, according to mode byte
Command 1 (Load Page, Write Program Memory)
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 # Description Mode
0
1 Timed delay 2 Value polling 3 RDY/BSY polling 4 Timed delay 5 Value polling 6 RDY/BSY polling 7 Write page
Word/Page Mode (0 = word, 1 = page)
Word Mode
Page Mode
10
AVR079
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
8133A-AVR-04/08
devices with page size bigger than what can be transferred to STK600 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.
Table 4-9. Answer format.
Field Size Values Description
Answer ID 1 byte CMD_PROGRAM_FLASH_ISP Answer id Status 1 byte
STATUS_CMD_OK, STATUS_CMD_TOUT,
STATUS_RDY_BSY_TOUT

4.5 CMD_READ_FLASH_ISP

A status value indicating the result of the operation
AVR079
This command will read data from the FLASH memory of the target device if it succeeds.
XML path: /AVRPART/ICE_SETTINGS/ STK600/IspReadFlash/
Table 4-10. Command format.
Field Size Values Description
Command ID 1 byte CMD_READ_FLASH_ISP Command id NumBytes 2 byte 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 4-11. Answer format if the command was executed.
Field Size Values Description
Answer ID 1 byte CMD_PROGRAM_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 4-12. Answer format if the command was executed.
Field Size Values Description
Answer ID 1 byte CMD_PROGRAM_FLASH_ISP Answer id Status 1 byte STATUS_CMD_FAILED Indicates failure
8133A-AVR-04/08
11

4.6 CMD_PROGRAM_EEPROM_ISP

See the CMD_PROGRAM_FLASH_ISP command. XML path: /AVRPART/ICE_SETTINGS/STK600/IspProgramEeprom/

4.7 CMD_READ_EEPROM_ISP

See the CMD_READ_FLASH_ISP command. XML path: /AVRPART/ICE_SETTINGS/STK600/IspReadEeprom/

4.8 CMD_PROGRAM_FUSE_ISP

This command programs the fuses of the target device.
Table 4-13. Command format.
Field Size Values Description
Command ID 1 byte CMD_PROGRAM_FUSE_ISP Command id
(1)
cmd1
1 byte Command Byte #1
(1)
cmd2
1 byte Command Byte #2
(1)
cmd3
1 byte Command Byte #3
(1)
cmd4
1 byte Command Byte #4
Notes: 1. cmd1, cmd2, cmd3 and cmd4 are the instruction b ytes found in the SPI Serial Pro gramming Instruction Set found in
the device datasheet.
Table 4-14. Answer format.
Field Size Values Description
Answer ID 1 byte CMD_PROGRAM_FUSE_ISP Answer id Status1 1 byte STATUS_CMD_OK Will always read OK Status2 1 byte STATUS_CMD_OK Will always read OK

4.9 CMD_READ_FUSE_ISP

This command reads the fuses of the target device. XML path: /AVRPART/ICE_SETTINGS/STK600/IspReadFuse/
Table 4-15. Command format.
Field Size Values Description
Command ID 1 byte CMD_READ_FUSE_ISP Command id RetAddr cmd1 cmd2 cmd3 cmd4
(1)
1 byte XML: pollIndex Return address
(2)
1 byte Command Byte #1
(2)
1 byte Command Byte #2
(2)
1 byte Command Byte #3
(2)
1 byte Command Byte #4
12
AVR079
8133A-AVR-04/08
Field Size Values Description
Notes: 1. RetAddr 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).
2. cmd1, cmd2, cmd3 and cmd4 are the instruction bytes fo und in the SPI Serial Pr ogramming Instruction Set found in the device datasheet.
Table 4-16. Answer format.
Field Size Values Description
Answer ID 1 byte CMD_READ_FUSE_ISP Answer id Status1 1 byte STATUS_CMD_OK
Data 1 byte The fuse byte read from the device Status2 1 byte STATUS_CMD_OK
A status value indicating the result of the operation, always OK
A status value indicating the result of the operation, always OK
AVR079

4.10 CMD_PROGRAM_LOCK_ISP

See CMD_PROGRAM_FUSE. This command is basically the same as the program fuse command, only that ISP commands for programming the lock byte must be supplied.

4.11 CMD_READ_LOCK_ISP

See CMD_READ_FUSE. This command is basically the same as the read fuse command, only that ISP commands for reading the lock byte must be supplied.
XML path: /AVRPART/ICE_SETTINGS/STK600/IspReadLock/

4.12 CMD_READ_SIGNATURE_ISP

See CMD_READ_FUSE. This command is basically the same as the read fuse command, only that ISP commands for reading one of the signature bytes must be supplied.
XML path: /AVRPART/ICE_SETTINGS/STK600/IspReadSign/

4.13 CMD_READ_OSCCAL_ISP

See CMD_READ_FUSE. This command is basically the same as the read fuse command, only that ISP commands for reading the OSCCAL byte must be supplied.
XML path: /AVRPART/ICE_SETTINGS/STK600/IspReadOsccal/

4.14 CMD_SPI_MULTI

This is a generic command that can be used to execute any of the ISP commands. The command writes a number of bytes to the SPI bus, and returns a number of bytes.
Table 4-17. Command format.
Field Size Values Description
Command ID 1 byte CMD_SPI_MULTI Command ID
8133A-AVR-04/08
13
Field Size Values Description
NumTx 1 byte 0-255 Number of bytes to transmit NumRx 1 byte 0-255 Number of bytes to receive RxStartAddr 1 byte
TxData 0-255 bytes
Start address of returned data. Specifies on what transmitted byte the response is to be stored and returned.
The data to be transmitted. The size is specified by NumTx
If the number of bytes to receive is greater than number of bytes to transmit, then the firmware will pad with the necessary 0x00 bytes. This is in order to save time­consuming transfer from PC to the programmer.
Table 4-18. Answer format.
Field Size Values Description
Answer ID 1 byte CMD_SPI_MULTI Answer id Status1 1 byte STATUS_CMD_OK Will always read OK data 0-255 bytes
Status2 1 byte STATUS_CMD_OK Will always read OK
The data read from the ISP bus as indicated in the command

5 Parallel Programming Mode Commands

5.1 CMD_ENTER_PROGMODE_PP

This command will make the target device enter programming mode if it succeeds. XML PATH: /AVRPART/ICE_SETTINGS/STK600/PpEnterProgMode/
Table 5-1. Command format.
Field Size Values Description
Command ID 1 byte CMD_ENTER_ PROGMODE_PP Command id stabDelay 1 byte XML: stabDelay Delay (in ms) used for pin stabilization progModeDelay 1 byte XML: progModeDelay
latchCycles 1 byte XML: latchCycles Number of xtal cycles used to latch OSCCAL toggleVtg 1 byte XML: toggleVtg
powerOffDelay 1 byte XML: powerOffDelay
resetDelayMs 1 byte XML: resetDelayMs
resetDelayUs 1 byte XML: resetDelayUs
Delay (in ms) in connection with the EnterProgMode command execution
Toggle Vtg when entering prog.mode (0=no, 1=yes). For parts with RSTDSBL functionality
Power-off delay. Additional delay (in ms) after Vtg is turned off in order to make sure the Vtg is low enough
RSTDELAY #1 (in ms) Additional delay between Vtg is turned on and reset goes high.
RSTDELAY #2(in us x 10) Additional delay between Vtg is turned on and reset goes high. Total delay is RSTDELAY #1 (ms) + RSTDELAY #2 (us x 10)
14
AVR079
8133A-AVR-04/08
AVR079
Table 5-2. Answer format (same for all results).
Field Size Values Description
Answer ID 1 byte CMD_ENTER_PROGMODE_PP Answer id Status 1 byte See table below
A Result Value indicating the result of the operation
Table 5-3. Valid Result Values for the answer to this command.
Value Description
STATUS_CMD_OK Operation succeeded STATUS_CMD_ FAILED Operation failed

5.2 CMD_LEAVE_PROGMODE_PP

This command will make the target device leave programming mode if it succeeds. XML PATH: /AVRPART/ICE_SETTINGS/STK600/PpLeaveProgMode/
Table 5-4. Command format.
Field Size Values Description
Command ID 1 byte CMD_LEAVE_PROGMODE_PP Command id StabDelay 1 byte XML: stabDelay Delay (in ms) used for pin stabilization ResetDelay 1 byte XML: resetDelay Delay (ms) for holding RESET low
Table 5-5. Answer format.
Field Size Values Description
Answer ID 1 byte CMD_LEAVE_PROGMODE_PP Answer id Status 1 byte STATUS_CMD_OK
A Result Value indicating the result of the operation

5.3 CMD_CHIP_ERASE_PP

This command will perform a chip erase on the target device if it succeeds. XML PATH: /AVRPART/ICE_SETTINGS/STK600/PpChipErase/
Table 5-6. Command format.
Field Size Values Description
Command ID 1 byte CMD_CHIP_ERASE_PP Command id pulseWidth 1 byte XML: pulseWidth Width (in ms) of the /WR pulse. 0 => 1 cycle pollTimeout 1 byte XML: pollTimeout
Table 5-7. Answer format (same for all results).
Field Size Values Description
Timeout period (in ms) to wait for RDY/BSY flag to rise. If 0, RDY/BSY flag is NOT used.
8133A-AVR-04/08
15
Field Size Values Description
Answer ID 1 byte CMD_CHIP_ERASE_PP Answer id Status 1 byte See table below
A Result Value indicating the result of the operation
Table 5-8. Valid Result Values for the answer to this command.
Value Description
STATUS_CMD_OK Operation succeeded STATUS_RDY_BSY_TOUT
No response from target device within specified timeframe

5.4 CMD_PROGRAM_FLASH_PP

This command will program data into the FLASH memory of the target device if it succeeds. For devices with the FLASH organized in pages, the data address and size used with this command must confirm to that of the device. I.e. one ProgramFlash command is used to program one page in the target device.
XML PATH: /AVRPART/ICE_SETTINGS/STK600/PpProgramFlash/
Table 5-9. Command format.
Field Size Values Description
Command ID 1 byte CMD_PROGRAM_FLASH_PP Command id Nmb bytes (MSB 1 byte Total number o f bytes to program (MSB) Nmb bytes (LSB) 1 byte Total number of bytes to program (LSB)
(1)
Mode
1 byte
pollTimeout 1 byte XML: pollTimeout pollTimeout (in ms) Data 1 byte Data 1 Data 1 byte ... Data 1 byte Data N Notes: 1. See deta ils in list below.
XML: mode, *see description below
Mode byte, *see description below
16
Mode byte description
Bit 0: This bit indicates whether to use byte ‘0’ or page ‘1’ programming.
Bit 1-3 are the pagesize bits, pagesize are given in bytes not words, see table
below.
Bit 4-5 are not in use.
Bit 6 must be set to ‘1’ when it is the very last page to be programmed, otherwise
‘0’.
Bit 7 indicates if a page write should be issued (Transfer data to flash). Normally it should always be set ‘1’. However, if the page size of the target device is too large to be covered by one Program Flash command (because the amount of available SRAM in STK600 is limited) this can be used to let 2 or more commands fill the page buffer of the target device. The transfer data to flash flag should then only be set on the last command.
AVR079
8133A-AVR-04/08
Table 5-10. Mode byte description.
Pagesize \ bit 3 2 1
256 0 0 0 2 0 0 1 4 0 1 0 8 0 1 1 16 1 0 0 32 1 0 1 64 1 1 0 128 1 1 1
NOTE: that only Bit 0-3 are set in the XML file, cause Bit 6-7 are not static and must be controlled by the PC Frontend.
Table 5-11. Answer format /(same for all results).
Field Size Values Description
Answer ID 1 byte CMD_PROGRAM_FLASH_PP Answer id Status 1 byte See table below
A Result Value indicating the result of the operation
AVR079
Table 5-12. Valid Result Values for the answer to this command.
Value Description
STATUS_CMD_OK Operation succeeded STATUS_RDY_BSY_TOUT
No response from target device within specified timeframe

5.5 CMD_READ_FLASH_PP

This command will read data from the FLASH memory of the target device if it succeeds. For devices with the FLASH organized in pages, the data address and size used with this command must confirm to that of the device. I.e. one ReadFlash command is used to read one page in the target device.
XML PATH: /AVRPART/ICE_SETTINGS/STK600/PpReadFlash/
Table 5-13. Command format.
Field Size Values Description
Command ID 1 byte CMD_READ_FLASH_PP Command id Nmb bytes (MSB) 1 byte Total number of bytes to read (MSB) Nmb bytes (LSB) 1 byte Total number of bytes to read (LSB)
Table 5-14. Answer format if the command is executed.
Field Size Values Description
Answer ID 1 byte CMD_READ_FLASH_PP Answer id
8133A-AVR-04/08
17
Field Size Values Description
Status 1 byte STATUS_CMD_OK Data Nmb bytes
Status 1 byte STATUS_CMD_OK
Data read from device. Will be padded with 0’s if errors occurred during read-out.
A Result Value indicating the result of the operation

5.6 CMD_PROGRAM_EEPROM_PP

This command programs one page the EEPROM memory of the target device if it succeeds.
XML PATH: /AVRPART/ICE_SETTINGS/STK600/PpReadEeprom/ Command format: See CMD_PROGRAM_FLASH_PP.

5.7 CMD_READ_EEPROM_PP

This command will read data from the EEPROM memory of the target device if it succeeds.
XML PATH: /AVRPART/ICE_SETTINGS/STK600/PpReadEeprom/ Command format: See CMD_READ_FLASH_PP

5.8 CMD_PROGRAM_FUSE_PP

XML PATH: /AVRPART/ICE_SETTINGS/STK600/PpProgramFuse/
Table 5-15. Command format.
Field Size Values Description
Command ID 1 byte CMD_PROGRAM_FUSE_PP Command id Address 1 byte
Data 1 byte fuse byte value to be programmed pulseWidth 1 byte XML: pulseWidth width (ms) of /WR pulse (0 => 1 cycle) pollTimeout 1 byte XML: pollTimeout
Table 5-16. Answer format.
Field Size Values Description
Answer ID 1 byte CMD_PROGRAM_FUSE_PP Answer id Status 1 byte See table below
address of fuse byte to program (low, high, ext, ext2)
Time-out (ms) for polling RDY/BSY (0 = don’t poll)
A Result Value indicating the result of the operation
18
Table 5-17. Valid Result Values for the answer to this command.
Value Description
STATUS_CMD_OK Operation succeeded
AVR079
8133A-AVR-04/08
Value Description
STATUS_RDY_BSY_TOUT

5.9 CMD_READ_FUSE_PP

XML PATH: /AVRPART/ICE_SETTINGS/STK600/PpReadFuse/
Table 5-18. Command format.
Field Size Values Description
Command ID 1 byte CMD_READ_FUSE_PP Command id
No response from target device within specified timeframe
AVR079
Table 5-19. Answer format if command was executed.
Field Size Values Description
Answer ID 1 byte CMD_ READ_FUSE Answer id Status 1 byte STATUS_CMD_OK Data 1 byte
1 byte
address of fuse byte to read
Data read from device. Contains the read low, high or ext fuse byte. Will be padded with 0’s if errors occurred during read-out.

5.10 CMD_PROGRAM_LOCK_PP

See CMD_PROGRAM_FUSE. Note: Address must be sent but is ignored by firmware. XML PATH: /AVRPART/ICE_SETTINGS/STK600/PpProgramLock/

5.11 CMD_READ_LOCK_PP

See CMD_READ_FUSE_PP. Note: Address field must be sent but is ignored by firmware. XML PATH: /AVRPART/ICE_SETTINGS/STK600/PpReadLock/

5.12 CMD_READ_SIGNATURE_PP

See CMD_READ_FUSE. XML PATH: /AVRPART/ICE_SETTINGS/STK600/PpReadSign/

5.13 CMD_READ_OSCCAL_PP

See CMD_READ_FUSE. XML PATH: /AVRPART/ICE_SETTINGS/STK600/PpReadOsccal/
8133A-AVR-04/08
19
Loading...
+ 42 hidden pages