SPI Interrupt and other ?'s from SPI Newbie

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
joli_601446
Level 5
Level 5
10 likes given 10 sign-ins 5 sign-ins

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?

Transmit_Gap.jpg

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:

SlaveFifo_Array.jpg

I would expect to see 8-bytes in the dsp_spi_rcv_buffer but I'm only getting 4. Why?

Can anyone help me out please.

Thanks,

Joe

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Dear Joe-san,

I have written at least several programs using SPI slave device(s) with MCUs including Cypress, NXP,

and I have never seen a slave device which requires an extra byte for sending data.

And as I wrote in my previous reply, PSoC's SPIS also does not require an extra byte,

at least it was receiving the data into its rx buffer.

So I don't think you need to worry about the extra byte sending with XRA1403.

moto

View solution in original post

0 Likes
6 Replies