Simultaneous Serial Communication USB + TX/RX  ???

Ive got a question about Serial Communication with an Arduino. I have a working sketch on one arduino but the project has expanded and Im building out additional elements onto a second arduino. The first arduino is connected to the computer via USB and is transmitting serial data on that connection.
Im wondering if I can connect this second arduino to this first one via the TX/RX lines and have simultaneous serial communication between the two arduinos and the primary arduino and the computer. I hope thats clear...the question I mean.

Here`s a quick diagram (from the keyboard as the drawing board)

Computer(Max/MSP)-via- USB (Serial Connection)-to- Arduino 1 - via -TX/RX -to- Arduino 2

possible? If so, any suggestions? code links? ways to think of the coding?

If its possible, I basically need to retrofit the TX/RX connection into my code...so any information is helpful -- no such thing as too much information in this case.

Thanks for your help.
-arduiYES

I am not even close to an expert, in fact I am a completely beginner, but I think you may have to get a mux/demux IC to expand the TX/RX capabilities.

Happily, it is not difficult! (And you don't need extra hardware)

Full details at...

The title is "How To Connect Arduinos to other devices over serial channels"... but the "other device" can be another Arduino!

It's not entirely clear (to me at least) if you want to talk both ways on both links.

If so then you can't do it without extra hardware and even then not "simultaneously".

However if you are just sending data "upstream" to the PC you can do it

PC <- Ard1 TX -- Ard1 RX <- Ard2 TX

However you would need to break out the RX pin on Ard 1 as this is connected to the USB circuit on the PCB.

Another option is to leave the USB connection alone and use SoftwareSerial to talk to the second Arduino (in which case you can talk both ways on both links).

Having said that, why do you need a second Arduino? It would be much easier to use a larger one or maybe an IO expander.


Rob

Computer(Max/MSP)-via- USB (Serial Connection)-to- Arduino 1 - via -TX/RX -to- Arduino 2

You should be able to parallel both arduinos to the pc so the pc can send to both arduinos and receive from both arduinos. The connection between the arduinos would be rx-rx and tx-tx. The arduinos would not be able to talk directly to each other.

If I read your post properly, you want one Arduino, call it "A" to talk to PC and to talk to the other Arduino, call it "B".

As long as "B" doesn't have to talk to the PC too, then you can have what you want without extra hardware. And both channels can be bi-directional.

Well....after reading through all of that...and checking the information on the link...I think it seems a little bit like a hair puller to me. Complex.
What I think Ill try first is to free up three digital ports or three analog ports on both machines and communicate in 8 bit for now. Its a rather small bit of information that needs to go from one to the other so.....Ill try my stoneage solution first.
Thanks for your help!

Complex.

Honestly I don't think this is a complex problem, but the reason we've suggested about 10 different methods is I don't think we know exactly what needs to be done.

The worst case is a full duplex link between all three devices

PC -> RX Ard1 TX -> RX Ard 2
PC <- TX Ard1 RX <- TX Ard 2

Where the Ard1/PC link is the standard hardware serial port and the Ard1/Ard2 link is a software serial link.

three digital ports or three analog ports on both machines and communicate in 8 bit for now

I've lost you there, why three pins? and all comms will be 8-bit anyway.

Also as I said before, what part of your project has outgrown a single Arduino? If we know that we may be able to suggest an even simpler method.


Rob