See,
Mike.
Code:
list p=16F88
include <p16f88.inc>
__config _CONFIG1, _WDT_OFF & _INTRC_IO & _MCLR_ON & _LVP_OFF
ERRORLEVEL 0, -302
cblock 0x20
count
endc
banksel TRISA ;bank 1
movlw B'00001000' ;MAKE RA3 INPUT
movwf TRISA
movwf ANSEL ;MAKE RA3 ANALOG INPUT
movlw B'10000000'
movwf ADCON1 ;set right justified
banksel ADCON0 ;bank 0
movlw B'01011001'
movwf ADCON0 ;enable A/D
bsf STATUS,RP0
movlw 0x70 ;switch to 8MHz clock
movwf OSCCON
bcf STATUS,RP0
Mike.
Last edited: