adcin trouble


Results 1 to 3 of 3

Thread: adcin trouble

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    I will assume you mean 12F683 ?

    There is not a PORTA.
    Code:
    TRISIO = %11111110 ' set GPIO.0 output and all other to inputs
    ANSEL = %00000010 ' porta.1 to analog, others to digital
    ADCON0 = %00000100 ' analog input on GPIO.1, Left justify result for 8 bit
    CMCON0 = %00000111 ' Turn of the comparators
    GPIO = %00000000 ' set porta to all 0's
    
    adcin 1, pulse_width
    Give it a try.. No guarantees...
    Last edited by mackrackit; - 29th March 2010 at 22:35.
    Dave
    Always wear safety glasses while programming.

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