Quantcast
Channel: EngineerZone: Message List
Viewing all articles
Browse latest Browse all 24339

Re: SPI Transmit in slave mode

$
0
0

Hi Klaus,

 

Thanks for your quick response. I looked into your suggestions, think I have it set up as it's supposed to be, but not sure about what I am seeing on my scope.

 

I have attached the transmit function of my code. I have my SPI driver written so that it alternates between transmit and receive functions. The receive function is working Ok, the transmit function I'm not so sure. I did check my chip select signal and I now have the ARM driving the chip select signal low whenever the ARM is transmitting data to the DSP.

 

The ARM is sending 8 bytes of data to the DSP with a delay of 10 ms between each send. The received data is read into a buffer and then the attached SPI_transmit() function is called.

 

Looking at the MOSI line on the scope, I can see all 8 bytes being sent from the ARM (MOSI.BMP)

 

Looking at the MISO line on the scope, I can now see the values in the buffer being incremented, but I see the same value being sent 4 times; i.e. SPI_transmitBuffer[i] is put onto the MISO line 4 times / SPI transmit.

 

I do now see all values in the transmit buffer being transmitted, so although the same buffer element is packed 4 times into each send, it does cycle through all elements in the buffer. That's what I can see on the scope anyway. I have attached a few single shot grabs from the scope of the MISO line.

 

Another point to note is that I am working off the master transmit chip select signal to transmit from slave (DSP) back to master (ARM). This seems a bit limited to me, but I can't see how else the chip select line can be controlled; I just have to wait for the master to drive the chip select signal low to transmit data from the slave?

 

Is this expected behaviour? I was expecting to see SPI_transmitBuffer[0 - 3] on the MISO line consecutively (as the clock an chip select signals are 8 bytes long).

 

Thanks

Brian


Viewing all articles
Browse latest Browse all 24339

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>