English
Language : 

PIC16F707 Datasheet, PDF (83/284 Pages) Microchip Technology – 40/44-Pin, Flash Microcontrollers with nanoWatt XLP and mTouch™ Technology
PIC16F707/PIC16LF707
EXAMPLE 9-1: A/D CONVERSION
;This code block configures the ADC
;for polling, Vdd reference, Frc clock
;and AN0 input.
;
;Conversion start & polling for completion
; are included.
;
BANKSEL ADCON1
;
MOVLW
B’01110000’ ;ADC Frc clock,
;VDD reference
MOVWF
ADCON1
;
BANKSEL TRISA
;
BSF
TRISA,0 ;Set RA0 to input
BANKSEL ANSELA
;
BSF
ANSELA,0 ;Set RA0 to analog
BANKSEL ADCON0
;
MOVLW
B’00000001’;AN0, On
MOVWF
ADCON0
;
CALL
SampleTime ;Acquisiton delay
BSF
ADCON0,GO ;Start conversion
BTFSC
ADCON0,GO ;Is conversion done?
GOTO
$-1
;No, test again
BANKSEL ADRES
;
MOVF
ADRES,W ;Read result
MOVWF
RESULT
;store in GPR space
 2010 Microchip Technology Inc.
Preliminary
DS41418A-page 83