Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

PIC16C64X Datasheet(PDF) 49 Page - Microchip Technology

Part # PIC16C64X
Description  8-Bit EPROM Microcontrollers with Analog Comparators
PDF  136 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC16C64X Datasheet(HTML) 49 Page - Microchip Technology

Back Button PIC16C64X Datasheet HTML 45Page - Microchip Technology PIC16C64X Datasheet HTML 46Page - Microchip Technology PIC16C64X Datasheet HTML 47Page - Microchip Technology PIC16C64X Datasheet HTML 48Page - Microchip Technology PIC16C64X Datasheet HTML 49Page - Microchip Technology PIC16C64X Datasheet HTML 50Page - Microchip Technology PIC16C64X Datasheet HTML 51Page - Microchip Technology PIC16C64X Datasheet HTML 52Page - Microchip Technology PIC16C64X Datasheet HTML 53Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 49 / 136 page
background image
© 1996 Microchip Technology Inc.
Preliminary
DS30559A-page 49
PIC16C64X & PIC16C66X
The code example in Example 7-1 depicts the steps
required to configure the comparator module. RA3 and
RA4 are configured as digital outputs. RA0 and RA1
are configured as the V- inputs and RA2 as the V+ input
to both comparators.
EXAMPLE 7-1:
INITIALIZING THE
COMPARATOR MODULE
FLAG_REG
EQU 0x20
CLRF
FLAG_REG
;Init Flag Register
CLRF
PORTA
;Init PORTA
ANDLW
0xC0
;Mask Comp bits
IORWF
FLAG_REG,F
;Bits to Flag_Reg
MOVLW
0x03
;Init Comp Mode
MOVWF
CMCON
;CM2:CM0 = 011
BSF
STATUS,RP0
;Select Bank 1
MOVLW
0x07
;Init Data direction
MOVWF
TRISA
;RA<2:0> to inputs
;RA<4:3> to outputs
;TRISA<7:5> read '0'
BCF
STATUS,RP0
;Select Bank 0
CALL
DELAY_10
µs
;10
µs delay
MOVF
CMCON,F
;Read CMCON to end
;change condition
BCF
PIR1,CMIF
;Clear Pending Ints
BSF
STATUS,RP0
;Select Bank 1
BSF
PIE1,CMIE
;Enable Comp Ints
BCF
STATUS,RP0
;Select Bank 0
BSF
INTCON,PEIE
;Enable Periph Ints
BSF
INTCON,GIE
;Global Int enable
7.2
Comparator Operation
A single comparator is shown in Figure 7-3 along with
the relationship between the analog input levels and
the digital output. When the analog input at VIN+ is less
than the analog input VIN–, the output of the comparator
is a digital low level. When the analog input at VIN+ is
greater than the analog input VIN–, the output of the
comparator is a digital high level. The shaded areas of
the output of the comparator in Figure 7-3 represents
the uncertainty due to input offsets and response time.
7.3
Comparator Reference
An external or internal reference signal may be used
depending on the comparator operating mode. The
analog signal that is present at VIN– is compared to the
signal at VIN+, and the digital output of the comparator
is adjusted accordingly (Figure 7-3).
FIGURE 7-3:
SINGLE COMPARATOR
7.3.1
EXTERNAL REFERENCE SIGNAL
When external voltage references are used, the
comparator module can be configured to have the com-
parators operate from the same or different reference
sources. However, threshold detector applications may
require the same reference. The reference signal must
be between VSS and VDD, and can be applied to either
pin of the comparator(s).
7.3.2
INTERNAL REFERENCE SIGNAL
The comparator module also allows the selection of an
internally
generated
voltage
reference
for
the
comparators. Section 8.0, contains a detailed descrip-
tion of the Voltage Reference Module that provides this
signal. The internal reference signal is used when the
comparators
are
in
mode
CM2:CM0 = 010
(Figure 7-2). In this mode, the internal voltage refer-
ence is applied to the VIN+ pin of both comparators.
VIN-
VIN+
Output
VIN-
VIN+
Output



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com