PIC16C782 Microchip Technology Inc., PIC16C782 Datasheet - Page 98

no-image

PIC16C782

Manufacturer Part Number
PIC16C782
Description
8-bit Cmos Microcontrollers With A/d, D/a, Opamp, Comparators And Psmc
Manufacturer
Microchip Technology Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16C782/JW
Manufacturer:
AD
Quantity:
580
PIC16C781/782
FIGURE 12-4:
EXAMPLE 12-2:
;*
;*
;*
FIGURE 12-5:
DS41171A-page 96
INPUT
VOLTAGE REFERENCE
This code block will configure Comparator
input on AN7, and Reference from the DAC
BANKSEL
BSF
BSF
BANKSEL
CLRF
MOVLW
MOVWF
MOVLW
MOVWF
MOVLW
MOVWF
C1 for normal speed and output polarity,
INPUT
TRISA
TRISB,RB3
ANSEL,AN7
DACON0
DAC
B’10000000’ ; Enable, no out
DACON0
DAC_VALUE
DAC
B’10001111’ ; C1; no out,
CM1CON0
RB3/AN7/OPA
CONFIGURATION OF COMPARATOR C1 WITH DAC
PROGRAMMING C1 FOR
PSMC FEEDBACK
WINDOW COMPARATOR WITH INTERRUPT
; Select Bank 1
; RB3 as input
; Set RB3 as analog
; Select Bank 2
; DAC=00h
; DACREF = VDD
; Trip Level
; VREF1, AN7
V
V
REF
REF
AN4
2
1
V
DAC
+
-
DAC
Preliminary
C1
PIC16C78X
+
+
-
-
C2
C1
12.2.3
To form a low power window comparator, Comparators
C1 & C2 are configured as follows:
• Common input RB0/INT/AN4/V
• Separate external reference voltages
• Programmed for slow speed operation
In addition, the output of comparator C2 must be
inverted for common polarity with C1.
A block diagram of the window comparator with exter-
nal connections is shown in Figure 12-4.
PIC16C78X
C1POL = 0
EXAMPLE: LOW POWER WINDOW
COMPARATOR WITH INTERRUPT
C1OUT
CLPOL=1
2001 Microchip Technology Inc.
CM2CON1<6>
CLPOL=0
CM2CON1<7>
PSMC
REF

Related parts for PIC16C782