Searching \ for 'ADC Problem - PIC16C74' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/ios.htm?key=adc
Search entire site for: 'ADC Problem - PIC16C74'.

Truncated match.
PICList Thread
'ADC Problem - PIC16C74'
1998\09\02@071120 by Jason Bent

flavicon
picon face
Hi all

I have a little problem that is driving me mad. I am developing a
piece of kit to control an X-Ray spectrometer for student teaching
use. A PIC16C74 is used to control / measure the following:

1. Stepper motor - Drives carriage arm containing geiger tube
2. Foil shutter - Moves a filter in and out of the X-ray beam line
3. Counter - Counts events from the geiger tube
4. Current monitor - Measures X-Ray tube current (0-102uA in 0.4uA)

All of this is controlled from a PC running a VB app, via an RS232
link at 1200 baud, 8 data, no parity, 1 stop.

1 through 3 work fine, 4 is proving to be a
problem.

A 1.24v reference is connected to RA3 and an appropriately scaled
voltage is applied to RA0 (0-1.24v = 0 to 102uA). If I configure the
PIC for internal ref (Vcc = 5v) then the program works but obviously
returns a the wrong value. Changing the ref to external causes the
ADC to return $FF every time. Closer observation indicates that the
actual ref the PIC is using is very close to ground, ie I can get
data out with tiny voltageson the RA0 pin.

Pins RA1 and RA2 also behave in exactly the same way. With the device
configured for internal ref again I could read the 1.24v on the RA3
pin and get the correct answer, based on the 5v supply ref.

Investigating microchips web site pulled up a similar problem where
if the ADC pins are configured as digital then the ref is connected
to ground. My inputs are not configured as digital, I checked, even
tried configuring port E as analog as well, it made no difference.
Same behaviour is seen with three devices, 2 EPROM and 1 OTP (what a
waste)

Anybody have any ideas, or sample code that uses an external ref on a
16C74

T.I.A.
Jason.


______________________________________________________________________

A conclusion is simply the point where you got tired of thinking.


Phone +44 (0)161 275 4094

spam_OUTJason.BentTakeThisOuTspamman.ac.uk

I am a technician in the Dept. of Physics & Astronomy
at Manchester University

1998\09\02@094233 by Mike Keitz

picon face
On Wed, 2 Sep 1998 11:38:00 BST Jason Bent <.....mbcjabtKILLspamspam@spam@MAIL1.MCC.AC.UK>
writes:

>
>A 1.24v reference is connected to RA3 and an appropriately scaled
>voltage is applied to RA0 (0-1.24v = 0 to 102uA). If I configure the
>PIC for internal ref (Vcc = 5v) then the program works but obviously
>returns a the wrong value. Changing the ref to external causes the
>ADC to return $FF every time. Closer observation indicates that the
>actual ref the PIC is using is very close to ground, ie I can get
>data out with tiny voltageson the RA0 pin.

The reference needs to be 3V or more for the converter to work properly
(an exact figure is in the back of the data sheet).  Change your input
scaling so full scale is about 4 or 5V and also amplify up the reference.
But the reference voltage can't be more than Vdd.




_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\09\02@104249 by Chip Weller

flavicon
face
Jason Bent wrote:


>Hi all
<snipped a bunch>
>A 1.24v reference is connected to RA3 and an appropriately scaled
>voltage is applied to RA0 (0-1.24v = 0 to 102uA). If I configure the
>PIC for internal ref (Vcc = 5v) then the program works but obviously
>returns a the wrong value. Changing the ref to external causes the
>ADC to return $FF every time. Closer observation indicates that the
>actual ref the PIC is using is very close to ground, ie I can get
>data out with tiny voltageson the RA0 pin.
<more snipped>

My first thought is you don't have the RA3 input configured as the
reference. Double check that. Also since 1.24 is well below the 3V spec
for the ADC I would try using a +5V reference to see if you get the same
as using the internal reference. If you do then probably you will need a
high reference and will need to scale up your input. (My general
understanding is the lower reference voltage just means you will not
meet the ADC published specs for resolution.)

The external reference does need to be able to source some current, I
think up to 1mA peaks. Make sure whatever reference you are using can
handle this type of current. I have used external references on several
PICs including the '74 with no problems, so it is very doable.

Chip Weller

1998\09\03@102316 by Sean RS Costall

flavicon
face
Just as a note to this: when the 'C74 was first released, we had
preliminary data sheets that listed the reference voltage as 3.0V
minimum.  Since this struck us as exceedingly stupid on a device that
could run down to 2.5V, we called Mchip to find out what was up.

We were told (at the time) that the preliminary specs were wrong, and the
reference voltage could be anything we wanted.  Fortunately for us we
ended up using a 2.5V reference.

Three years later we ended up trying to use a 1.2V reference.  Guess what
- it didn't work.  Mchip now says that the reference has to be at least 2.5V.

Hope this clears up something for people who were similarily misinformed.

--------------------------------------------------------------
-               Sean R.S. Costall, P.Eng                     -
-                   BW Research Ltd.                         -
-              #242  3030-3rd Avenue N.E.                    -
-                 Calgary, AB  T2A 6T7                       -
--------------------------------------------------------------

1998\09\03@110620 by Chip Weller
flavicon
face
Sean RS Costall wrote:


>Just as a note to this: when the 'C74 was first released, we had
>preliminary data sheets that listed the reference voltage as 3.0V
>minimum.  Since this struck us as exceedingly stupid on a device that
>could run down to 2.5V, we called Mchip to find out what was up.
>
>We were told (at the time) that the preliminary specs were wrong, and
the
>reference voltage could be anything we wanted.  Fortunately for us we
>ended up using a 2.5V reference.
>
>Three years later we ended up trying to use a 1.2V reference.  Guess
what
>- it didn't work.  Mchip now says that the reference has to be at least
2.5V.
>
>Hope this clears up something for people who were similarily
misinformed.


I have used the ADC at references of 2.5V before, however based on the
message from Jason Bent I hooked up a variable reference to see what
happens. When I got down to Vref of about 1.65V the output of the ADC
started to act very non-linear. I expect this voltage will vary with
Vcc, temperature, and the batch. I always assumed the reason for the
higher reference was just to meet the linearity and absolute error
specs. It appears there are other issues also.

By the way the most recent (1997 dated) PIC16C7X data sheet still claims
a 3.0V minimum reference, which is not really possible running from a
regulated 3.0V (+/-5%)supply *even* if you use a Vcc reference (only
useful if you have ratiometric inputs).


Chip Weller.

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