Pages: [1]   Go Down
Author Topic: Multiple Serial Inputs  (Read 1013 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Brazil
Offline Offline
Sr. Member
****
Karma: 0
Posts: 443
..., to learn, to know, to make, to share, to l...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: January 19, 2008, 04:32:38 pm by adilson » Logged

PCB Designer

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 229
Intransigent prototyper
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 229
Intransigent prototyper
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Greenwood, Indiana
Offline Offline
God Member
*****
Karma: 0
Posts: 508
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.maxim-ic.com/appnotes.cfm/appnote_number/588
Logged

If it was designed by man it can be repaired by man.

Pages: [1]   Go Up
Jump to: