PIC12C671-04I/P Microchip Technology Inc., PIC12C671-04I/P Datasheet - Page 50

no-image

PIC12C671-04I/P

Manufacturer Part Number
PIC12C671-04I/P
Description
8 PIN, 1.75 KB OTP, 128 RAM, 6 I/O
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC12C671-04I/P

A/d Inputs
4-Channel, 8-Bit
Cpu Speed
2.5 MIPS
Eeprom Memory
0 Bytes
Input Output
5
Memory Type
OTP
Number Of Bits
8
Package Type
8-pin PDIP
Programmable Memory
1.75K Bytes
Ram Size
128 Bytes
Speed
4 MHz
Timers
1-8-bit
Voltage, Range
2.5-5.5 V
Lead Free Status / Rohs Status
RoHS Compliant part Electrostatic Device
PIC12C67X
8.4
Example 8-2 shows how to perform an A/D conversion.
The GPIO pins are configured as analog inputs. The
analog reference (V
interrupt is enabled and the A/D conversion clock is
F
EXAMPLE 8-2:
;
;
;
;
DS30561B-page 50
RC
Note:
Ensure that the required sampling time for the selected input channel has elapsed.
Then the conversion may be started.
. The conversion is performed on the GP0 channel.
BSF
CLRF
BSF
BCF
MOVLW
MOVWF
BCF
BSF
BSF
BSF
:
:
A/D Conversions
The GO/DONE bit should NOT be set in
the same instruction that turns on the A/D.
STATUS, RP0
ADCON1
PIE1,
STATUS, RP0
0xC1
ADCON0
PIR1,
INTCON, PEIE
INTCON, GIE
ADCON0, GO
REF
DOING AN A/D CONVERSION
) is the device V
ADIE
ADIF
; Select Page 1
; Configure A/D inputs
; Enable A/D interrupts
; Select Page 0
; RC Clock, A/D is on, Channel 0 is selected
;
; Clear A/D interrupt flag bit
; Enable peripheral interrupts
; Enable all interrupts
; Start A/D Conversion
; The ADIF bit will be set and the GO/DONE bit
;
DD
is cleared upon completion of the A/D Conversion.
. 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 2T
is required before the next acquisition is started. After
this 2T
the selected channel.
AD
wait, an acquisition is automatically started on
1999 Microchip Technology Inc.
AD
wait

Related parts for PIC12C671-04I/P