Searching \ for 'ADC Input Levels' in subject line. ()
Help us get a faster server
Search entire site for: 'ADC Input Levels'.

Truncated match.
1998\05\18@160852 by

Either I'm not seeing it, or Microchip doesn't specify it, but I have a
question that perhaps somebody in-the-know can answer (maybe by experience).

I need to get an accurate measurement of voltage which may range from 30V
down to about 3V.  What I was thinking of doing was using a resistor ladder
with multiple taps going to the various ADC inputs on the PIC.  I would
start my measurements on the greatest division (ANx in the picture below)
and if the input voltage was sufficiently low that I could use the next
higher division (ANn-1), I would do that, repeating until I had the
smallest V/div on the ADC (best resolution).

Question is, do the ADC inputs have diode protection like the digital
inputs?  Will my scheme work properly?

Concept:

3-30V+
|
|
R1
|
+-----> AN0 input
|
|
R2
|
|
+-----> AN1 input
|
|
R3
|
|
+-----> AN2 input
|
|
etc.
|
|
+-----> ANx input
|
|
-----
GND

Thanks.

Andy

==================================================================
Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
==================================================================

> From: Andy Kunz <mtdesignFAST.NET>
> snip
> Question is, do the ADC inputs have diode protection like the digital
> inputs?  Will my scheme work properly?

I think the analog inputs has protection diodes in it.  It is stated in
the datasheet that RA0:RA5 had it, so your scheme may not work because
the point between R1 and R2 (AN0) will stay at 5.7V.

3-30V ---+-R1-+-->AN0
|    |
|    R2
|    |
|    *
|
+-R3-+-->AN1
|    |
|    R4
|    |
|    *
|
.
.
.
|
+-R?-+-->ANx
|
R?
|
*

This may work if the impedance of 3-30V output is low enough.
If not, an op-amp buffer or setting R1, R3 (resistors in
series) to a high value may help. But this solution uses 2X

Rgds,

Reggie

>Either I'm not seeing it, or Microchip doesn't specify it, but I have a
>question that perhaps somebody in-the-know can answer (maybe by experience).

snip

>  Will my scheme work properly?

No.  But you can make it work quite simply: leave the input resistor as a
fairly high value, then switch in different values of resistors on the
bottom end of the divider.  The input to the a/d never exceeds maximum value
except when while determining what the voltage is.  Note: you can use either
straight digital outputs (LO or tristate only, never HI) or FETs *or* you
can use analog inputs turned into digital outputs (again, LO or tristate
that the diginal inputs are disabled (no excessive currents due to biasing
the input in the linear region) *and* you can still use bsf / bcf on other
digital pins on that port: you always want the output driver for those
analog outputs to be Lo (any RMW instructions simply ensure that those pins
stay Lo).

Concept:

3-30V+
|
|
R1
|
+------+------+--------> AN0 input
|      |      |
|      |      |
R2     R3     R4
|      |      |
|      |      |
D0     D1     D2
*or*
AN1    AN2    AN3

dwayne

Dwayne Reid   <dwaynerplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, Alberta, CANADA
(403) 489-3199 voice     (403) 487-6397 fax

On Mon, 18 May 1998 14:22:16 -0400 Andy Kunz <mtdesignFAST.NET> writes:
{Quote hidden}

This isn't going to work.  When the open-circuit voltage for the AN0
input rises above Vdd, the protection diode will clamp it.  Then voltages
at the rest of the taps will be wrong.

Why not just divide the input voltage by 5.4 and subtract 0.55V,
converting 3-30 V to 0 - 5V?  If you want an adjustable divider for
finer steps on the lower voltages, there are a several ways to go:  Use
seperate voltage dividers so the output of one being clamped doesn't
affect the other. Or use analog switches to change resistors.  PIC pins
make reasonable analog switches to ground or Vdd by setting to input for
open and output for closed.

For example

|
--R2---PIC digital switch

With the "PIC digital switch" pin set for input, no current can flow
through R2 so the analog input is essentially Vin.  Voltages from 0-Vdd
can be measured.  Changing the PIC digital switch pin to output zero will
form a voltage divider of R1 and R2, so higher input voltages can be
measured.  Outputting a one would allow measuring negative voltages, but
only with the high range.

It's probably a good idea to back the PIC protection diodes with external
diodes especially if the circuit will be taking an analog reading from
one pin while another one has a voltage higher than Vdd.

_____________________________________________________________________
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

>
>3-30V ---+-R1-+-->AN0
>         |    |
>         |    R2
>         |    |
>         |    *

>This may work if the impedance of 3-30V output is low enough.

It should be fine - it's a NiCd battery pack.

I was trying to cut down the parts count - it has to fit on a 1.2x1.3 board
with lots of other stuff.

Thanks - I'll think on this method more.

Andy

==================================================================
Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
==================================================================

>       3-30V+
>         |
>         |
>         R1
>         |
>         +------+------+--------> AN0 input
>         |      |      |
>         |      |      |
>         R2     R3     R4
>         |      |      |
>         |      |      |
>        AN1    AN2    AN3
>

Thanks, Dwayne.

That's a good idea!  It adds a little capacitance, but that's just sampling
time.  I like that better than my idea anyway.

Also, it let's me do neat things with measuring, since I can then connect
multiple ANx's as grounds, giving a much broader range of resolutions.

Andy

==================================================================
Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
==================================================================

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...