Using VREF with 16F88


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    jpeakall's Avatar
    jpeakall Guest

    Default Using VREF with 16F88

    Hi All,

    I am trying to use the programmable VREF of the 16F88. I can get the ADC to work correctly without using the vref. Here are my fuse settings:


    DEFINE ADC_BITS 10
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50

    TRISB = %11111111
    TRISA = %00010000
    CMCON = %00000000
    ANSEL= %00000010
    adcon1 = %00000001
    ADCON1 = %10100000
    CVRCON = %11000010

    With these settings, I see the 1.5V or so on the VREF. I have tried to set the ADC as using either VREF-VSS or +VREF -VREF. In either case, I get a reading of 1023 on the ADC. Any ideas?

    Thanks!

    Jonathan

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    jpeakall, I notice that you have ADCON1 being set twice. Is this a mistake? Also, what voltage do you have impressed on the second a/d channel AN1? Also you have the Tris register for PortA.1 set for output, this needs to be set for an input state.
    Dave Purola,
    N8NTA

  3. #3
    jpeakall's Avatar
    jpeakall Guest


    Did you find this post helpful? Yes | No

    Default

    DUH!

    Turns out I had the - vref and +vref pins backwards! I'm helping...

    Jonathan

Similar Threads

  1. MPXA4115A ADC vref set_up
    By iw2fvo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th August 2009, 19:04
  2. Display Vref 16f877
    By tico in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th January 2007, 11:34
  3. switching external vref+ and vdd vref
    By alejandro_halon in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th February 2005, 20:13
  4. How to use Vref
    By d1camero in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th April 2004, 11:20
  5. 4 line LCD with 16F88
    By anj in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 7th February 2004, 09:06

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