Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Ads

Discussion Groups

Discussion Groups | Piclist | Analogue Expander

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.

Analogue Expander - Paul - Mar 22 18:05:00 2006

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
	


(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )


RE: Analogue Expander - Wouter van Ooijen - Mar 22 18:09:00 2006

> 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
	


(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Analogue Expander - Robert Rolf - Mar 22 18:25:00 2006

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



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Analogue Expander - Harold Hallikainen - Mar 22 18:34:00 2006

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



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Analogue Expander - JCullins - Mar 22 18:53:00 2006

Another approach is to use digital expander to get the I/O you need and use
the analog inputs on the PIC16f877.
Jim
 
 
----- Original Message -----
From: Harold Hallikainen
To: p...@yahoogroups.com
Sent: Wednesday, March 22, 2006 3:34 PM
Subject: Re: [piclist] Analogue Expander

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


to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

YAHOO! GROUPS LINKS

  •  



This message has been processed by Firetrust Benign.




(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Analogue Expander - waldo195677043 - Mar 22 19:10:00 2006

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
	


(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

RE: Analogue Expander - Alan Marconett - Mar 22 19:12:00 2006

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
	


(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Analogue Expander - Paul_Lav - Mar 23 17:13:00 2006

Hi All,
 
Thanks for all the replies. I have ordered a 4051 IC to try out, only 31p!
Just one quick qu, the IC needs a Negative Suppply for if i am using a Negative Analogue Signal - I am not, do i connect it the GND or leave it floating?
 
 
 
Cheers,
Paul
----- Original Message -----
From: Paul
To: p...@yahoogroups.com
Sent: Wednesday, March 22, 2006 10:05 PM
Subject: [piclist] Analogue Expander

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





(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )