3 Replies Latest reply on May 29, 2016 8:48 PM by wang.xinlong

    FX3 SPI transaction question

    john.redden

       

         

      I have a question on how the FX3 API handles SPI transactions.

              CyU3PSpiTransmitWords    , the master FX3 sends data over MOSI, and also consumes the same amount of data via MISO. Is that MISO data from the slave available to an FX3 application? The     CyU3PSpiReceiveWords     appears to initiate a separate transaction for reading. This implies that the data that had been previously consumed in the Transmit activity would be lost. Or does Receive actually have access to the previous MISO data?   

       

         

      When the FX3 initiates an SPI write via

         

       

         

      Thank you,

         

      JohnR

        • 1. Re: FX3 SPI transaction question
          john.redden

          I just noticed that my previous post somehow got mangled, so I'm trying a re-post that (hopefully) will look a little more coherent.

             

           

             

          I have a question on how the FX3 API handles SPI transactions.

             

          When the FX3 initiates an SPI write via CyU3PSpiTransmitWords, the master FX3 sends data over MOSI,
          and also consumes the same amount of data via MISO.    Is that MISO data from the slave available to
          an FX3 application?   The CyU3PSpiReceiveWords appears to initiate a separate transaction for reading.  
          This implies that the data that had been previously consumed in the Transmit activity would be lost.  
          Or does Receive actually have access to the previous MISO data?

             

          Thank you,

          • 2. Re: FX3 SPI transaction question
            kumr

            Yes, the received data is available but TransmitWords currently doesn't store them. For now, you can use the SPI in DMA mode which lets you both send and receive data simultaneously.

               

             

               

            See the CyU3PSpiSetBlockXfer(..) function in the API guide for details.

            • 3. Re: FX3 SPI transaction question
              wang.xinlong

              HI,

                 

              Can you give me a example that lets me bith send and receive data simultaneously?