08M ADC Input impedence

Jeremy Leach

Senior Member
I want to understand the input impedence of the ADC inputs of an 08M, because I've got another low-power idea.

If the ADC isn't being read, then is the input impedence very high, just like any other digital input?

The datasheet for PIC12F68 says that recommended impedance of the circuit feeding the ADC input is 10KOhms.

It also says that the leakage current into input pins is 1-5uA.

I think this means that for an ADC input, when it's being used to convert A to D then the input impedence is lower, but outside this time it's very high? Is this right??
 

Dippy

Moderator
I'm guessing here a bit, but I assume the PICAXE interpreter, when seeing READADC, sets the input to ADC, does its job, then sets it back to Digital. (Others can drivel on about ANSEls and TRISs if they want to, I'll do my bit in English)

So, perhaps the impedance goes 'lower' for the duration of the ADC command then resumes its digital impedance value as per data sheet. Just a guess.

IN FACT, on second reading, exactly as you said Jeremy. Doh! And you said it so much more nicely! Its the hot weather... I'm going to have a little lie down.
 

Michael 2727

Senior Member
I heard 38C was the forecast for over there today.
Bah humbug, it can be 36-38 straight for a month down here, drink beer and fire up the BBQ. Least you probably don't have the flies
to go with it like us ~ ;o(
 

whizzer

Senior Member
Hi guys,
I’ve got a slightly different take on this.

I think Microchip are saying that <i>the impedance of the source </i> should be limited to a maximum of 10K. (Maybe it&#8217;s the case that for sources impedances above 10K, conversion accuracy will suffer).

Edited by - whizzer on 19/07/2006 11:57:06
 

xstamp

Senior Member
Whizzer,

You are correct, in that the ADC error can increase with source impedance until it approaches 0.1% of full scale for a 10-bit conversion. Although 10 K Ohm is quoted as a maximum but much will depend on conversion time (PICAXE clock speed), temperature and general noise levels.

PS. Its getting too hot here near London !!!
 

hippy

Ex-Staff (retired)
I did ask a similar question a while ago but didn't get any answers; only Technical can give a definitive answer.

There are two possible scenarios (1) as you and BeanieBots suggests, analaogue inputs could be made analogue when READADC is executed and then return to digital inputs when the command completes, or (2) they could be made analogue and stay that way until some explicit command ( INPUT, COUNT, PULSIN etc ) makes them digital inputs again.

The reason behind my question was, what to do in program initialisation when pins start off as digital inputs; is it worth issuing a READADC for analogue pins to make them analogue, or is that pointless because they automatically return to digital afterwards ?

I'm not sure what you are hoping to achieve Jeremy, but it reads like you are hoping they will return to digital and high impedance to reduce current consumption ?

That may not work, and there are explicit warnings about this in the 16F88 (18X) datasheet in section 12.8 - &quot;Analog levels on any pin that is defined as a digital input, may cause the input buffer to consume current out of the device specification&quot;.

That to me reads as operating a PICAXE with analogue inputs connected with pins not configured for analogue not only won't minimise current consumption but could have adverse effects.

If READADC does return pins to digital inputs then this could create a potentially adverse condition, and that could be said to be a potentially 'inherent design flaw' in the PICAXE Firmware, but I don't want to be scare-mongering here as I'm not in possession of the full facts.

On the 16F88, the datasheet also says, &quot;When reading the Port register, all pins configured as analog input channels will read as cleared (a low level)&quot;. If the inputs stay as analogue after a READADC, then a 'PEEK $05,var' ( read PORTA ) should show that channel low, even if pulled up to +V, so that may be a way to determine what is happening in the Firmware ( I've no 18X to hand to test with ).

The behaviour may vary across PICAXE types, and almost certainly for the 08/18 which use comparators rather than ADC.

Edited by - hippy on 19/07/2006 12:23:59
 

Jeremy Leach

Senior Member
Dippy ...I was also thinking the ADC is only brought into play when requested. (and yes, it's flipping hot for the UK!)

Whizzer ...yes I think they do mean the source, but I took this to mean that the ADC had a similar impedence too. Only guessing though.


All I'm trying to determine is whether the impedence of inputs that allow ADC are always less than the pure digital inputs. I don't think so - I think it's only when the ADCs are being used.

Understanding all this may help get optimum designs.

Edited by - jeremy leach on 19/07/2006 12:25:18
 

Michael 2727

Senior Member
I have never been satisfied with any explanation for MAX impedence on an ADC
that I have seen here yet.
For the simple reason an LDR.
An LDR can be either 500R - 3K at one end of the scale
and 1 - 20Meg at the other.
Now if the max impedance for a reliable ADC
measurement was only 10K an LDR should not work.
I don't believe everything I read in data sheets either.
Does the leakage current 1-5&#181;A give you a hint.
Think of an analogue meter on high Volts range.
Unless someone can smack me in the head with a 100 page folder of concrete data I am
keeping an open mind.
I know a few would like to use just the concrete, but hey I've been there before and
probably will in the future also.

Edited by - Michael 2727 on 19/07/2006 12:23:57
 

hippy

Ex-Staff (retired)
Michael, as I understand it, the source impedence affects the ADC because this has an effect upon charging the sample and hold capacitor and changes the characteristics of the ADC block. Not necessarily by a lot, but it may result in inaccurate readings and in increased non-linearity. That isn't necessarily a problem when measuring something which doesn't need its absolute voltage determined accurately, such as an LDR, but does become important in other cases.

In the PICmicro datasheets I've read I don't recall there having ever been an absolute maximum source impedence stated, but a maximum is &quot;recommended&quot;. I suspect that keeping below the recommended maximum means all devices of the same type should return the same results, whereas above that, each device may return slightly different results. For a one-off project which can be recalibrated if the PICAXE chip is replaced with another it's not a problem, but it could be on a production run.
 

BeanieBots

Moderator
Bottom line, the input impedance is a function of clock speed and how often the input is read. When the SOURCE is below 10k, these effects become insignificant.
The ACTUAL impedance averaged over time is very high.
How significant this is, depends on what exactly it is you have in mind.
As a test, supply the input with a high impedance voltage. Add a cap to remove instantaneous fluctuations. Read the input once. Take a note, then read the input in a tight loop and take note. Then change the clock speed and repeat.
If the variation is within your desired tollerance, then your source impedance is fine.
 

bobrayner

Member
Surely &quot;1 - 5uA&quot; says it all. 5V, 5uA, 1M0.
If in doubt measure it. Apply say 5V to the input in question via a high value pot (5M0?)connected as a rheostat. Adjust the pot until half the applied voltage appears at the pot/pin junction. Measure the pot value and voila! the pin input impedance.
1M0 sounds ok if a max source impedance is quoted as 10k. This is 100th of the input Z which is acceptable. Much higher and errors creep in as can be confirmed when you do the voltage divider sums. When your source impedance approaches the input impedance the error will be 50% when the two impedances are equal.
cheers BobR
 

BeanieBots

Moderator
Not sure about PIC micros, but normally, when an input current is quoted as well/instead of an ohmic value for an input impedance, it usually means that the current is CONSTANT over any input voltage. This is because inputs often use a constant current to bias the input transistors in a circuit known as a &quot;current mirror&quot;.
Probably not the case for an ADC input on a PIC but certainly is the case for an op-amp.
 

Dippy

Moderator
As Bob says: Measure it.
Jeremy, dig out your collection of metering devices and let us know in avrious scenarios.
Then this can be put to bed.
 
Top