A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.
Hi. I have been trying today to use one Analogue Input on my PIC for multiple Analogue Inputs - A sort of Multiplexing? Anyway, my first idea was to use other outputs from the PIC to supply the +5V on each pot, so my process was Turn on C0, sample AD, Turn on C1, sample AD etc etc. My problem is connecting all the outputs into one, i thought a diode on each wiper would work - but i get strange results when i display the conversion values on the LCD. Now i'm sure my problem lies with the diodes. Is there such a thing as a Analogue Tri-State IC? Cause i think this might work? Has anyone ever done this before? I know there are a good number of AD pins on the PIC16F877, but i need the IO! I know it will take a Output per AD but i think i will have to expand using Tri-State anyway. Tried the net but not got anywhere yet! Cheers
> I have been trying today to use one Analogue Input on my PIC for > multiple Analogue Inputs - A sort of Multiplexing? google 'analog multiplexer', like http://www.semiconductors.philips.com/pip/74HCT4051.html > Has anyone ever done this before? I know there are a good number of > AD pins on the PIC16F877, but i need the IO! Maybe you should use expanders on the digital I/O? Microchip has nice 16-pin SPI or I2C expanders. Or use a (bunch of) lowly 74HC595. Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products docent Hogeschool van Utrecht: www.voti.nl/hvu
74HC4051 8 to 1 analog multiplexer. Lets you use 3 pins to multiples 8 analog inputs or outputs. Since this sounds like a controlled environment, you don't need to look at more expensive precision multiplexers with diode protection, 40V inputs, or the like (Micrel, Analog device, National, etc.). Your pot/diode idea would probably work if you put in a high value (1Meg) PULLDOWN resistor on the A/D pin to pull out the charge left from the last input you scanned. You'd also want to throw a 100pF cap on the pin to give a good low impedance for the A/D (read the A/D section of the manual on the requirement for low Z on this pin. Putting a diode there makes it high impedance. Robert Paul wrote: > Hi. > > I have been trying today to use one Analogue Input on my PIC for > multiple Analogue Inputs - A sort of Multiplexing? Anyway, my first > idea was to use other outputs from the PIC to supply the +5V on each > pot, so my process was Turn on C0, sample AD, Turn on C1, sample AD > etc etc. My problem is connecting all the outputs into one, i > thought a diode on each wiper would work - but i get strange results > when i display the conversion values on the LCD. Now i'm sure my > problem lies with the diodes. Is there such a thing as a Analogue > Tri-State IC? Cause i think this might work? > > Has anyone ever done this before? I know there are a good number of > AD pins on the PIC16F877, but i need the IO! I know it will take a > Output per AD but i think i will have to expand using Tri-State > anyway. > > Tried the net but not got anywhere yet! > > Cheers > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > Yahoo! Groups Links > > > > > >
The 4051 (CD or 74HC) is very commonly used for this purpose. The diode are going to give you a pretty nonlinear response at the bottom of the pot due to the diode knee. If you are driving the high side of the pot with pins, why not tie the high side of the pot to +5V (sparing the output pins) and use more analog input pins (taking advantage of the equivalent of the 4051 inside the pic!). Another concern in driving the high side of the pot with an output is that the output will not go all the way to +5V because of the current drawn by the pot. If you're using +5V as the A/D reference, a full pot will not read full on the A/D. But, if you tie the high side of the pot directly to +5V, it will. I typically use 10k pots in this application and do not feel capacitors across the inputs are necessary. You just have to set the Taq time as appropriate to allow the PIC analog input to get to the correct value. Harold (the ideal design has zero parts) > 74HC4051 8 to 1 analog multiplexer. Lets you use 3 pins to > multiples 8 analog inputs or outputs. > > Since this sounds like a controlled environment, you don't > need to look at more expensive precision multiplexers with > diode protection, 40V inputs, or the like (Micrel, Analog device, > National, etc.). > > Your pot/diode idea would probably work if you put in a > high value (1Meg) PULLDOWN resistor on the A/D pin to > pull out the charge left from the last input you scanned. > You'd also want to throw a 100pF cap on the pin to give a > good low impedance for the A/D (read the A/D section of the > manual on the requirement for low Z on this pin. Putting a diode > there makes it high impedance. > > Robert > > > Paul wrote: > >> Hi. >> >> I have been trying today to use one Analogue Input on my PIC for >> multiple Analogue Inputs - A sort of Multiplexing? Anyway, my first >> idea was to use other outputs from the PIC to supply the +5V on each >> pot, so my process was Turn on C0, sample AD, Turn on C1, sample AD >> etc etc. My problem is connecting all the outputs into one, i >> thought a diode on each wiper would work - but i get strange results >> when i display the conversion values on the LCD. Now i'm sure my >> problem lies with the diodes. Is there such a thing as a Analogue >> Tri-State IC? Cause i think this might work? >> >> Has anyone ever done this before? I know there are a good number of >> AD pins on the PIC16F877, but i need the IO! I know it will take a >> Output per AD but i think i will have to expand using Tri-State >> anyway. >> >> Tried the net but not got anywhere yet! >> >> Cheers >> >> >> >> >> >> >> to unsubscribe, go to http://www.yahoogroups.com and follow the >> instructions >> Yahoo! Groups Links >> >> >> >> >> >> > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > instructions > Yahoo! Groups Links > > > > > > > > -- FCC Rules Updated Daily at http://www.hallikainen.com
From: Harold HallikainenTo: p...@yahoogroups.comSent: Wednesday, March 22, 2006 3:34 PMSubject: Re: [piclist] Analogue ExpanderThe 4051 (CD or 74HC) is very commonly used for this purpose. The diode
are going to give you a pretty nonlinear response at the bottom of the pot
due to the diode knee. If you are driving the high side of the pot with
pins, why not tie the high side of the pot to +5V (sparing the output
pins) and use more analog input pins (taking advantage of the equivalent
of the 4051 inside the pic!). Another concern in driving the high side of
the pot with an output is that the output will not go all the way to +5V
because of the current drawn by the pot. If you're using +5V as the A/D
reference, a full pot will not read full on the A/D. But, if you tie the
high side of the pot directly to +5V, it will.
I typically use 10k pots in this application and do not feel capacitors
across the inputs are necessary. You just have to set the Taq time as
appropriate to allow the PIC analog input to get to the correct value.
Harold
(the ideal design has zero parts)> 74HC4051 8 to 1 analog multiplexer. Lets you use 3 pins to
> multiples 8 analog inputs or outputs.
>
> Since this sounds like a controlled environment, you don't
> need to look at more expensive precision multiplexers with
> diode protection, 40V inputs, or the like (Micrel, Analog device,
> National, etc.).
>
> Your pot/diode idea would probably work if you put in a
> high value (1Meg) PULLDOWN resistor on the A/D pin to
> pull out the charge left from the last input you scanned.
> You'd also want to throw a 100pF cap on the pin to give a
> good low impedance for the A/D (read the A/D section of the
> manual on the requirement for low Z on this pin. Putting a diode
> there makes it high impedance.
>
> Robert> Paul wrote:
>
>> Hi.
>>
>> I have been trying today to use one Analogue Input on my PIC for
>> multiple Analogue Inputs - A sort of Multiplexing? Anyway, my first
>> idea was to use other outputs from the PIC to supply the +5V on each
>> pot, so my process was Turn on C0, sample AD, Turn on C1, sample AD
>> etc etc. My problem is connecting all the outputs into one, i
>> thought a diode on each wiper would work - but i get strange results
>> when i display the conversion values on the LCD. Now i'm sure my
>> problem lies with the diodes. Is there such a thing as a Analogue
>> Tri-State IC? Cause i think this might work?
>>
>> Has anyone ever done this before? I know there are a good number of
>> AD pins on the PIC16F877, but i need the IO! I know it will take a
>> Output per AD but i think i will have to expand using Tri-State
>> anyway.
>>
>> Tried the net but not got anywhere yet!
>>
>> Cheers
>>
>>
>>
>>
>>
>>
>> to unsubscribe, go to http://www.yahoogroups.com and follow the
>> instructions
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
> Yahoo! Groups Links
--
FCC Rules Updated Daily at http://www.hallikainen.com
to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
YAHOO! GROUPS LINKS
This message has been processed by Firetrust Benign.
Take a look at the midibox hardware project... http://ucapps.de they use 3 digital io pins to drive 8 4051's (AIN board) to get 64 analog inputs to either 16877 or 18452. simple and elegant! good luck gb
HI Chris, Why not multiplex the OTHER digital pins? You could use a crosspoint switch. But it would require an address! Use a 2nd PIC, and SPI or I2C to read it. Just reading pots? Use digital pots. I2C pots. Alan KM6VV > > Hi. > > I have been trying today to use one Analogue Input on my PIC for > multiple Analogue Inputs - A sort of Multiplexing? Anyway, my first > idea was to use other outputs from the PIC to supply the +5V on each > pot, so my process was Turn on C0, sample AD, Turn on C1, sample AD > etc etc. My problem is connecting all the outputs into one, i > thought a diode on each wiper would work - but i get strange results > when i display the conversion values on the LCD. Now i'm sure my > problem lies with the diodes. Is there such a thing as a Analogue > Tri-State IC? Cause i think this might work? > > Has anyone ever done this before? I know there are a good number of > AD pins on the PIC16F877, but i need the IO! I know it will take a > Output per AD but i think i will have to expand using Tri-State > anyway. > > Tried the net but not got anywhere yet! > > Cheers
----- Original Message -----From: PaulTo: p...@yahoogroups.comSent: Wednesday, March 22, 2006 10:05 PMSubject: [piclist] Analogue ExpanderHi.
I have been trying today to use one Analogue Input on my PIC for
multiple Analogue Inputs - A sort of Multiplexing? Anyway, my first
idea was to use other outputs from the PIC to supply the +5V on each
pot, so my process was Turn on C0, sample AD, Turn on C1, sample AD
etc etc. My problem is connecting all the outputs into one, i
thought a diode on each wiper would work - but i get strange results
when i display the conversion values on the LCD. Now i'm sure my
problem lies with the diodes. Is there such a thing as a Analogue
Tri-State IC? Cause i think this might work?
Has anyone ever done this before? I know there are a good number of
AD pins on the PIC16F877, but i need the IO! I know it will take a
Output per AD but i think i will have to expand using Tri-State
anyway.
Tried the net but not got anywhere yet!
Cheers