5 Replies Latest reply on Aug 17, 2016 1:40 PM by Intel_Alvarado

    SPI Loopback

    jschimpf

      Hi,

                   i used the example from (Spi master rx mode)) and changed it just a bit.  I used TX_RX instead of RX only and made the transfer a loop so I could watch it on a scope.  I also hooked MISO <-> MOSI so I should see the data in the rx_buffer.  I don't The data is on the scope but is not in the buffer.  Attached is the project,any suggestions of what I might be doing wrong.  We HAVE to use SPI in a hardware project and if this doesn't work we will have to use another processor.

       

      --jim schimpf

        • 1. Re: SPI Loopback
          Intel_Alvarado

          Hi jschimpf

           

          Isn’t this behavior caused because the buffer is full? There’s a thread that discusses how to clear the buffer. You can apply the same principle to try to clear the buffer. Take a look at https://communities.intel.com/thread/103948 .

           

          Let us know your results.

           

          -Sergio

          • 2. Re: SPI Loopback
            jshimpf

            Hi,

            I am confused.  I went to the specified document and found the UART stuff.  Does this apply to SPI ?  In any case am I supposed to call qm_uart_read_non_block() and if so how many times ? Read till it returns EOF or something ? 

             

            The enclosed project according to the original poster was supposed to work (he said it worked with the 2MHz clock but not higher.  Could you try the project on a D2000 all you have to do is jumper MOSI <-> MISO and it should work but doesn't. 

             

            --jim schimpf

            • 3. Re: SPI Loopback
              jshimpf

              Here is a scope picture of the SPI signals.  As you can see in the program rx_buffer is set to a HEX value but after the xfer it still has the same value not the data shown.

               

              TEK00047.PNG

              • 4. Re: SPI Loopback
                Intel_Alvarado

                We’ll investigate on this. We’ll get back to you as soon as we get more information.

                 

                -Sergio

                • 5. Re: SPI Loopback
                  Intel_Alvarado

                  Hi Jim,

                   

                  I can see you opened a service ticket and managed to resolve this issue. We encourage you to share your results with the community and if you have questions don’t hesitate to contact us again. We’d be happy to assist you.

                   

                  -Sergio