cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

Anonymous
Not applicable

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

0 Likes
Reply
1 Solution
Esteemed Contributor II

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

View solution in original post

0 Likes
Reply
2 Replies
Esteemed Contributor II

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

View solution in original post

0 Likes
Reply
Anonymous
Not applicable

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.

0 Likes
Reply