I am looking for a solution to translate one RS-232 protocol on 9600 baud to another RS-232 protocol on 19200 baud simultaneously
For example:
Port 1 listens on 9600bd and reads a numerical value from that data
Port 2 sends out the same value, but other protocol at 19200bd
My questions are:
Which Arduino may be suitable for this? I need it to be as small as possible.
If it would not work on one and the same Arduino, can I read the value from Serial1, send it by I²C to another Arduino and then send it out on the Serial1 of the second Arduino?
Or am I missing some other, more elegant solutions?
My question is not how the data handling will be done, my question is to find the right hardware for the job. So my questions still stand: What Arduino type would suit the best? What hardware is able to receive data on 9600bd and is able to (almost) simultaneously transmit this message in another format at 19200bd?
My question is not how the data handling will be done, my question is to find the right hardware for the job. So my questions still stand: What Arduino type would suit the best? What hardware is able to receive data on 9600bd and is able to (almost) simultaneously transmit this message in another format at 19200bd?
Any Arduino with at least 2 spare serial ports. Serial port 0 is normally used for the serial monitor, so you need one with at least 3. There is no 'best' for the job, there are ones with enough serial ports and ones that don't have enough serial ports.
Have a look at the product comparison page
Look under the column 'UART'. All serial ports on all Arduinos are capable of the 2 different speeds you want. The software requirement is trivial, well within the capability of any of them.
As long as the transmission direction is fix, output is faster than input, and there exist known gaps in the input, it's possible to buffer a record from the slow input, switch to fast baudrate, output the buffer, then switch back again. Half duplex transmission also offers this solution, if the input direction can be controlled by the Arduino. Then stop input while outputting the buffer.
Also SoftwareSerial may be usable for the slow input, and hardware Serial for the fast output.
No problems at all with multiple UARTs, maybe internal (Mega: 4) or added externally. Dunno about other Arduino supported chips, maybe some ATtiny may have 2 hardware UARTs?
Thank you for your replies. The Arduinos which have > 1 UART are rather big. Could it work if I connect two Arduino Pro Mini's by I²C so that one Pro Mini acts as receiver and the other Pro Mini acts as a sender?
DrDiettrich:
Also SoftwareSerial may be usable for the slow input, and hardware Serial for the fast output.
I'd be inclined to use hardware Serial for the 9600 baud input and SoftwareSerial for the 19200 baud output even though the latter is a higher bit rate.
My understanding of the SoftwareSerial library code is that it includes a blocking delay of one character transmit period. This delay will be shorter at the higher baud rate. Also the hardware receive will tolerate not being serviced by the processor for up to two character periods without dropping data should the asynchronous serial input coincide with serial transmit.