參數(shù)資料
型號: PIC16C642
廠商: Microchip Technology Inc.
英文描述: 8-Bit EPROM Microcontrollers with Analog Comparators(每個I/O口有25mA驅動/吸收電流,可編程Vref,微控制器)
中文描述: 8位EPROM微控制器與模擬比較器(每個的I / O口有25毫安驅動/吸收電流,可編程Vref的,微控制器)
文件頁數(shù): 49/136頁
文件大?。?/td> 837K
代理商: PIC16C642
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
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
μ
s delay
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
than the analog input V
IN
–, the output of the comparator
is a digital low level. When the analog input at V
greater than the analog input V
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.
IN
+ is less
IN
+ is
IN
–, the output of the
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 V
signal at V
IN
+, and the digital output of the comparator
is adjusted accordingly (Figure 7-3).
IN
– is compared to the
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 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
(Figure 7-2). In this mode, the internal voltage refer-
ence is applied to the V
IN
+ pin of both comparators.
mode
CM2:CM0 =
010
V
IN
-
V
IN
+
Output
V
IN
-
V
IN
+
Output
相關PDF資料
PDF描述
PIC16C64A Using the 8-Bit Parallel Slave Port(每個I/O口有25mA驅動/吸收電流,并行從動口,1路捕捉/比較/PWM的微控制器)
PIC16C66 8-Bit CMOS Microcontrollers(每個I/O口有25mA驅動/吸收電流,1路捕捉/比較/PWM的微控制器)
PIC16C67 8-Bit CMOS Microcontrollers(每個I/O口有25mA驅動/吸收電流,1路捕捉/比較/PWM的微控制器)
PIC16C62 8-Bit CMOS Microcontrollers(每個I/O口有25mA驅動/吸收電流,22個I/O,2.5V的微控制器)
PIC16C62A 8-Bit CMOS Microcontrollers(每個I/O口有25mA驅動/吸收電流,22個I/O,2.5V的微控制器)
相關代理商/技術參數(shù)
參數(shù)描述
PIC16C642/JW 功能描述:8位微控制器 -MCU 7KB 176 RAM 22 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16C642-04/SO 功能描述:8位微控制器 -MCU 7KB 176 RAM 22 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16C642-04/SP 功能描述:8位微控制器 -MCU 7KB 176 RAM 22 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16C642-04E/SO 功能描述:8位微控制器 -MCU 7KB 176 RAM 22 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT
PIC16C642-04E/SP 功能描述:8位微控制器 -MCU 7KB 176 RAM 22 I/O RoHS:否 制造商:Silicon Labs 核心:8051 處理器系列:C8051F39x 數(shù)據(jù)總線寬度:8 bit 最大時鐘頻率:50 MHz 程序存儲器大小:16 KB 數(shù)據(jù) RAM 大小:1 KB 片上 ADC:Yes 工作電源電壓:1.8 V to 3.6 V 工作溫度范圍:- 40 C to + 105 C 封裝 / 箱體:QFN-20 安裝風格:SMD/SMT