SLDS274A September 2024 – March 2025 DRV81242-Q1
PRODUCTION DATA
The relationship between SDI and SDO content during SPI communication is shown in Figure 7-27. SDI line represents the frame sent from the microcontroller and SDO line is the answer provided by the device.
The SPI protocol provides the answer to a command frame only with the next transmission triggered by the microcontroller. Although the biggest majority of commands and frames implemented in the device can be decoded without the knowledge of what happened before, considering what the microcontroller sent in the previous transmission to decode the response frame completely is advisable. The sequence of commands to read and write the content of a register looks as follows:
There are 3 special situations where the frame sent back to the microcontroller is not related directly to the previous received frame:
A summary of all possible SPI commands is presented below, including the answer that the device sends back at the next transmission.
|
Requested Operation |
Frame sent to SDI pin |
Frame received from SDO pin with the next command |
| Read Standard Diagnosis | 0xxxxxxxxxxxxx01b (xxxxxxxxxxxxb = don 't care) |
0dddddddddddddddb (Standard Diagnosis) |
| Write 10 bit register | 10pppprrrrrrrrrrb where: ppppb = register address ADDR0, rrrrrrrrrrb = new register content | 0dddddddddddddddb (Standard Diagnosis) |
| Read 10 bit registers | 01ppppxxxxxxxx10b where: ppppb = register address ADDR0, xxxxxxxxb = don't care | 10pppprrrrrrrrrrb where: ppppb = register address ADDR0c, rrrrrrrrrrb = register content |
| Write 8 bit register | 10ppppqqrrrrrrrrb where: ppppb = register address ADDR0, qqb = register address ADDR1, rrrrrrrrb = new register content | 0dddddddddddddddb (Standard Diagnosis) |
| Read 8 bit registers | 01ppppqqxxxxxx10b where: ppppb = register address ADDR0, qqb = register address ADDR1, xxxxxxb = don't care | 10ppppqqrrrrrrrrb where: ppppb = register address ADDR0c, qqb = register address ADDR1, rrrrrrrrb = register content |
“p” = address bits for ADDR0 field, “q” = address bit for ADDR1 field, “r” = register content, “d” = diagnostic bit