Adc Ref. V.


Closed Thread
Results 1 to 7 of 7

Thread: Adc Ref. V.

  1. #1
    GEEZER's Avatar
    GEEZER Guest

    Default Adc Ref. V.

    I would like to read voltages from 0 to .5 volts (0 to 500 millivolts). To get highest resolution I would like to set the reference just above .5 volts.

    I understand that I can use vss, vdd, a couple of the porta pins, or any combination to set the reference.

    Is there any way to set the reference very low without giving up one of the porta adc's. I need all 8 of them. The pic is a 16f877a.

    Also, I have heard something about capacitors to keep the adc's from interaction error. Information on this will help me too.

    Your knowledge will be appreciated.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    The ADC section in the Datasheet for your PIC will tell you what you can and can't do with references. If you want to change the reference away from Vdd, then you will need to lose a pin for that task (see ADCON1 Register PCFG configuration 0001).

    There is only one ADC on the PIC... it is however multiplexed to several pins. Providing you allow enough settling time for the sampling capacitor to charge before initiating a conversion (50uS is a good starting point), you will have no problem switching between multiple inputs.

  3. #3
    Join Date
    Apr 2005
    Posts
    96


    Did you find this post helpful? Yes | No

    Default Multiple ADCIn

    Melanie,

    I guess this is a little off topic, but you mentioned 50us between reading in different a/d values on porta. Are you basically saying we should not attempt to do....

    ADCIN 1, var1
    ADCIN 2, var2
    ADCIN 3, var3

    Are you saying we need at least 50us between differnt ADCIN commands or wierd issues may result?

    Thanks for clarifying

  4. #4
    Warrier's Avatar
    Warrier Guest


    Did you find this post helpful? Yes | No

    Default

    Internally, the sampling switch and the channel multiplexers are CMOS switches and they present an ON resistance that is a linear function of supply voltage. (it can vary from about 5kohm to 10kohm for Vdd ranging from 5V to about 3V). When a signal is applied to any pin, the internal holding capacitor has to charge to the input voltage through this resistor. With a 10bit ADC, you need the holding capacitor to be about 0.1% of the applied voltage to get accurate results.

    You also need to make sure that any external amplifier also settles down to this accuracy before you let the ADC perform the digitization. Hopefully you are not increasing this value outside the PIC using any resistors. The acquision time thus is close to about 20usec at 5V with a 10k signal(source) resistance (impedance). To allow for other switches to settle, Ms. Newman is suggesting 50usec.

    No, you don't need to add a Pauseus 50 if you have already defined DEFINE ADC_SAMPLEUS 50 at the header. This keeps the program waiting for 50usec between setting the selected channel and starting the AD conversion.

    When you set your external reference to 500mV keep in mind that your LSB is only 500microvolt. The ENOB of the PIC ADC is only 9.5bits even with severly bandlimited signal. Glitches when operating internal switches and amplifier settling time may all be comaprable to this value. Keeping signal path clean also becomes critical. Sloppy Vref can eat into this resolution. Bypass is a must.

    -warrier
    Last edited by Warrier; - 2nd May 2005 at 05:13.

  5. #5
    GEEZER's Avatar
    GEEZER Guest


    Did you find this post helpful? Yes | No

    Default Adc V.ref

    Thanks everybody, lot's of information. Just what I need.

  6. #6
    G8RPI's Avatar
    G8RPI Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Geezer,
    While you can use a 500mV reference, it will (apart from using pins on the PIC) compromise your system performance. The non-linearity for the 'F877 goes up to 1.5 bits with a 2V reference. Microchip don't specify performance with a Vref below 2V, but you can be sure it's much worse at 500mV.
    You are also down in the digital noise. You would be better off amplifying your signal up to 5V full scale before connecting it to the PIC. A gain of 10 is easily acheived and well worth the cost of a couple of quad op-amps (actually four dual's are probably cheaper). An LM358 will give reasonable performance.

    Regards,
    Robert G8RPI.

  7. #7
    GEEZER's Avatar
    GEEZER Guest


    Did you find this post helpful? Yes | No

    Default Adc V. Ref

    Thanks Robert, as a matter of fact I have some LM324's already on the board, and I have free opamps. The requirement was for a single opamp in each location on a plug-in bread board, and I had some 324's handy, so I just stuck the quads in there for testing purposes. They are right at the point of sampling.

    Your suggestion has promise.

    Thanks again,

    The Geezer

Similar Threads

  1. Stable Adc Reading Routine
    By gebillpap in forum General
    Replies: 27
    Last Post: - 13th May 2015, 02:18
  2. Can't get ADC to loop
    By TravisM in forum mel PIC BASIC
    Replies: 2
    Last Post: - 11th October 2009, 15:33
  3. PIC18F2423, ADC problem
    By mistergh in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th March 2009, 01:31
  4. ADC value with 2 decimals on an LCD
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2005, 15:54
  5. 12F675 ADC 'Issues'
    By harrisondp in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2005, 01:55

Members who have read this thread : 1

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