7
\$\begingroup\$

I want a master node consisting of a TI Stellaris Cortex M3 core connected to what can be up to 32 slave nodes of TI MSP430 (or possibly more Stellaris slave nodes). These will be maximally 0.5 meters between master to most distant slave. Bit rates of around 0.5-1mbps will be needed. What kind options are available for internal communications?

From docs they both seem to support SPI, UART and I2C.

  • SPI will from what I find, need 1 selector wire pr node. Way too many wires.
  • I2C seems easy, but for from docs I get the max speed is 400KHz. Too slow without degrading quality or maximum number of nodes.
  • UART seems to acheive the speed, but can it be used outside of A to B communication?
  • Did I miss anything?

Update: As noted in comments, updated I2C speed for msp430 to 400KHz. Still too slow though. Also the network is purely one master and n slaves.

\$\endgroup\$
  • \$\begingroup\$ When you say that you could have more Stellaris nodes, do you mean that you'd have multiple masters? This is much easier (see AngryEE's answer) if you only have one master. \$\endgroup\$ – Kevin Vermeer Feb 4 '11 at 20:25
  • \$\begingroup\$ CAN will work at 1Mbps at over 20 metres. Not sure if any of the others will. The Stellaris microcontrollers also have very good support. Make sure you check out the errata as there are some sticking points. Their driver library is pretty good at circumventing the many errata! \$\endgroup\$ – Tim Feb 6 '11 at 18:54
  • \$\begingroup\$ Just one master. Updated question \$\endgroup\$ – Imbrondir Feb 6 '11 at 22:33
7
\$\begingroup\$

I would suggest either RS485 or CAN; RS485 has the advantage of almost universal availability (if you've got a UART, you can have RS485; if your UART has automatic RTS control, you have a perfect RS485 solution). You can find cheap, small devices that will go up to several megabaud as well.

CAN is a little more robust, but if your microcontroller doesn't have the peripheral it can be an additional cost you're not willing to add to the project. CAN's main advantage over RS485 (IMO) is that in the case of bus contention, a complete message will still get through; If two devices start talking on an RS485 network, nothing intelligible is received and there is no built-in means of bus management, so you have to take care of this in software.

For your given speed and given that I don't believe the microcontrollers you mentioned have built-in CAN controllers, I'd suggest a token-based RS485 network. Essentially none of the nodes speak until it's their turn to speak, and this is done though the passing of a "token" (a short network message granting the use of the bus) to each of the nodes in turn. It's relatively easy to set up, is far more reliable than CSMA/CD and I think you could have something up and running within a day or so.

\$\endgroup\$
2
\$\begingroup\$

RS485 might be a good fit. It uses the UART for the serial stream, but it will need a direction pin to determine which node controls the bus.

The Master will transmit a message and then listen for a response.

The Slaves will decode all the messages and respond to the messages addressed to it.

\$\endgroup\$
2
\$\begingroup\$

FWIW, I'm pretty sure that the I2C bus can be run at higher speeds than 100kHz. MSP430, I believe, can support 400kHz operation at least.

\$\endgroup\$
  • \$\begingroup\$ I2C also has a 3.4Mhz high speed mode but i don't know of any micro-controllers in the MSP430 or cortex-M3 market segments that support it. \$\endgroup\$ – Mark Feb 3 '11 at 18:10
  • \$\begingroup\$ I stand corrected. I confused it with the spec of another micro I was evaluating. The msp430 can go up to 400MH. Still a bit too low though. \$\endgroup\$ – Imbrondir Feb 4 '11 at 10:42
2
\$\begingroup\$

You could ignore the select line for SPI and treat it as a more generic synchronous serial interface. I believe the Stellaris will let you configure the SPI as an SSI, but I'm unsure about the MSP430's. Regardless, you can just have them monitor the bus and only respond if they see their slave address pop up. You'll have to write the software for this but it will work.

\$\endgroup\$
  • \$\begingroup\$ How would you deal with conflicts on the bus, such as if two devices start to talk at the same time? \$\endgroup\$ – Kevin Vermeer Feb 4 '11 at 20:24
  • \$\begingroup\$ Interesting. I'll have to investigate this too. \$\endgroup\$ – Imbrondir Feb 6 '11 at 22:36
  • \$\begingroup\$ @Kevin Vermeer: one approach is to solve it the same way we solve the same problem on RS-485: a single master, unique node numbers, and all other nodes only transmit when the master commands that particular one to transmit. \$\endgroup\$ – davidcary Jun 14 '11 at 1:37
0
\$\begingroup\$

I2C will run at least 400kHz with most parts. It would be the easiest solution for a short distance communication bus. If you wanted something more robust I'd recommend CAN or RS-485, but both would require additional external chips.

\$\endgroup\$
0
\$\begingroup\$

There is a "daisy-chain SPI protocol" ("JTAG-like protocol") that requires a total of 4 pins on the bus master, no matter how many slaves are in the chain. The daisy-chain SPI never has conflicts on the bus, because each bit of wire has only one driver connected to it. See Wikipedia: Daisy-chain SPI and Help with device identification in a chain .

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.