English
Language : 

PIC18F87K22 Datasheet, PDF (247/548 Pages) Microchip Technology – 64/80-Pin, High-Performance, 1-Mbit Enhanced Flash Microcontrollers with 12-Bit A/D and nanoWatt XLP Technology
PIC18F87K22 FAMILY
19.1 CCP Module Configuration
Each Capture/Compare/PWM module is associated
with a control register (generically, CCPxCON) and a
data register (CCPRx). The data register, in turn, is
comprised of two 8-bit registers: CCPRxL (low byte)
and CCPRxH (high byte). All registers are both
readable and writable.
19.1.1
CCP MODULES AND TIMER
RESOURCES
The CCP modules utilize Timers, 1 through 8, that vary
with the selected mode. Various timers are available to
the CCP modules in Capture, Compare or PWM
modes, as shown in Table 19-1.
TABLE 19-1: CCP MODE – TIMER
RESOURCE
CCP Mode
Timer Resource
Capture
Compare
Timer1, Timer3, Timer 5 or Timer7
PWM
Timer2, Timer4, Timer 6 or Timer8
The assignment of a particular timer to a module is
determined by the Timer to CCP enable bits in the
CCPTMRSx registers. (See Register 19-2 and
Register 19-3.) All of the modules may be active at
once and may share the same timer resource if they
are configured to operate in the same mode
(Capture/Compare or PWM) at the same time.
The CCPTMRS1 register selects the timers for CCP
modules, 7, 6, 5 and 4, and the CCPTMRS2 register
selects the timers for CCP modules, 10, 9 and 8. The
possible configurations are shown in Table 19-2 and
Table 19-3.
TABLE 19-2: TIMER ASSIGNMENTS FOR CCP MODULES 4, 5, 6 AND 7
CCPTMRS1 Register
CCP4
CCP5
CCP6
CCP7
C4TSEL
<1:0>
Capture/
Compare
Mode
PWM
Mode
Capture/
C5TSEL0 Compare
Mode
PWM
Mode
C6TSEL0
Capture/
Compare
Mode
PWM
Mode
C7TSEL
<1:0>
Capture/
Compare
Mode
PWM
Mode
0 0 TMR1 TMR2
0
TMR1 TMR2
0
0 1 TMR3 TMR4
1
TMR5 TMR4
1
1 0 TMR3 TMR6
11
Reserved(1)
Note 1: Do not use the reserved bits.
TMR1 TMR2 0 0
TMR5 TMR2 0 1
10
11
TMR1
TMR5
TMR5
TMR5
TMR2
TMR4
TMR6
TMR8
TABLE 19-3: TIMER ASSIGNMENTS FOR CCP MODULES 8, 9 AND 10
CCPTMRS2 Register
CCP8
CCP8
Devices with 32 Kbytes
CCP9(1)
CCP10(1)
C8TSEL
<1:0>
Capture/
Compare
Mode
PWM
Mode
C8TSEL
<1:0>
Capture/
Compare
Mode
PWM
Mode
Capture/
C9TSEL0 Compare
Mode
PWM
Mode
Capture/
C10TSEL0 Compare
Mode
PWM
Mode
00
01
10
11
Note 1:
2:
TMR1 TMR2 0 0 TMR1 TMR2
0
TMR1 TMR2
0
TMR1 TMR2
TMR7 TMR4 0 1 TMR1 TMR4
1
TMR7 TMR4
1
TMR7 TMR2
TMR7 TMR6 1 0
Reserved(2)
11
TMR1 TMR6
Reserved(2)
Module not available for devices with 32 Kbytes of program memory (PIC18F65K22 and PIC18F85K22).
Do not use the reserved bits.
 2010 Microchip Technology Inc.
Preliminary
DS39960B-page 247