1 Reply Latest reply on Mar 4, 2019 7:55 AM by JoMe_264151

    how to use SCB SPI 4.0


      Hi Expert,

         I use the SCB SPI 4.0 component. it created code automatically. I just need polling read/write, but I can't find any read/write functions. does it access the fifo registers for r/w data?

        • 1. Re: how to use SCB SPI 4.0

          I don't know where you are searching for APIs, but a brief look into the datasheet will show up

          SpiGetRxBuffersize() and SpiGetTxBuffersize() APIs which return the number of bytes in the resp. buffer.

          Keep in mind:

          For every bit (byte) the SPI interface gets, one bit (byte) is returned immediately. When the very first byte is sent, the interface does not "know" yet what to answer, so a dummy byte is returned which should be skipped.

          SPI has no read command, so you must send dummy bytes to retrieve the information wanted.

          A pitfall is the select line, which is automatically taken low when a byte is sent. When the buffer is empty it is taken high again. This can lead to interface errors when the byte sequence is not provided fast enough resulting in ss-line glitches.