Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Multi Device Comms Busses.

Multi Device Comms Busses.

2005-01-05 by Stuart Whelan

I am designing up a system where a single master AVR has to talk to a
heap of Slave AVR's.

In my previous efforts the slaves have always been on the same PCB, so I
have been used SPI.

Now the slaves are going to be on different PCB's, which comms cables
running between them.

The run length would be about a meter, maybe two meters.

I recall seeing people say that SPI should 'leave the board'.

I have used rs232 in the past, but it means either:

1) Creating a serial communications ring where Master talks to slave 1,
slave 1 talks to slave 2 and slave 2 talks to the master. If one of the
slaves die, its hard to tell which is at fault.
2) Having a master device that has multiple rs232 uarts.

So my questions are these: Is there a better bus to use than rs232?
Are there any Mega's or other chips I can use to get multiple rs232
uarts?
Can you run 4 or 5 rs232 buses on say a mega8 or mega16 by using bit
banging?

The development time for this is short, so I am not sure I can wait for
the AVR CAN's chip to show up.

Any info or tips would be appreciated!

Kind Regards,
Stuart Whelan

Recursion: See Recursion.

RE: [AVR-Chat] Multi Device Comms Busses.

2005-01-05 by Alex Shepherd

> In my previous efforts the slaves have always been on the 
> same PCB, so I have been used SPI.

What about I2C or TWI as Atmel call it?

Alex

Re: [AVR-Chat] Multi Device Comms Busses.

2005-01-05 by Svenn Dahlstrøm

Hi Stuart

You can use RS485 with the uart and same protocol as RS232.
You only need 1 extra pin for enable.
2-wire(twisted pair) + com, smaller chip (8pin), I recomend SN75LBC184 from 
Texas
(allows 128 devices on the bus), cheep, under 0.5US.
http://focus.ti.com/general/docs/lit/getliterature.tsp?genericPartNumber=sn65lbc184&fileType=pdf

Svenn
Show quoted textHide quoted text
>
> I am designing up a system where a single master AVR has to talk to a
> heap of Slave AVR's.
>
> In my previous efforts the slaves have always been on the same PCB, so I
> have been used SPI.
>
> Now the slaves are going to be on different PCB's, which comms cables
> running between them.
>
> The run length would be about a meter, maybe two meters.
>
> I recall seeing people say that SPI should 'leave the board'.
>
> I have used rs232 in the past, but it means either:
>
> 1) Creating a serial communications ring where Master talks to slave 1,
> slave 1 talks to slave 2 and slave 2 talks to the master. If one of the
> slaves die, its hard to tell which is at fault.
> 2) Having a master device that has multiple rs232 uarts.
>
> So my questions are these: Is there a better bus to use than rs232?
> Are there any Mega's or other chips I can use to get multiple rs232
> uarts?
> Can you run 4 or 5 rs232 buses on say a mega8 or mega16 by using bit
> banging?
>
> The development time for this is short, so I am not sure I can wait for
> the AVR CAN's chip to show up.
>
> Any info or tips would be appreciated!
>
> Kind Regards,
> Stuart Whelan
>
> Recursion: See Recursion.
>
>
>
> Yahoo! Groups Links
>
>
>
>

Re: [AVR-Chat] Multi Device Comms Busses.

2005-01-05 by Paul Maddox

Stuart,

> I have used rs232 in the past, but it means either:
>
> 1) Creating a serial communications ring where Master talks to slave 1,
> slave 1 talks to slave 2 and slave 2 talks to the master. If one of the
> slaves die, its hard to tell which is at fault.
> 2) Having a master device that has multiple rs232 uarts.

or 3)
One master UART, and some select logic, 3 pins of select will give you 8
remote AVRs.

or 4)
Give each remote device an ID (jumper on pcb maybe) and have the Master
include some protocol which allows it to select one of the remotes for
receiving data.

> So my questions are these: Is there a better bus to use than rs232?

if speed isn't critical, I'd stick with rs232, its less cable and pretty
simple.

Paul

Re: [AVR-Chat] Multi Device Comms Busses.

2005-01-05 by Jim Wagner

I suggest using RS485.

All the devices sit in "parallel" on a single bus. You DO
NOT need additional enable lines. Assign each device an
address and make the address the initial part of the
message. 

The biggest "trick" with '485 is what to do when no device
has electrical control over the line. The usual solution is
to apply a little bit of bias at one point (often the
master) so that the line is always in a known state.

National Semi has one or more VERY GOOD app notes on use of
422/485. Many sources of transceivers (TI, National, Maxim,
Linear Tech, etc).

Jim
---------------------------------------------------------------
The Think Different Store
http://www.thinkdifferentstore.com/
For All Your Mac Gear
---------------------------------------------------------------

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.