SCEA154 July   2025 TXE8124

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Setup and Configuration
  6. 3TXE81XX 24-Bit SPI Word Definition
  7. 4SPI Write Steps
  8. 5Coding Example
  9. 6Sample Code
  10. 7Summary
  11. 8References

SPI Write Steps

A SPI write command involves writing data to a designated register while also reading the previous register data contents on SDO (full-duplex).

  1. Drive /CS LOW. This enables the internal shift register
  2. Shift 24 bits of data into the device MSB first on SDI. Data must be stable during the rising edge of the clock (SCLK).
  3. The MSB bit (B23) must be a “0” to indicate this is a write operation.
  4. 16 bits of status is sent out on SDO. The first 2 bits are 2’b11 (indicating this to be a status segment). The next 6 bits B21-B16 are bits D5 to D0 of the Fault Status Register. The last 8 bits B15-B8 are all 0’s.
  5. The previous data in the register is read on SDO (B7-B0) while a data byte is written into the register on SDI (B7-B0).
  6. After the last bit of data is transferred, drive SCLK low if there is no more data to be transferred.
  7. De-assert /CS (drive this high) to end the write cycle
 SPI Write Example Using Saleae
                    Logic Analyzer Figure 4-1 SPI Write Example Using Saleae Logic Analyzer