SLDS272 September 2024 DRV81620-Q1
ADVANCE INFORMATION
The relationship between SDI and SDO content during SPI communication is shown in Figure 7-20. 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, it is advisable to consider what the microcontroller sent in the previous transmission to decode the response frame completely. 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:
In case an error in transmission happened during the previous frame (for instance, the clock pulses were not multiple of 8 with a minimum of 16 bits), shown below.
When the logic supply comes out of Power-On reset condition or after a Software Reset, as shown below.
In case of command syntax errors
write command starting with 11b instead of 10b
read command starting with 00b instead of 01b
read or write commands on registers which are reserved or not used
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 |