problem with a/d in pic12f675


Results 1 to 13 of 13

Threaded View

  1. #1
    Join Date
    Jun 2011
    Location
    iran
    Posts
    7

    Default problem with a/d in pic12f675

    hello, can anybody help me in this code? i just wanna read a voltage from chennel one and turn on and off the led, but i can't do it! please help,i am an iranian,and here,in iran,nobody knows about it.. just tell what the problem is,and i simulated it in proteus,but it doesnt work on proteus
    Code:
     trisio.2=0  
    trisio.0=1 
    ansel=%00000001 
    adcon0=%10000011 
    define osc 8 
    define adc_bits 10 
    w0 var word 
    start: 
    adcin 0,w0  
    pause 100  
    if w0=100 
    then 
    gpio.2=1 
    else  
    gpio.2=0 
    endif 
    goto start 
    end
    Last edited by Archangel; - 25th June 2011 at 08:51.

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