English
Language : 

PIC18F97J60_11 Datasheet, PDF (192/492 Pages) Microchip Technology – 64/80/100-Pin, High-Performance, 1-Mbit Flash Microcontrollers with Ethernet
PIC18F97J60 FAMILY
17.3 Compare Mode
In Compare mode, the 16-bit CCPRx register value is
constantly compared against either the TMR1 or TMR3
register pair value. When a match occurs, the CCPx
pin:
• Can be driven high
• Can be driven low
• Can be toggled (high-to-low or low-to-high)
• Remains unchanged (that is, reflects the state of
the I/O latch)
The action on the pin is based on the value of the mode
select bits (CCPxM<3:0>). At the same time, the
interrupt flag bit, CCPxIF, is set.
17.3.1 CCPx PIN CONFIGURATION
The user must configure the CCPx pin as an output by
clearing the appropriate TRIS bit.
Note:
Clearing the CCP5CON register will force
the RG4 compare output latch (depend-
ing on device configuration) to the default
low level. This is not the PORTB or
PORTC I/O data latch.
17.3.2 TIMER1/TIMER3 MODE SELECTION
Timer1 and/or Timer3 must be running in Timer mode
or Synchronized Counter mode if the CCPx module is
using the compare feature. In Asynchronous Counter
mode, the compare operation may not work.
17.3.3 SOFTWARE INTERRUPT MODE
When the Generate Software Interrupt mode is chosen
(CCPxM<3:0> = 1010), the corresponding CCPx pin is
not affected. Only a CCPx interrupt is generated, if
enabled, and the CCPxIE bit is set.
FIGURE 17-3:
0
COMPARE MODE OPERATION BLOCK DIAGRAM
CCPR4H CCPR4L
Set CCP4IF
Comparator
Compare
Match
TMR1H TMR1L
0
Output
Logic
4
CCP4CON<3:0>
SQ
R
CCP4 Pin
TRIS
Output Enable
1
TMR3H TMR3L
1
T3CCP1
T3CCP2
Set CCP5IF
CCP5 Pin
Comparator
Compare
Match
CCPR5H CCPR5L
Output
Logic
4
CCP5CON<3:0>
SQ
R
TRIS
Output Enable
DS39762F-page 192
 2011 Microchip Technology Inc.