- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Regards
Awais
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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-
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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-
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.