ADC or ADCIN "bias" problem?


Closed Thread
Results 1 to 6 of 6

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Alain, I didn't post code, schematic, or board because all three work just fine with a 16F88. Now, except for controlling the output pins (which Darrel solved in http://www.picbasic.co.uk/forum/showthread.php?t=12739), the only issue is this "bias" (or whatever) on the AN channels.

    Melanie, I've tried to be sure I've turned off the comparators, the CCP modules, and the capacitive sensing module. I don't know if I've missed something, but here's what I did:

    ANSELA= %00011111
    ANSELB= %11000000
    CCP1CON=%00000000
    CCP2CON=%00000000
    CCP3CON=%00000000
    CCP4CON=%00000000
    OSCCON= %11110000
    TRISA = %01111111
    TRISB = %11000001

    ADCON1.7 =1
    CM1CON0.7=0
    CM2CON0.7=0
    CPSCON0 =0

    DEFINE ADC_BITS 10
    DEFINE ADC_CLOCK 6
    DEFINE ADC_SAMPLEUS 12

    I'll take a look at the Vref matter; maybe that's it. The pots seem okay, with good linear travel and value proportionate to rotation. Remember, I'm seeing the effect with the pins strapped to ground, too.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Have you tried just converting one channel and not multiplexing the ADC? I have had issues before because a previous channel precharged the ADC and would see the same kind of "bias" voltage even though the channel being converted is grounded.
    Tim Barr

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


    Did you find this post helpful? Yes | No

    Default

    Once again, Melanie, you've saved my bacon!

    It was Vref+ and Vref-. This is what I needed to do:

    ADCON1 = %11101000

    Bit 2 "0" selects Vss (internal) for Vref-
    Bits 1-0 "0" selects Vdd (internal) for Vref+

    No wonder the result was screwy!

    Thanks!

    Tim, thanks for your note, too. I'll remember that as a troubleshooting tip for the future.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

Similar Threads

  1. PIC18F2423, ADC problem
    By mistergh in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th March 2009, 01:31
  2. ADCIN Problem
    By JavPar in forum General
    Replies: 33
    Last Post: - 20th January 2009, 03:36
  3. ADC problem :(
    By Kaldurenik in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th December 2007, 14:54
  4. Mutliple ADC problem with PIC16F877
    By andyto in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd October 2007, 17:47
  5. Problem reading multiple ADC ports
    By jswayze in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th November 2004, 16: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