So I have a PIC 16F88, and I managed to do a couple things with it, but now I was wondering how to get analog to digital conversion?
I've tried many examples out there in the internet, but no success :( if anyone could give a light on how to use the ADCON0/1 and stuff like that, I will appreciate.
Thanks a lot.
Edit: this is my code:
START
banksel TRISA
clrf TRISB
movlw 0xff
movwf TRISA
movlw b'11000111'
movwf OPTION_REG
movlw b'00000001'
movwf ADCON1
banksel PORTB
clrf PORTB
LOOP
btfss PIR1,ADIF
goto LOOP
bsf ADCON0,GO
WAIT
btfsc ADCON0,GO
goto WAIT
movf ADRESH,W
movwf PORTB,W
END