AnsweredAssumed Answered

How do I end a SPI Transfer when a particular byte is received?

Question asked by atm on Apr 8, 2016
Latest reply on Apr 13, 2016 by Hui_Ma


I am using the processor expert SPI_Master_LDD, but it is slightly modified to integrate with some more advanced driver code.

 

I am using this driver code to communicate with a part I have not communicated with before and I am having an issue.

 

The protocol for the device I am communicating with requires me to send a packet of data and then receive until I receive a non-zero response. I have no problem constructing a send and then receive, but I cannot figure out how to--when I detect a non-zero character--end the SPI message immediately (deassert chip select) without shifting out any extra frames.

 

My driver, up to this point, has always known the fixed amount of bytes it would need to receive and would clear the SPI_PUSHR_CS_MASK in the SPI_PUSHR register to clock in the last byte of received data.

 

Thanks for the help in advance!

Outcomes