DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

PIC16F689T-I/SO View Datasheet(PDF) - Microchip Technology

Part Name
Description
Manufacturer
PIC16F689T-I/SO Datasheet PDF : 306 Pages
First Prev 111 112 113 114 115 116 117 118 119 120 Next Last
PIC16F631/677/685/687/689/690
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
MOVWF
ADCON1
;
BANKSEL TRISA
;
BSF
TRISA,0
;Set RA0 to input
BANKSEL ANSEL
;
BSF
ANSEL,0
;Set RA0 to analog
BANKSEL ADCON0
;
MOVLW
B’10000001’ ;Right justify,
MOVWF
ADCON0
; Vdd Vref, AN0, On
CALL
SampleTime ;Acquisiton delay
BSF
ADCON0,GO ;Start conversion
BTFSC
ADCON0,GO ;Is conversion done?
GOTO
$-1
;No, test again
BANKSEL ADRESH
;
MOVF
ADRESH,W
;Read upper 2 bits
MOVWF
RESULTHI
;store in GPR space
BANKSEL ADRESL
;
MOVF
ADRESL,W
;Read lower 8 bits
MOVWF
RESULTLO
;Store in GPR space
9.2.7 ADC REGISTER DEFINITIONS
The following registers are used to control the
operation of the ADC.
DS41262E-page 112
© 2008 Microchip Technology Inc.

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]