Multiple Hardware Serial Ports Problem

Hey guys,

I am currently working on a project which requires multiple serial devices (12+ RFID scanners) to communicate with my Arduino Mega. I was initially planning to use of softwareSerial library to do this as no more than one device was needed at a time, unfortunately however the specifications have changed so that any of the scanners could potentially send a signal at any time - which renders softwareSerial unsuitable since this requires the Arduino to listen out on a particular I/O port, and so potentially missing other signals.

Can anyone think of a simple solution to this problem... perhaps a piece of hardware that could buffer a serial signal and inform the Arduino that one is waiting. Or perhaps an alternative board with more UARTs - although ideally I would like to stick with my Arduino, I've had a lot of joy with it.

Thanks for your time,

Rich

scanners could potentially send a signal at any time

When the RFID message is sent does to send it continuously as long as the tag is in the field or does it send it once only when it enters the field?

When the RFID message is sent does to send it continuously as long as the tag is in the field or does it send it once only when it enters the field?

Currently it sends the message just the once but I am looking at other RFID scanners that could provide more options, perhaps to perform a scan on request.

If it sends out the message continuously then it is easy. You monitor all the lines and when you see one go low you switch it through to the serial input with a multiplexer.

If not you can add extra UARTs on the I2C line using one of these for each input:- http://ics.nxp.com/products/bridges/uart.i2c.master.gpio/ http://www.nxp.com/news/content/file_1194.html

There is a built in buffer so you don't loose data.

Cheers for the suggestion.

The scanners do send out the message continuously whilst they have power. Is there such thing as a pre-made 16-1 multiplexer circuit/chip, (google is [u]not[/u] my friend today) or would I have to build one myself from diodes and transistors?

Also, is there a chance voltage discrepancies coming through the multiplexer could interfere with the 0-5V serial signal ?

would I have to build one myself from diodes and transistors?

No you build it from chips. You have the serial port converted to TTL. Then put the TTL inputs to a 74LS150: 16-Line to 1-Line Data Selector or two 74151: 8-Line to 1-Line Data Selector/Multiplexers feeding into the serial input pin. You can drive this in a few ways. You then have the serial input made into a simple logic input and scan the inputs in turn. When you see a logic zero on any of the inputs switch over to to the serial data and read the data stream. Then continue to scan the other inputs. Don't re read the first active input you found until you see a logic one on the pin. If you don't want to scan continuously then you can feed the inputs into a collection of gates to make a Priority encoder and trigger an interrupt to switch through and read the data.

I do not know of this as a commercially available product but it wouldn't surprise me to find one. I built something very similar back in the 80s to allow several computers to share the same parallel printer. It was a hardware only scanner that looked for the strobe pulse and switched through the data lines and the not busy line back to the computer.

Sorry for the late reply.

I did what you suggested- purchased a pair of 74HC151N and they worked a treat.

Thanks for the help.

Another multiplex setup for $5 that might be of interest.

http://www.sparkfun.com/commerce/product_info.php?products_id=9056