You are here

Why my program is not sending data in SPI Communication? | Cypress Semiconductor

Why my program is not sending data in SPI Communication?

Summary: 2 Replies, Latest post by Magnus Lundin on 25 May 2016 12:36 PM PDT
Verified Answers: 1
Last post
Log in to post new comments.
maknight's picture
195 posts

Hello Every one,

I am making communication between Pi and PSOC.

What i am doing is the following:

My Pi is sending me a 2 bytes of data (16 bits). I am reading that data and performing a logical and operation and sending my filter data back.

Please find attachment and have a look on my program and give me your valuable suggestions.

Looking forward for your reply.





user_1377889's picture
9279 posts

You are a bit wrong in how spi works. SPI is not a write from master, then write from slave. instead reading and writing goes in parallel.

For every bit master sends a bit from slave is transmitted at the same time, This usually results in

A dummy byte received from master as the first byte because slave does not know yet what master wants to see.

Master needs to send dummy bytes to receive new data from slave-



Magnus Lundin's picture
14 posts

For a situation where one part (Pi) sends data and the other (PSOC) processes it and returns results when finished, that is asynchronously, I would consider if UART communication could be the the best option.

Log in to post new comments.