Receving several serial streams (RS232 format) and

I've a need to receive several (2 or 3 ) serial streams from RS232 devices and then send it out the hardware TX pins. Does anyone have any idea how to do it? There's definitely a need for receive buffering, as data can be coming simultaneously from all the ports.

Take a look at SoftwareSerial http://www.arduino.cc/en/Tutorial/SoftwareSerial

With SoftwareSerial you can use any of the digital i/o pins on the Arduino to communicate with serial devices

SoftwareSerial should be avoided if you can get more hardware serial ports

:slight_smile:

Thanks, I've look at the SoftwareSerial but I'm not sure If I can declare multiple SoftwareSerial ports. Even If I can how do I simultaneously receive from more than one.

The SoftwareSerial page suggests you can use multiple SoftwareSerial ports

Using them simultaneously may not work

Hopefully someone that knows for sure can chime in

:slight_smile:

how do I simultaneously receive from more than one

You can't. That's one of the fundamental limitations of the "polled" implementation of the SoftSerial code. (Another is that if you're not waiting for the character when it arrives you'll miss it.) The "best" way to implement simultaneous transmission and/or reception of a "software UART" is to use interrupts, typically a timer interrupt.

Until a multi-channel software UART implementation is created, the best alternative is to utilize an external hardware UART. The Maxim MAX3100 is but one example of such a device.