PCM18XT0 Microchip Technology, PCM18XT0 Datasheet - Page 281

MODULE PROC PIC18F4685

PCM18XT0

Manufacturer Part Number
PCM18XT0
Description
MODULE PROC PIC18F4685
Manufacturer
Microchip Technology
Datasheet

Specifications of PCM18XT0

Accessory Type
Processor Module
Product
Microcontroller Modules
Core Processor
PIC18F4685
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
ICE2000
For Use With
ICE2000 - EMULATOR MPLAB-ICE 2000 POD
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
EXAMPLE 23-2:
© 2009 Microchip Technology Inc.
ErrorInterrupt
TXB2Interrupt
TXB1Interrupt
TXB0Interrupt
RXB1Interrupt
RXB0Interrupt
AccessBuffer
BCF
RETFIE
BCF
GOTO
BCF
GOTO
BCF
GOTO
BCF
GOTO
BCF
GOTO
; Copy CANSTAT.ICODE bits to CANCON.WIN bits
MOVF
ANDLW
MOVWF
MOVF
ANDLW
IORWF
MOVFF
; Access current buffer…
; User code
; Restore CANCON.WIN bits
MOVF
ANDLW
IORWF
; Do not need to restore CANSTAT - it is read-only register.
; Return from interrupt or check for another module interrupt source
PIR3, ERRIF
PIR3, TXB2IF
AccessBuffer
PIR3, TXB1IF
AccessBuffer
PIR3, TXB0IF
AccessBuffer
PIR3, RXB1IF
Accessbuffer
PIR3, RXB0IF
AccessBuffer
TempCANCON, W
B’11110001’
TempCANCON
TempCANSTAT, W
B’00001110’
TempCANCON
TempCANCON, CANCON
CANCON, W
B’11110001’
TempCANCON
WIN AND ICODE BITS USAGE IN INTERRUPT SERVICE ROUTINE TO ACCESS
TX/RX BUFFERS (CONTINUED)
PIC18F2682/2685/4682/4685
; Clear the interrupt flag
; Handle error.
; Clear the interrupt flag
; Clear the interrupt flag
; Clear the interrupt flag
; Clear the interrupt flag
; Clear the interrupt flag
; This is either TX or RX interrupt
; Clear CANCON.WIN bits before copying
; new ones.
; Use previously saved CANCON value to
; make sure same value.
; Copy masked value back to TempCANCON
; Retrieve ICODE bits
; Use previously saved CANSTAT value
; to make sure same value.
; Copy ICODE bits to WIN bits.
; Copy the result to actual CANCON
; Preserve current non WIN bits
; Restore original WIN bits
DS39761C-page 281

Related parts for PCM18XT0