This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

multiple spi slaves issue.

hi,

say I have only one SPI module which can be used. But I have 2 spi slaves. they by themselves work properly when they are individual. but when i combine i have issues.

say slaves are x and y.

initially I start with "x", receive data from it. Then I want to forward the same data to slave y. slave y performs some operation based on that data and sends back some other data. This data i have to send to slave x, which in turn have to perform some action based on that data. how do i do it.

  • SPI is a bus. You can attach any number of slaves to it. However, each slave needs its own, software-controlled chip select signal (so you can attach only as many slaves as you have free I/O pins left).

    Before you start a transfer, you pull the slave’s CS signal line low, then you start the transfer. When the transfer is done (which is not when you get the next TXIFG after you wrote the last byte to TXBUF, but 8 clock pulses later, use UCBUSY to check), you pull the CS signal high again.

    For the general workflow, receive here, then send there etc, this really shouldn’t be a problem for you. Just get the individual transfers sorted out.

  • thanks,
    I got it done and is working fine.

**Attention** This is a public forum