Go Down

Topic: Multiple Serial Inputs (Read 1 time) previous topic - next topic

switchGirl

Does anyone know how to allow multiple serial inputs/outputs.  I need to use at least 10 IR sensors and still have the ability to have a transceiver. Any suggestions?

Adilson Akashi

#1
Jan 19, 2008, 10:28 pm Last Edit: Jan 19, 2008, 10:32 pm by adilson Reason: 1
Read this:
http://www.arduino.cc/playground/Learning/4051

or search for multiplex/multiplexing/mux on arduino search.

or read multiplexing section here:
http://www.arduino.cc/playground/Main/InterfacingWithHardware#Input
PCB Designer

jnguyen327

I'm curious when it comes to using the multiplexer. What happens when I have incoming serial information from something like a GPS module but I'm not switched to that pin. The UART has a buffer to just collect it until you read it (I think) but I'm guessing the multiplexer doesn't have anything of that sort? If that's the case, would I maybe have to set up a microcontroller on the other end that acts as a buffer until the right pin is selected and the receiving microcontroller requests data from the buffer microcontroller? Is there a better solution?

MikMo

I don't think that using the multiplexing IC's will work for serial communication.

I don't know how the IR sensors work, but unless the send out a voltage using the 4051 multiplexer is not the way to go.

Do you have a link to the datasheet / specs for theIR sensors ?

jnguyen327

I'm kind of curious why a multiplexer won't work with serial communication. I haven't dealt with them before but to me it looks like whatever port is activated the in and out to that port acts like a simple wire. If that's the case then shouldn't serial communication go through? It makes syncing a pain but possibly with a buffer, query interface with port labels on messages it can be done? Of course the big question is, if it doesn't work with a multiplexer, then how can you do serial connection to multiple components with the single UART that the ATmega168 has?

Daniel2

You can multiplex the physical part of the serial connection with CD4066 CMOS analog switches. They're bidirectional, as they are basically just a FET swtich.

Assuming you switch them on at the right time, you can move the serial port connection from one device to another.

D

MikMo

Yes, but isn't that assuming that only one device is comunicating at any given time ?

If a device starts sendig data asuming that Arduino is listening and it's busy serving another device, things wil get hairy very fast.

If all the devices are just being polled for data it's probably a good solution.

Daniel2

Quote
Yes, but isn't that assuming that only one device is comunicating at any given time ?

If a device starts sendig data asuming that Arduino is listening and it's busy serving another device, things wil get hairy very fast.

If all the devices are just being polled for data it's probably a good solution.


yup- you have to manage the connections by managing the enable pins that direct the serial to different devices.

D

jnguyen327

I just wanted to add a resource to this thread. This looked like a great Q&A on the subject: http://www.embeddedrelated.com/usenet/embedded/show/74184-1.php

mrmeval

http://www.maxim-ic.com/appnotes.cfm/appnote_number/588
If it was designed by man it can be repaired by man.

Go Up