
SN260
SPI protocol
Figure 8.
SPI protocol data format
The total length of a command must not exceed 136 bytes.
All commands must begin with the SPI Byte. Some commands are only two bytes—that is,
they contain the SPI Byte and Frame Terminator only.
The Length Byte is only included if there is information in the Payload Frame and the Length
Byte defines the length of just the Payload Frame. Therefore, if a command includes a
Payload Frame, the Length Byte can have a value from 2 through 133 and the overall
command size will be 5 through 136 bytes. The SPI Byte can be a specific value indicating if
there is a Payload Frame or not, and if there is a Payload Frame, then the Length Byte can
be expected.
The Error Byte is used by the error responses to provide additional information about the
error and appears in place of the length byte. This additional information is described in the
following sections.
The Payload Frame contains the data needed for operating EmberZNet. The EZSP Frame
and its format are explained in the EZSP Reference Guide (120-3009-000). The Payload
Frame may also contain the data needed for operating the bootloader, which is called a
Bootloader Frame. Refer to the EmberZNet Application Developer’s Guide (120-4028-000)
for more information on the bootloader.
The Frame Terminator is a special control byte used to mark the end of a command. The
Frame Terminator byte is defined as 0xA7 and is appended to all Commands and
Responses immediately after the final data byte. The purpose of the Frame Terminator is to
provide a known byte the SPI Protocol can use to detect a corrupt command. For example, if
the SN260 resets during the Response Section, the Host will still clock out the correct
number of bytes. But when the host attempts to verify the value 0xA7 at the end of the
Response, it will see either the value 0x00 or 0xFF and know that the SN260 just reset and
the corrupt Response should be discarded.
Note:
The Length Byte only specifies the length of the Payload Frame. It does not include the
Frame Terminator.
7.5
SPI byte
Table 8 lists the possible commands and their responses in the SPI Byte.
Table 8.
SPI commands & responses
Command
value
Command
Response
value
Response
Any
0x00
SN260 reset occurred—This is never used in another
response; it always indicates an SN260 Reset.
Any
0x01
Oversized Payload Frame received—This is never used in
another response; it always indicates an overflow occurred.
Any
0x02
Aborted Transaction occurred—This is never used in
another response; it always indicates an aborted transaction
occurred.