PIC16C641 Datasheet

  • PIC16C641

  • 8-Bit EPROM Microcontrollers with Analog Comparators

  • 661.21KB

  • 137页

  • MICROCHIP   MICROCHIP

扫码查看芯片数据手册

上传产品规格书

PDF预览

PIC16C64X & PIC16C66X
The code example in Example 7-1 depicts the steps
required to con铿乬ure the comparator module. RA3 and
RA4 are con铿乬ured as digital outputs. RA0 and RA1
are con铿乬ured as the V- inputs and RA2 as the V+ input
to both comparators.
7.3
Comparator Reference
EXAMPLE 7-1:
FLAG_REG
CLRF
CLRF
ANDLW
IORWF
MOVLW
MOVWF
BSF
MOVLW
MOVWF
INITIALIZING THE
COMPARATOR MODULE
;Init Flag Register
;Init PORTA
;Mask Comp bits
;Bits to Flag_Reg
;Init Comp Mode
;CM2:CM0 = 011
;Select Bank 1
;Init Data direction
;RA<2:0> to inputs
;RA<4:3> to outputs
;TRISA<7:5> read '0'
;Select Bank 0
;10
s delay
;Read CMCON to end
;change condition
;Clear Pending Ints
;Select Bank 1
;Enable Comp Ints
;Select Bank 0
;Enable Periph Ints
;Global Int enable
An external or internal reference signal may be used
depending on the comparator operating mode. The
analog signal that is present at V
IN
鈥?is compared to the
signal at V
IN
+, and the digital output of the comparator
is adjusted accordingly (Figure 7-3).
EQU 0x20
FLAG_REG
PORTA
0xC0
FLAG_REG,F
0x03
CMCON
STATUS,RP0
0x07
TRISA
FIGURE 7-3:
V
IN
-
V
IN
+
SINGLE COMPARATOR
Output
BCF
CALL
MOVF
BCF
BSF
BSF
BCF
BSF
BSF
STATUS,RP0
DELAY_10
s
CMCON,F
PIR1,CMIF
STATUS,RP0
PIE1,CMIE
STATUS,RP0
INTCON,PEIE
INTCON,GIE
V
IN
-
V
IN
+
Output
7.3.1
EXTERNAL REFERENCE SIGNAL
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 V
IN
+ is less
than the analog input V
IN
鈥? the output of the comparator
is a digital low level. When the analog input at V
IN
+ is
greater than the analog input V
IN
鈥? 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.
When external voltage references are used, the
comparator module can be con铿乬ured 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 V
SS
and V
DD
, 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 V
IN
+ pin of both comparators.
1996 Microchip Technology Inc.
Preliminary
DS30559A-page 49

PIC16C641 PDF文件相关型号

PIC16C642

PIC16C641相关型号PDF文件下载

您可能感兴趣的PDF文件资料

热门IC型号推荐

扫码下载APP,
一键连接广大的电子世界。

在线人工客服

买家服务:
卖家服务:

0571-85317607

客服在线时间周一至周五
9:00-17:30

关注官方微信号,
第一时间获取资讯。

建议反馈
返回顶部

建议反馈

联系人:

联系方式:

按住滑块,拖拽到最右边
>>
感谢您向阿库提出的宝贵意见,您的参与是维库提升服务的动力!意见一经采纳,将有感恩红包奉上哦!