I'm looking into the feasibility of a new project that involves connecting to and reading data from about half a dozen devices. Each of these devices uses serial comms, with their own protocol and baud rate. So they all need to connect to the RX/TX pins. Obviously that won't work, so I'm looking into what other options there are.
I'm aware of the SoftwareSerial library, which allows other digital pins to be used like a serial port. However I've read that doing this blocks the arduino while reading from the software serial port. What exactly does "blocks" mean as that doesn't sound ideal. If I have 6 software serial ports, does that mean that I would only be able to read from one of them at a time? If that's the case, then the other 5 would be sending data in, that would get lost as I'm not reading from them at that instant. Is that right?
Are there any shields that provide additional hardware serial ports?
What about the small Serial to USB converter boards? Do they provide an additional hardware RX/TX or are they just plugging into the RX/TX on the arduino as well to essentially turn it into a USB port?
Are there any manufactures that make boards with more hardware serial ports? For that mater are there other brands... other than arduino that might provide this? I really like arduino and would like to stick with it if possible, but if there is something else out there made by someone else that can do this, then I'm be very interested.
My last resort option would be to have a custom arduino board built from scratch with as many hardware serial ports on it that I need. Would that be a realistic option or is there limitations within the microcontroller or the arduino firmware that would prevent this that I'm not aware of?
You're going to need an SPI-interfaced UART chip or two.
Software serial is good for like 1 port, but not several.
Add this with a Mega and you've 7 serial ports while leaving basic Serial port free for debugging with the PC.
I'm pretty sure libraries are available.
From former times I remember 16 channel serial multiplexers, but I doubt that such devices are still produced. Apart from external serial transceivers you can try to get versions of the modules with other (bus) interfaces, like I2C or SPI.
You could fake your own transceiver with 74HC125 on the receive lines coming back. Tx can go out to all devices.
Still limits you to one active interface at a time.
wilberolive:
I'm looking into the feasibility of a new project that involves connecting to and reading data from about half a dozen devices.
You have not said if you can control when each device transmits. If you can you could have two (or more) devices connected to a single Arduino USART provided you properly isolate the TX connections from each device.
A Mega has 3 spare USARTs.
SoftwareSerial does not work well at higher baud rates and, in general, it is only practical to have a single copy of SoftwareSerial on an Arduino.
As far as I could see in a recent brief trawl with Google one of the cheapest sources of a USART and SPI is an Atmega 328 chip. I think if I was faced with your task I would just mount a few 328s on a piece of Veroboard. Using their internal 8MHz clock they need almost no external components. With a bit of pre-planning they could probably all use identical code (apart from the baud rate, perhaps).
wilberolive:
My last resort option would be to have a custom arduino board built from scratch with as many hardware serial ports on it that I need. Would that be a realistic option or is there limitations within the microcontroller or the arduino firmware that would prevent this that I'm not aware of?
I hesitate to suggest my other favorite microcontroller on the Arduino forum but besides being a fan of the Arduino, I'm also a fan of Parallax's Propeller.
The Propeller microcontroller doesn't have any hardware serial ports. All the peripherals are soft.
The Propeller can have up to four UARTs per cog. There are 8 cogs (processors) in the Propeller. You'd need one of the cogs for overall control of the program but the other 7 cogs could provide four serial ports each. There are baud limitation when multiple serial ports are used in a single cog. I don't think 115200 is completely reliable if more than one port (per cog) is receiving data at time.
It would certainly possible to have a Propeller act as a slave device. It could receive the various serial signals, attach an appropriate header to each message and then pass it on to the Arduino.
The Propeller is a 3.3V device but a 5V Arduino could read the 3.3V logic just fine. If you needed to transmit to the Propeller, a 3.3k resistor will protect the Propeller from the 5V logic.