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

PIC16LC77T-04P 查看數據表(PDF) - Microchip Technology

零件编号
产品描述 (功能)
生产厂家
PIC16LC77T-04P
Microchip
Microchip Technology 
PIC16LC77T-04P Datasheet PDF : 288 Pages
First Prev 121 122 123 124 125 126 127 128 129 130 Next Last
PIC16C7X
13.4 A/D Conversions
Applicable Devices
72 73 73A 74 74A 76 77
Example 13-2 shows how to perform an A/D conver-
sion. The RA pins are configured as analog inputs. The
analog reference (VREF) is the device VDD. The A/D
interrupt is enabled, and the A/D conversion clock is
FRC. The conversion is performed on the RA0 pin
(channel 0).
Note: The GO/DONE bit should NOT be set in
the same instruction that turns on the A/D.
Clearing the GO/DONE bit during a conversion will
abort the current conversion. The ADRES register will
NOT be updated with the partially completed A/D con-
version sample. That is, the ADRES register will con-
tinue to contain the value of the last completed
conversion (or the last value written to the ADRES reg-
ister). After the A/D conversion is aborted, a 2TAD wait
is required before the next acquisition is started. After
this 2TAD wait, an acquisition is automatically started on
the selected channel.
EXAMPLE 13-2: A/D CONVERSION
BSF
STATUS, RP0
; Select Bank 1
BCF
STATUS, RP1
; PIC16C76/77 only
CLRF ADCON1
; Configure A/D inputs
BSF
PIE1, ADIE
; Enable A/D interrupts
BCF
STATUS, RP0
; Select Bank 0
MOVLW 0xC1
; RC Clock, A/D is on, Channel 0 is selected
MOVWF ADCON0
;
BCF
PIR1, ADIF
; Clear A/D interrupt flag bit
BSF
INTCON, PEIE
; Enable peripheral interrupts
BSF
INTCON, GIE
; Enable all interrupts
;
; Ensure that the required sampling time for the selected input channel has elapsed.
; Then the conversion may be started.
;
BSF
ADCON0, GO
; Start A/D Conversion
:
; The ADIF bit will be set and the GO/DONE bit
:
; is cleared upon completion of the A/D Conversion.
DS30390E-page 122
© 1997 Microchip Technology Inc.

Share Link: 

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