1 Reply Latest reply on Jun 30, 2017 3:45 AM by anks

    Why SPI Communication not working properly?

    user_504416177

      Hello Every one,

         

      I am making a SPI master slave test program with certain conditions:

         

      I want to do the following:

         

      Master is sending an 8 bit data in order to start the communication.

         

      At the same time slave will directly send some dummy value.

         

      Then: if the master has send a value 0x02 then the slave should send 0x10u.

         

      otherwise it will give 0x58u.

         

      I write the program (please have a look at the attachment). But, some how its not working as it supposed to work! there must be something wrong.

         

      I will look forward to hearing from you.

        • 1. Re: Why SPI Communication not working properly?
          anks

          Please go through the component datasheet properly and see the API explaination too.

             

          uint8 SPIS_ReadRxStatus(void):_
          Description:
          Returns the current state of the Rx status register. 

             

          Return Value:
          uint8: Current Rx status register value 

             


          Bit:SPIS_STS_RX_FIFO_EMPTY
          Description:Rx FIFO empty

             


          Bit:SPIS_STS_RX_FIFO_NOT_EMPTY
          Description:Rx FIFO not empty

             


          Bit:SPIS_STS_RX_FIFO_OVERRUN
          Description:Rx Buf overrun

             


          Bit:SPIS_STS_RX_FIFO_FULL
          Description:Rx FIFO full