4 SERIAL CONNECTIONS AT SAME TIME?

Hi,

I need to rx tx four serial devices at same time ( or if not possible with the smallest interval between readings/writings).
Devices:

1 arduino as master "computer" it will work data from/to the following devices

2 arduinos ( 1 with a touch color tft and the other to work with sensors ...)
1 Voice Recognition module ( serial interface)
1 Pc from arduino ide.

Please give me some simple code example how i can do this (im a beginner on arduino try to understand)

Thanks

http://arduino.cc/hu/Tutorial/SoftwareSerial

Should get you started.

Also, you'll probably want to check the serial voltage levels of the other devices to make sure you won't fry your microcontroller.

Hi,

The devices are all 5v ttl, in this example all devices are conected to the same ports? (byte rx = 6 byte tx = 7) if yes do i need to connect resistors, diodes? or just put all rxs from the devices together and the same to txs?
I saw that i will have to work with delays :frowning:

Thanks

Get a Mega1280 or 2560, has 4 Serial ports. Software serial will tie up too much.

Hi,

I already bought the boards and im now very short of money :frowning:

Consider having one Uno arduino, the 'master' talk to the PC via serial and then have the master arduino talk to the other arduino boards using I2C communications. That will leave the serial ports on the 'slave' arduino boards free to use their serial pins free to talk to any attached serial device.

Otherwise save up and get a Mega board.

Lefty

Hi,

I will try your way and later post the results.

Thanks

retrolefty:
Consider having one Uno arduino, the 'master' talk to the PC via serial and then have the master arduino talk to the other arduino boards using I2C communications. That will leave the serial ports on the 'slave' arduino boards free to use their serial pins free to talk to any attached serial device.

Otherwise save up and get a Mega board.

Lefty

Hi,

I2C only works with analogic pins? i saw a axemple using A3 and A4 were can i find how to config for a conecting like 1 arduino master to 2 arduino slaves?

Thanks

I2C is over the A4 (SDA) and A5 (SCL) lines. This is fast hardware within the ATMega.
I don't know of particular code to do that. Did you try looking in the Playground?

Hi,

Im very new at this and the Playground dont have what i need.

Thanks

I think it does.
This link is under the Communications section, under I2C/TWI

http://www.smacula.co.uk/2011/12/communicating-between-arduino-boards.html

"I2C communication between two Arduino Boards, with Bus Extender and Optical Isolation: A case study that discusses communicating between two Arduino boards, using a P82B715 bus extender, and optically isolating the two Arduino supplies using an ADuM1250. "

You probably don't need the bus extender optoisolator parts.