Hello, I'm starting out with a simple SPI program in order to learn SPI. I'm using PSoc5 kit to program an SPI Master and SPI Slave. I'm getting data from the Slave but I have few questions.
1. When I use the Function call SPIS_WriteTXDataZero() this puts an extra byte in the TX FIFO and the Master SPI must send an extra word to get all of the data in the Slave TX FIFO clocked out. Doesn't this cause some problems, in managing what's in the FIFO and getting things aligned properly. I guess I could have the Master SPI send and extra word on the first SPI Master write. Comments?
2. I'm writing 8-bytes to the Master TX FIFO but on the scope I see a 50usec gap between the first four bytes and the remaining 4 bytes. Why?
3. Last, I'm tying to get an interrupt on the SPI Slave to work. I have tried to implement an Interrupt Service Routine but the data from the Slave RX FIFO seems to be missing some words:
I would expect to see 8-bytes in the dsp_spi_rcv_buffer but I'm only getting 4. Why?
Hello, thank you responding to my message. Do you know if actual SPI Slave Devices that have SPI Mode CPHA(0),CPOL(0) require an extra byte from the Master? Or, is that just present with PSoC SPI modules? I'm using the PSoC5 to interface with a XRA1403 GPIO expander. The dataheet does not mention this extra byte, so I'm contacting the company.
Last, when I send the extra byte I get all 8 words in Slave receiver buffer in the ISR.
Another thing, I changed the Interrupt "Interrupt Type" to Level. After making this switch the I was able to read all 8-bytes in the Slave Receive buffer. Perhaps I will missing an interrupt before and this change fixed things.