Community
cancel
Showing results for 
Search instead for 
Did you mean: 
jschi71
Novice
1,238 Views

SPI Loopback

Hi,

i used the example from ( 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

5 Replies
Sergio_A_Intel
Employee
57 Views

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 /thread/103948 https://communities.intel.com/thread/103948 .

Let us know your results.

-Sergio

JSchi7
Novice
57 Views

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

JSchi7
Novice
57 Views

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.

Sergio_A_Intel
Employee
57 Views

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

-Sergio

Sergio_A_Intel
Employee
57 Views

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