Arduino networking

I'm wondering if electrically, connecting the TX to the RX on multiple chips and then wiring everything together would actually work.

If it does work then I could create a protocol similar to Ethernet to prevent collisions and stuff like that.
Very simple bi-directional communication between many chips would then be possible.

Why would someone want to do it? Speed mostly.
If you have a fairly complex setup such as collecting data from many sources and then displaying it via many ways then it would help.
Every chip handles a small chunk of the job and they work together.
A lot like a multiprocessor computer.

I'm thinking of rigging a pile of my ideas together to function as a whole.
One chip to do networking stuff with the Wiznet chip, another to control multiple LCDs, one for various sensors, one for dealing with a LED matrix and one to co-ordinate various parts of it.
You'd never be able to do all that on a single Arduino and it would be faster than getting a bigger ATmega chip.

'm wondering if electrically, connecting the TX to the RX on multiple chips and then wiring everything together would actually work.

Nope. Think about the TX outputs: they are either high or low. If processor A drive it high and proceessor B drives it low, what will the RX line actually see? Best case, about 2.5V, which is indeterminate as a 5V TTL signal level. (We are assuming this won't damage any hardware by connecting multiple drivers, which is not a safe assumption.)

Now if you go a bit farther and set the TX pins to high impedence when idle and check the RX line before you transmit, then you have the basis for the system you describe.

I think RS485 does something like this. It includes addressing, too. Maybe even differential signaling for long runs and high speeds, if I remember correctly.

-j

That would be a collision. Ethernet will get it all the time if you use a hub.
I know how to write code which detects and avoids collisions.

I also believe 2.5v would lean towards 1 rather than 0.
I'd have to check the datasheet but thats a hunch.

The problem is that with TTL/CMOS (or rs232, for that matter) levels, you essentially have a collision even when no one is transmitting, because everyone is trying to drive the bus either high or low. RS-485 is an electrical specification that is sometimes (frequently?) use to implement a bus-style network using uart-like serial transmitters (DMX is apparently a set of additional specs that does essentially uart transmission/reception over RS485 for theatrical lighting control.) You might be able to get away with some sort of "open collector" bus.

Or (re-reading) were you only going to have one transmitter connected to multiple receivers? That should work fine.

Hmm actually yeah now that I think about it I see your point.

Damn. :frowning:
It could have been pretty cool.

I think the new Xbee modules can create a wireless mesh network.

But it wold be a little pricey :slight_smile:

MikMo

You don't have to give up on your networking idea. Both the I2C and SPI protocols allow multiple slave devices on the bus. Another thread on this very forum shows how to program an Arduino to be a master or a slave device. Although the example code uses the slave as a pure listening device, the I2C protocol permits a slave to reply to a master with data. This capability is used on many devices that have an I2C bus (think temperature sensors, A/D's, D/A's etc). Collisions are avoided because a slave only accesses the bus after it's been requested to: the others remain silent.

I'm not familiar enough with the I2C protocol to know if a slave can autonomously generate a message (like an overtemp alarm). Some additional research into the I2C bus protocol should answer this question.

Yeah I'm looking at I2C with the possibility of using a external interrupt to make the slave send event information. :slight_smile: