DEFINE ADC_CLOCK for 16F PICs


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Charles Linquis View Post
    The thing most people ignore is the quality of their reference and dividers. They try to get 10-12 bits (or more) of resolution when using Vcc as the reference voltage. That just doesn't work. We use an LM4120-4096 (4.096V) reference with 0.2% accuracy. All voltage dividers use 0.1% resistors.
    If the thing you are reading also operates with a Fixed Reference, then sure ... you should use a reference on the A/D.

    But most things are "Ratiometric" and a fixed reference will transfer any ripple on the power supply straight into your A/D readings. And regulators like 7805's that can't keep a constant voltage will make the readings wander all over the place.

    References have their place, but I believe you should not use them unless the right conditions are met.

    0.1% resistors ... gotta agree with that though.
    <br>
    DT

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    The power supply voltages I have to read are never ratiometric.
    Charles Linquist

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Exactly. Perfect example.

    They are their own power supplies.
    If VDD to the PIC changes, the other voltages don't necessarily change.
    So there is no Ratiometric relationship, and a Fixed reference is required (like you have).

    But when reading POTs, many pressure transducers, or any sensor that is resistive in nature, it will likely be ratiometric and a Fixed reference will distort the readings.

    I guess I just thought that this was a bit limiting.
    They try to get 10-12 bits (or more) of resolution when using Vcc as the reference voltage. That just doesn't work.
    It's quite possible to get 12-bits or more without a Fixed reference.
    If you are reading a Ratiometric device.

    Fortunately, whether or not a reference is used can be changed in the ADCON1 register, so even within the same project you might have some Fixed or unreferenced sources, and other ratiometric devices that change with VDD.

    If you know the difference, Use the reference for the fixed sources, and no reference (VDD) for the ratiometric ones.
    DT

  4. #4
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I don't think I did a very good job of explaining myself.

    I almost always have to read a 4 output EXTERNAL power supply (cPCI, VPX, uTCA or VME). I have to make certain that the voltages are within tolerance. I have to be a voltmeter, and have to be very accurate - regardless of what the PIC supply is.
    Charles Linquist

  5. #5
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    Thanks, Darrel--I had already noted those two statement changes, but I appreciate the reminder.

    I'm looking at 2 pots and the output of 5 op amps, but it isn't a problem if the values wander a little. (Probably I don't need 10 bits, either . . . !)

    Thanks for the link, too. I'll take a longer look when I next treat myself to a break.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  6. #6
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    Part of what confused me on this matter is the statment in my PBP manual under "ADCIN":

    <b>ADC_SAMPLEUS is the number of microseconds the program waits between setting the <i>Channel</i> and starting the analog to digital conversion. This is the sampling time.</b>

    Comments, anyone?
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  7. #7
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    The A/D converters have a FET switch on each input. When you change the channel, the gates on those FETs toggle. There is a finite capacitance between the gate and the drain and source of the FET, so the toggling of the gate signal causes what is called charge injection into the other pins. This causes a glitch at the input and output of the FET switch. If you read the A/D too quickly after you change the channel, you will get an inaccurate reading due to voltage spike caused by the charge injection. The time it takes for this excess charge to bleed away is dependent on your source impedance. If your source is the output of an op-amp (zero ohm source), then you can switch channels and start conversion within 3uSec. If your source is 10K then you should wait at least 11uSec after changing channels before you start a conversion. If you don't wait long enough, your accuracy will suffer.
    Charles Linquist

Similar Threads

  1. RF Modules
    By tonyfelloni in forum mel PIC BASIC Pro
    Replies: 44
    Last Post: - 26th June 2010, 17:42
  2. PIC16F877A analog problem
    By DeViLa_Q8 in forum mel PIC BASIC
    Replies: 0
    Last Post: - 30th July 2009, 20:19
  3. RX TX modules - intermitent communication
    By ruijc in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 11th June 2009, 00:13
  4. PIC HSERIN problem
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 20th July 2008, 11:08
  5. Replies: 8
    Last Post: - 17th September 2006, 17:46

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts