PIC16C782 Microchip Technology Inc., PIC16C782 Datasheet - Page 99
![no-image](/images/manufacturer_photos/0/4/440/microchip_technology_inc__sml.jpg)
PIC16C782
Manufacturer Part Number
PIC16C782
Description
8-bit Cmos Microcontrollers With A/d, D/a, Opamp, Comparators And Psmc
Manufacturer
Microchip Technology Inc.
Datasheet
1.PIC16C782.pdf
(186 pages)
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
- Current page: 99 of 186
- Download datasheet (4Mb)
EXAMPLE 12-3:
;*
;*
;*
;*
;*
;*
;*
;*
;********************************************
;*
WC_INT_SRV_R
;*** CLEAR C1 INTERRUPT
;*** CLEAR C2 INTERRUPT
TXT_C2_INT
USER_ISR
;*** USER INTERRUPT ROUTING
;*
2001 Microchip Technology Inc.
Example of Low Power Window Comparator C1
This code block will configure Comparator
C2 invert, input on AN4, and external
References
Interrupt service routine included
BANKSEL
BSF
BSF
BSF
BSF
BSF
BSF
BANKSEL
MOVLW
MOVWF
MOVLW
MOVWF
BANKSEL
BCF
BSF
BSF
BSF
BSF
WINDOW COMPARATOR ISR with context save
MOVWF
SWAPF
MOVWF
BANKSEL
MOVLW
ANDWF
MOVWF
BTFSS
GOTO
BANKSEL
MOVF
BANKSEL
BCF
BTFSS
GOTO
BANKSEL
MOVF
BANKSEL
BCF
SWAPF
MOVWF
SWAPF
SWAPF
RETFIE
C1 and C2 for slow speed, C1 non invert,
TRISA
TRISA,2
TRISA,3
TRISB,0
ANSEL,AN2
ANSEL,AN3
ANSEL,AN4
CM1CON0
B’10000000’ ; C1: no output
CM1CON0
B’10010000’ ; C2: no output
CM2CON0
PIE1
INTCON,GIE ; Disable Int
PIE1,C1IE
PIE1,C2IE
INTCON,PEIE
INTCON,GIE ; Enabl Global Ints
W_SAVE
STATUS,W
STATUS_SAV
PIR1
B’00110000’ ; Save Int
PIR1,W
WIN_INT
WIN_INT,C1IF; C1 Int ?
TST_C2_INT
CM1CON0
CM1CON0,F
PIR1
PIR1,C1IF
WIN_INT,C2IF; C2 int?
USER_ISR
CM2CON0
CM2CON0,F
PIR1
PIR1,C1IF
STATUS_SAVE,W; Restore W &
STATUS
W_SAVE,F
W_SAVE,W
WINDOW COMPARATOR
; Select Bank 1
; RA2 input
; RA3 input
; Set RB0
; RA2 analog
; RA3 analog
; RB4 analog
; Select Bank 2
; VREF1, AN4
; invert,VREF1,AN4
; Select Bank 1
; Enabl C1&C2 Ints
; Save W & STATUS
; Select Bank 0
; Select Bank 2
; Clear C2 mismatch
; Select Bank 0
; Clear C2 Int
; Select Bank 2
; Clear C2 mismatch
; Select Bank 0
; Clear C2 int
; STATUS
; Return
Preliminary
PIC16C781/782
DS41171A-page 97
Related parts for PIC16C782
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![PIC-0903](/images/no-image3.png)
Part Number:
Description:
Photo IC(photodiode with signal processing)
Manufacturer:
KODENSHI KOREA CORP
Datasheet:
![PIC-1018SMB](/images/no-image3.png)
Part Number:
Description:
INFRARED RECEIVER MODULE
Manufacturer:
ETC
Datasheet:
![PIC-2058SMB](/images/no-image3.png)
Part Number:
Description:
INFRARED RECEIVER MODULE
Manufacturer:
ETC
Datasheet:
![PIC-2503](/images/no-image3.png)
Part Number:
Description:
Photo IC(photodiode with signal processing)
Manufacturer:
KODENSHI KOREA CORP
Datasheet:
![PIC12045S](/images/manufacturer_photos/0/3/374/kodenshi_tmb.jpg)
Part Number:
Description:
(PIC-1204x) OPTICAL-RECEIVER OUTPUT PHOTO IC
Manufacturer:
Kodenshi
Datasheet:
![TC1014-2.7VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1014-5.0VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.5VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.7VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.8VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-4.0VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet: