Advice for monitoring 10 async serial ports simultaneously.
Here are the details:
-
Need to monitor 10 ID-12 RFID modules in real time
-
Baud rate is 9600bps
-
Messages are short. 12 bytes total.
-
No requirement for TX
The software serial driver warns that only one port can listen at a time, meaning it's possible that I may miss a message if two devices send at the same time.
The datasheet on these modules sucks. I had an idea that if the TX pin was either open collector, or went tri-state when in reset, I'd scan the reset pins in succession. I still haven't determined what type of output it is.
Please, if you don't have a firm answer, don't guess.
Posted Apr 29, 2013, 9:14 PM UTC · edited
To clarify,
No. I have no idea when a message will arrive.
Let's hear it!
I still don't quite know what you need, so here are my three ideas:
Simple Put the ID-12s in Magnetic Emulation mode. In this mode, the data pins are open-drain and the Card Present pin is active. Put all ID-12s on the same two data lines. Use the Arduino's SPI port for communication and the Card Present lines to determine which ID-12 is active. The ID-12s may occasionally stomp on each other. Uses a lot of pins.
Complicated Put the ID-12s in Magnetic Emulation mode. Multiplex the data lines. Use activity on the Card Present lines to identify the active ID-12 and generate an interrupt. Quickly switch the two multiplexers to the active ID-12. If two ID-12s talk at once, you get to choose to listen to one of them. Uses a lot of pins.
Damned Complicated Get one ATtiny2313 for each ID-12. (They're about $1.20/ea.) These microcontrollers have serial and I2C just like the Arduino. Connect each ID-12 to a Tiny using serial. Connect all of the Tinys to a common I2C bus. Program each ATtiny to receive data from the ID-12 and to hold onto it until queried over I2C by the Arduino. The Arduino could poll each ATtiny periodically for new messages or the Tinys could alert the Arduino of new messages using a third line. All messages will be received. Only requires three pins.
(four). Use actual UARTs to catch the packets, offloading the serial bit-banging to the silicon. The XR17C158 looks interesting: an octal UART with 64-byte FIFO per channel; that''s deep enough to hold your 12-byte packet, methinks.
Pretty useless with a PCI interface, but the rest of their lineup looks promising.
http://www.exar.com/connectivity/uart-and-bridging-solutions
Actually, this might be the answer. I'm looking at doing software serial in an ATtiny13A, which are $.59 each Q25, which isn't bad.
On 2, you should be able to service two 9600bps signals at the same time.
On 3, it would probably be cheaper to buy different modules.
ReadiNg the problem, I was definitely thinking along the lines of #3. If you can't miss a message, the solution is (relatively) expensive, but comprehensive.
[deleted]