ADC on 12f675?


Results 1 to 11 of 11

Thread: ADC on 12f675?

Threaded View

  1. #1
    Join Date
    Feb 2005
    Posts
    130

    Question ADC on 12f675?

    I have the attached circuit and the following program:


    TRISIO=%1 'Pic 12F675
    DEFINE ADC_BITS 10
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50
    cmcon=7
    ansel=1
    ADCON0=131


    number VAR word

    Pause 100
    Loop:

    ADCIN 0, number ' (0-1023)

    IF number > 0 AND number < 400 Then
    GPIO.1=1
    GPIO.2=0
    GPIO.4=0
    EndIF
    IF number > 401 AND number < 800 Then
    GPIO.1=0
    GPIO.2=1
    GPIO.4=0
    EndIF
    IF number > 801 AND number < 1024 Then
    GPIO.1=0
    GPIO.2=0
    GPIO.4=1
    EndIF


    GoTo loop
    End


    it does not work, any ideas?

    Im trying to do my 1st ADC program, a simpler working one that make me understand the concept is welcome too!!!


    Thanks a bunch
    Attached Images Attached Images  

Similar Threads

  1. Stable Adc Reading Routine
    By gebillpap in forum General
    Replies: 27
    Last Post: - 13th May 2015, 02:18
  2. Can't get ADC to loop
    By TravisM in forum mel PIC BASIC
    Replies: 2
    Last Post: - 11th October 2009, 15:33
  3. ADC value with 2 decimals on an LCD
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2005, 15:54
  4. 12F675 ADC 'Issues'
    By harrisondp in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2005, 01:55
  5. Serial LCD on 12F675
    By anj in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 31st March 2004, 23:11

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