Can Vref be turned on and off


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Location
    New Hampshire
    Posts
    76

    Default Can Vref be turned on and off

    Hi all,

    I have the need to use Vref for A/D processing of thermal sensors but do not want it when reading other A/D pins (serial buttons on one wire). Can it be turned off and on with program statements?

    I'm using a 16f876 and picbasic pro.

    Thank you!

    Ross
    Never enough knowledge to be called intelligent but just enough knowledge to be considered dangerous!

    I like that! :-)

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Yes – the easiest way is to NOT use the ADCIN command but roll your own like that shown on MELabs website:

    http://www.melabs.com/resources/samples/pbp/a2d10.bas

    With this approach, you can change ADCON1 (which controls vrefs and A/D port assignments) whenever you would like. Make sure and read section 11 of the datasheet.

    ----------
    edit: Being a control freak, I have never used ADCIN for A2D work - I would suppose one could change ADCON1 on the fly as well with this approach but this has not been verifed by me (I use the approach above all the time and know it works)
    ----------
    Last edited by paul borgmeier; - 31st August 2006 at 15:27. Reason: additional comment
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    By telling the adcon1 register to do that for you.
    Read the datasheet please. Page 114 of the datasheet there you can read how!

  4. #4
    Join Date
    Oct 2004
    Location
    New Hampshire
    Posts
    76


    Did you find this post helpful? Yes | No

    Default

    Thanks all, that'll do it!

    I have to be nudged from time to time to read that blasted data sheet. It does not read easily for me... if you must know it. I must be ADD. My eyes glaze over within minutes and I leave a trail of drool across my desk calendar. I look like Jack Nicholson comming from back from his shock treatment.

    I re-read the suggested pages and was able to understand the A/D module information in the data sheet. This must be a good day.

    Thanks again!

    Ross
    Never enough knowledge to be called intelligent but just enough knowledge to be considered dangerous!

    I like that! :-)

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