A/D problem ON 16F688


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425

    Default A/D problem ON 16F688

    Hi,

    I have a small program where I measure 0-5V on a 16F876 and it works good. I tried the same program on the 16F688 and it doesn't work for crap. I have tried many different settings but I can't get it to work. It is extremely erratic and mostly displays 192, 64 and zero. Below is my program and if someone has any suggestions or if you have used the A/D on the 688 please chime in.

    Thanks,

    Chris

    @ DEVICE PIC16F688, INTRC_OSC_NOCLKOUT, WDT_OFF, PWRT_ON, MCLR_OFF, BOD_ON,PROTECT_OFF

    Define ADC_BITS 10 ' Set number of bits in result
    Define ADC_CLOCK 3 ' Set clock source (3=rc)
    Define ADC_SAMPLEUS 50 ' Set sampling time in uS
    ADCON0.7 = 1 ' right justify conversion result
    ANSEL = %10000000 ' ANS7 analog, all others digital
    TRISC = %11111000
    WAT VAR WORD


    DETWAT:
    ADCIN 7,WAT
    PAUSE 100
    SEROUT2 PORTC.2,16468,[254,1," SENS ", DEC WAT]
    goto DETWAT

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default Datasheet !!!

    Hi, Chris

    What about ADCON 1 ???

    Alain
    Last edited by Acetronics2; - 19th October 2005 at 14:23.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default

    I was told by Charles at ME Labs that the adcon 1 setting is not needed. Anyway, I tried that before and it still didn't work. I read and re-read the data sheet but I am still missing something.

Similar Threads

  1. A/D converter problem
    By netstranger.nz in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th September 2009, 07:56
  2. 16F688 problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th May 2009, 23:09
  3. A/D conversion problem in 18F2520, 2523, 2550 etc.
    By selimkara in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 10th March 2008, 16:26
  4. A/D conversion problem with pic16F88
    By Tapio Linkosalo in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 18th August 2006, 11:42
  5. Problem with 16F688 and Hserout
    By DWV in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 19th March 2005, 05:37

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