Society of Robots - Robot Forum

Software => Software => Topic started by: silo_xtreme on September 10, 2007, 09:26:24 AM

Title: Multiplexing Help ?
Post by: silo_xtreme on September 10, 2007, 09:26:24 AM
Hi Everyone :-)

I am a bit confused about Multiplexing, specifically having more than one sensor on a single pin.  For example, say I have 1 ADC pin available but 2 analog sensors.  How (in lamens terms) does this work when programming the microcontroller?  ???
Title: Re: Multiplexing Help ?
Post by: JesseWelling on September 10, 2007, 10:25:52 PM
Typically a multiplexer is a piece of extra hardware.

The most common type of multiplexer used at my work place is an Analog multiplexer that has 8 Analog inputs 3 digital inputs and one analog output. Then its just a matter of using a binary alias for those 3 inputs to the 8 analog inputs. you want Analog 0? your 3 digital pins will be all lows. you want Analog 5? then pin 1 and pin 3 will be high and pin 2 as low.

There is also I2C and SPI Analog to Digital Multiplexers which are way handy IMHO because using a bus protocol means you can have (technically) 127 multiplexers (of how ever many inputs each... standard is around 8 ) with only using 2 I/O lines... way better than aliasing 3 different digital pins to each of the 127 (3 * 127 = 375 pins, I don't know any micro that has many more than 100 pins total, let alone usable GPIO)...

does that help?  :-\
Title: Re: Multiplexing Help ?
Post by: silo_xtreme on September 12, 2007, 10:52:32 AM
Well There are some chips that can handle more than one ADC conversion per pin, so, i am just trying to understand how the code would like when 2 analog sensors share the same pin on the MCU.

Any ideas? ???