ATSHA204A
Security Commands
8. Security Commands
8.1
8.1.1
I/O Blocks
Regardless of the I/O protocol being used (for instance Single-Wire or I2C), commands are sent to the
device and responses received from the device, within a block that is constructed in the following way:
Table 8-1. Blocks
Byte Name
Meaning
0
Count
Packet size. Includes Count, Data and Checksum.
1 to N-2 Data
If device input; commands and parameters. If device output; response from the device based
on the Command being called.
N-1 to N Checksum CRC-16. The CRC polynomial is 0x8005.
The ATSHA204A is designed in such a way that the count value in the input block should be consistent
with the size requirements specified in the command parameters. If the count value is inconsistent with
the command opcode and/or parameters within the packet, then the ATSHA204A responds in different
ways, depending upon the specific command. Either the response includes an error indication or some
input bytes are silently ignored.
Status/Error Codes
The device does not have a dedicated status register, so the output FIFO is shared among status, error
and command results. All output from the device is returned to the system as complete blocks.
After the device receives the first byte of an input command block, the system cannot read anything from
the device until the system has sent all the bytes to the device.
After wake and after execution of a command, there can be error, status, or result bytes in the device’s
output register that can be retrieved by the system. When the length of that block is four bytes, the codes
returned are as detailed in the following table. Some commands return more than four bytes when they
execute successfully. The resulting packet description is listed in the command section below.
CRC errors are always returned before any other type of error. They indicate that some sort of I/O error
occurred and that the command may be resent to the device. If a command includes both parse and
execution errors, then there is no particular precedence enforced, so an execution error may occur before
a parse error and/or the reverse may occur.
Table 8-2. Status/Error Codes in 4-byte Blocks
State Description
Error/
Status Description
Successful Command
Execution
0x00 Command executed successfully.
Checkmac Miscompare
0x01
The CheckMac command was properly sent to the device, but the input
Client response did not match the expected value.
Parse Error
0x03
Command was properly received, but the length, command opcode, or
parameters are illegal, regardless of the state (volatile and/or EEPROM
configuration) of the ATSHA204A.
© 2018 Microchip Technology Inc.
DS40002025A-page 42