6 Replies Latest reply on May 7, 2018 5:23 AM by kakhc_3262611

    spi bus between two psoc5

      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!

        • 1. Re: spi bus between two psoc5

          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



          • 2. Re: spi bus between two psoc5

            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!









            • 3. Re: spi bus between two psoc5

              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.





              • 4. Re: spi bus between two psoc5

                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!

                • 5. Re: spi bus between two psoc5






                  • 6. Re: spi bus between two psoc5

                    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