Forums

Help required performing Single Master - Multiple(upto 16) Slave SPI Comm.

Started by "aha...@ymail.com" May 24, 2013
Hi all, I am planning to use MSP430F6638 for SPI Communication between a single MSP430 Master and multiple MSP430 Slaves. I am using a 4x16 Multiplexer before each Slave for providing the Chip Select Signal. This allows for using 4 GPIO wires to address 16 Slaves. I am curious about the following issues and would like to have suggestions about the possible solutions.

1. The wire distance goes up to a maximum of 10m, will I face clock synchronization issues? What can I do to solve it?

2.Should I use unidirectional line buffers on the CLK, SOMI, MOSI pins and Chip Select GPIO wires in order to be able to address 16 Slaves? As for the fan-out, the MSP430 datasheet says (as I understood) that fan-out must not increase 48mA on all pins combined and I am using some other peripherals simultaneously, so it's difficult to calculate the remaining capability.

3.Should I try going for a Daisy-Chain configuration? Does anybody have experience of writing software for Daisy Chain? Will it be of help using a Real Time Operating System or SYS/BIOS for writing the complex firmware required in case of Daisy Chain?

I would highly appreciate useful suggestions and comments. Thanks

Beginning Microcontrollers with the MSP430

Since you are using SPI, There shouldn't be any clock synchronization issues. But You will run into some propagation delays. The simplest solution is to slow down the clock rate ( something under a megahertz). Avoid the bidirectional buffers as the line echoes will fool them into transmitting the wrong direction. I believe in buffering anything that leaves the board. Think about line termination, a resistor on the end of the transmission line to reduce reflections. These resistors will be picked based on what the type of wire used.

As far as daisy chain or direct one to one, that depends on how big the messages from each MSP. Each MSP must buffer the equivalent of its message size so that it can start transmitting it when its own buffer has been sent. That's not too hard if you're only transmitting a few words. I think I would vote for the daisy chain in your architecture.

You don't say which MSP family you're using as slaves. Be sure to check that the chip select resets the clocking buffer When it is disabled. I've had issues where a stray clock signal stays in the count regardless of how many times the chip select is cycled. My solution was to run the chip select into both the ste pin and an interrupt pin so I can reset the SPI subsystem when the chip select is released.

--- In m..., "ahammad88@..." wrote:
>
> Hi all, I am planning to use MSP430F6638 for SPI Communication between a single MSP430 Master and multiple MSP430 Slaves. I am using a 4x16 Multiplexer before each Slave for providing the Chip Select Signal. This allows for using 4 GPIO wires to address 16 Slaves. I am curious about the following issues and would like to have suggestions about the possible solutions.
>
> 1. The wire distance goes up to a maximum of 10m, will I face clock synchronization issues? What can I do to solve it?
>
> 2.Should I use unidirectional line buffers on the CLK, SOMI, MOSI pins and Chip Select GPIO wires in order to be able to address 16 Slaves? As for the fan-out, the MSP430 datasheet says (as I understood) that fan-out must not increase 48mA on all pins combined and I am using some other peripherals simultaneously, so it's difficult to calculate the remaining capability.
>
> 3.Should I try going for a Daisy-Chain configuration? Does anybody have experience of writing software for Daisy Chain? Will it be of help using a Real Time Operating System or SYS/BIOS for writing the complex firmware required in case of Daisy Chain?
>
> I would highly appreciate useful suggestions and comments. Thanks
>

Just an observation, but silicon is cheaper than copper wire, in terms
of both installation cost and infrastructure costs. Are the slaves
powered by the master or independently?

Since these are slaves they won't be instigating communication to the
master, so a channel per slave RF transceiver would work quite well for
you, and with off the shelf RF modules available very cheaply I'd
probably take this route for cost and simplicity, and ease of network
expansion, unless there are major power supply issues that would make it
impossible.

Al

On 25/06/2013 5:11 PM, mad_as_mas wrote:
>
> Since you are using SPI, There shouldn't be any clock synchronization issues. But You will run into some propagation delays. The simplest solution is to slow down the clock rate ( something under a megahertz). Avoid the bidirectional buffers as the line echoes will fool them into transmitting the wrong direction. I believe in buffering anything that leaves the board. Think about line termination, a resistor on the end of the transmission line to reduce reflections. These resistors will be picked based on what the type of wire used.
>
> As far as daisy chain or direct one to one, that depends on how big the messages from each MSP. Each MSP must buffer the equivalent of its message size so that it can start transmitting it when its own buffer has been sent. That's not too hard if you're only transmitting a few words. I think I would vote for the daisy chain in your architecture.
>
> You don't say which MSP family you're using as slaves. Be sure to check that the chip select resets the clocking buffer When it is disabled. I've had issues where a stray clock signal stays in the count regardless of how many times the chip select is cycled. My solution was to run the chip select into both the ste pin and an interrupt pin so I can reset the SPI subsystem when the chip select is released.
>
> --- In m..., "ahammad88@..." wrote:
>> Hi all, I am planning to use MSP430F6638 for SPI Communication between a single MSP430 Master and multiple MSP430 Slaves. I am using a 4x16 Multiplexer before each Slave for providing the Chip Select Signal. This allows for using 4 GPIO wires to address 16 Slaves. I am curious about the following issues and would like to have suggestions about the possible solutions.
>>
>> 1. The wire distance goes up to a maximum of 10m, will I face clock synchronization issues? What can I do to solve it?
>>
>> 2.Should I use unidirectional line buffers on the CLK, SOMI, MOSI pins and Chip Select GPIO wires in order to be able to address 16 Slaves? As for the fan-out, the MSP430 datasheet says (as I understood) that fan-out must not increase 48mA on all pins combined and I am using some other peripherals simultaneously, so it's difficult to calculate the remaining capability.
>>
>> 3.Should I try going for a Daisy-Chain configuration? Does anybody have experience of writing software for Daisy Chain? Will it be of help using a Real Time Operating System or SYS/BIOS for writing the complex firmware required in case of Daisy Chain?
>>
>> I would highly appreciate useful suggestions and comments. Thanks
>>