Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

16F88 ADC draws 5 mA?

Status
Not open for further replies.

ClydeCrashKop

Well-Known Member
Most Helpful Member
I want a 16F88 ADC to read the position of a potentiometer but the ADC draws 5 mA. I wanted to use a 100K pot but would settle for 5K. Even 5K gets distorted, almost full on before it reads 512 at 2.5 volts. A 1K resistor directly from the +5 volt supply to AN0 gets pulled down to 2.5 volts and reads 512 on the ADC.
I'm more of a digital guy. How do I make it read 512 near the middle of a pot's movement? I thought it would be like a comparator and draw almost nothing.
 
I think you may have the "digital" on for the port with the ADC. All (most) of the pins are multi- function. Somewhere there are bits to set that will disable the I/O part of the port. It sounds like the digital is trying to pull down while your pot is pulling up.
 
Yes, you've got it set wrong somewhere - sounds like you've connected to a pin set as a digital output.

The ADC's take very little current, BUT you need a lowish source impedance in order to charge the internal sample and hold capacitor. The datasheet gives the maximum recommended source impedance, although if you're only using one ADC pin (so not switching between multiple ones) you can happily use a much higher source impedance.
 
Thanks Guys
It's working fine now.
 
Yes, you've got it set wrong somewhere - sounds like you've connected to a pin set as a digital output.

The ADC's take very little current, BUT you need a lowish source impedance in order to charge the internal sample and hold capacitor. The datasheet gives the maximum recommended source impedance, although if you're only using one ADC pin (so not switching between multiple ones) you can happily use a much higher source impedance.

@Nigel...
I have a related question....16f886 this time....If I enable an adc channel and I can wait perhaps 0.25 sec before taking the sample what kind of impedance can I get away with? 100K?
 
@Nigel...
I have a related question....16f886 this time....If I enable an adc channel and I can wait perhaps 0.25 sec before taking the sample what kind of impedance can I get away with? 100K?

Just try it and see, set two channels up to display the incoming voltages, and feed each input from a resistor, one fed from the +ve rail, the other from 0V. One should read 5V, the other 0V - now increase the resistor values until the 5V one reads lower, and the 0V one reads higher. Once you get to this stage, try increasing the delay after switching channels until you get back to 5V and zero again.
 
To help the next person please tell us what you did to make it work.

(hehe) I didn't want to admit what I did wrong.
After your suggestions, I read the data sheet and found that I hadn't set ANSEL. I set AN0 to analog. That didn't help, still drawing 5 mA. I think they are all analog by default anyway.
When I bought the PICkit 3 I also got a DM164120-4 demo board with a potentiometer on it. I thought the potentiometer was something I could hook up later. So having problems, I decided to hook up their potentiometer and see if it worked any better. So I followed the traces. It had power and ground. The output has a 1K resistor and then goes right to AN0! The potentiometer WAS hooked up and was turned all the way to ground. So I removed my pot and adjusted theirs and it works great. That explains why my 1K resistor to +5V brought the AN0 pin to 2.5V.
The potentiometer output also has 104 capacitor to ground. Is that something I should do in the future?
 
Status
Not open for further replies.

Latest threads

Back
Top