spi bus between two psoc5

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.
Anonymous
Not applicable

Dear all,

   

 

   

I have a issue with spi bus between two PSOC5LP (cyc85888lti-lp097 and cy85c868axi-lp035).

   

 

   

I would like to send 20 byte of command from master spi and read it in slave one and respond based of command.

   

Seems slave not responds and its second week trying to solve it.

   

 

   

On attached file you will see psoc project for master and slave spi.

   

 

   

Thanks in advance for your advice!

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

To multiplex two signals you need only one bit of the control register, not two. In SPI datasheet section I/O connections, ss pin are two examples on how to manage more than one ss-line.

   

 

   

Bob

View solution in original post

0 Likes
6 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Your view of how SPI works is not quite correct:

   

For every bit (byte) the master sends a bit (byte) is immediately returned by the slave. So it is not a bad idea to make them both > 20.

   

You clobber your sram by initializing your buffer[10] from 10 to 20 since that does not exist.

   

You defined an interrupt handler, but in the SPI component no interrupt is enabled.

   

Your programs are very difficult to read, your indentation does not follow the program structure and I can see only very few comments. When you improve that it can be much easier for you to find bugs.

   

 

   

Happy coding

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi Bob,

   

Thanks for your valuable advice.

   

I succeeded to make it work and now two psoc  talk through spi.

   

I have another issue: How to manage master spi talk with two slave.

   

Could you please, look the screen capture of block diagram slave and master let me know that I doing it in right.

   

SS_A and SS_B digital pins set resistive pul up and initial state high (1).

   

Thanks in advance for your advice!

   

 

   

 

   

 

   

   

0 Likes
Anonymous
Not applicable

Hi, I am working on SPI communication between 2 psoc which is similar what you have done here.

Can you please share your project both master and slave here?

Thank Regards

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

To multiplex two signals you need only one bit of the control register, not two. In SPI datasheet section I/O connections, ss pin are two examples on how to manage more than one ss-line.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks for giving your time.

   

I fixed it. For slave SPI used multislave macro where miso_oe connected to miso pin and ss for input digital pin.

   

On master side I connected two digital input pin and write 0 and 1 to choose slave when need to read.

   

 

   

Thanks in advance for giving your time!

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Congratulations!

   

 

   

Bob

0 Likes