My 12lf1822 ADC won't read zero (lowest reading is 008)


Results 1 to 12 of 12

Threaded View

  1. #6
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: My 12lf1822 ADC won't read zero (lowest reading is 008)

    well, I got to the bottom of it...something whacky going on here!

    It's something to do with the way I'm setting the weak pullup register....

    Firstly, I noticed that when I disabled weak pullups (I just took a flier!)

    Code:
    OPTION_REG.7 = 1 ' disable weak pullups
    My ADC started reading down to zero as it should!

    Sure enough when I enabled weak pullups again, the problem returned.

    But this is where I’m obviously doing something wrong, this way actually works…

    (I want weak pullups of RA3)
    Code:
    WPUA  = %00001000 
    IOCAN = %00001000 
    …ie even with weak pullups enabled my ADC reads down to zero.

    But if I do this….

    Code:
    WPUA.3 = 1
    IOCAN.3 = 1
    My ADC won’t read down below 008 again!

    So to get ADC reading down to zero *with* weak pullups enabled on a 12LF1822, it must be set like this....

    Code:
    OPTION_REG.7 = 0
    WPUA  = %00001000 
    IOCAN = %00001000 
    Not sure if it makes any difference but my weak pullup is on the MCLR pin.

    Anyway, I'm happy - it's sorted!
    Last edited by HankMcSpank; - 19th May 2011 at 20:00.

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