SPI Multi-slave software solution?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 Hello,

   

I am using the PSoC 4 to communicate between 3 slaves and 1 master. I have set everything up based on the PSoC 4 SPI documentation. After testing it for a while I found that we needed to put a resistor on the slave select lines in order for it to function properly. Unfortunately, I had already ordered the PCB without a spot for these resistors.

   

A little bit of research indicated that the problem I have encountered is common and that using a resistor is a quick and easy fix. However, it seems there is also a way to get multi-slave SPI to work by using software, but I can't seem to figure it out. Does anybody know what I have to do to resolve this issue using software?

   

I can post pictures of the top design and the code if that helps.

   

 

   

Thanks,

   

Colin

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

The only thing that comes to my mind is to control some SS lines per program. Set the number of SS lines in the component to zero (0) and add the requires number of pin components (assume names SS1 to SS3). Now in your program before you send out a stream to a slave you pull the corresponding slave select line low by calling the pin's API SS1_Write(0); and when the transmission is complete (you will have to wait for) set SS1_Write(1). I do not know what the cause of your resistor issue is, but when it is a timing-problem you may insert a short delay when chancing the SS or use as drive mode resistive pull up.

   

 

   

Bob

0 Likes