PIC16F690 ADC question


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2009
    Posts
    4

    Default PIC16F690 ADC question

    I have been trying to use the onboard ADC, and it works, butt when trying on the RPB4 (AN10), it does not respond, am I missing something?

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Can we see your code?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Oct 2009
    Posts
    4


    Did you find this post helpful? Yes | No

    Default duh, I guess that would have made it easier...

    DEFINE OSC 8
    Define ADC_BITS 8 ' Set number of bits in result
    Define ADC_CLOCK 3 ' Set clock source (3=rc)
    Define ADC_SAMPLEUS 20 ' Set sampling time in uS


    TRISA = %00000000
    TRISB =%11111111
    TRISC = %00000000

    ANSEL = %00000000
    ANSELH = %00000100
    ADCON0 = %00101000
    ADCON1 = %00100000


    vinput var PORTB.4
    B0 var byte
    B1 var byte


    clear

    inicio:
    call cal_pot
    pause 500
    goto inicio

    cal_pot:
    adcin vinput,B0
    serout PORTA.0, 0 ,["ADCIN = ",#B1,10,13]

    return

    The same code works for any pin in port A (I have not tried B or C), obviously changing the appropriate ANSEL and ADCON.

    Nothing else changes, other than the jumper to the pin. I thought maybe the pin was blown, but different chips yielded the same result.
    Thanks

Similar Threads

  1. Newbie HPWM / ADC question
    By Johan in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 25th June 2007, 12:52
  2. ADC question
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 8th June 2007, 09:52
  3. A question about ADC (using Pic16f876)
    By mimmmis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd April 2007, 16:26
  4. strange adc question
    By maus in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th November 2006, 10:57
  5. ADC question
    By schu4647 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th May 2006, 14:15

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