Microchip Technology IC MCU 8BIT PIC18F65K22-I/PT TQFP-64 MCP PIC18F65K22-I/PT Data Sheet
Product codes
PIC18F65K22-I/PT
PIC18F87K22 FAMILY
DS39960D-page 260
2009-2011 Microchip Technology Inc.
REGISTER 20-1:
CCPxCON: ENHANCED CAPTURE/COMPARE/PWMx CONTROL
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
PxM1
PxM0
DCxB1
DCxB0
CCPxM3
CCPxM2
CCPxM1
CCPxM0
bit 7
bit 0
Legend:
R = Readable bit
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
x = Bit is unknown
bit 7-6
PxM<1:0>:
Enhanced PWM Output Configuration bits
If CCPxM<3:2> = 00, 01, 10:
xx
xx
= PxA is assigned as capture/compare input/output; PxB, PxC and PxD are assigned as port pins
If CCPxM<3:2> = 11:
00
00
= Single output: PxA, PxB, PxC and PxD are controlled by steering (see
01
= Full-bridge output forward: PxD is modulated; PxA is active; PxB, PxC are inactive
10
= Half-bridge output: PxA, PxB are modulated with dead-band control; PxC and PxD are
assigned as port pins
11
= Full-bridge output reverse: PxB is modulated; PxC is active; PxA and PxD are inactive
bit 5-4
DCxB<1:0>
: PWM Duty Cycle Bit 1 and Bit 0
Capture mode:
Unused.
Compare mode:
Unused.
PWM mode:
These bits are the two LSbs of the 10-bit PWM duty cycle. The eight MSbs of the duty cycle are found
in CCPRxL.
Unused.
Compare mode:
Unused.
PWM mode:
These bits are the two LSbs of the 10-bit PWM duty cycle. The eight MSbs of the duty cycle are found
in CCPRxL.
bit 3-0
CCPxM<3:0>
: ECCPx Mode Select bits
0000
= Capture/Compare/PWM off (resets ECCPx module)
0001
= Reserved
0010
= Compare mode: toggle output on match
0011
= Capture mode
0100
= Capture mode: every falling edge
0101
= Capture mode: every rising edge
0110
= Capture mode: every fourth rising edge
0111
= Capture mode: every 16
th
rising edge
1000
= Compare mode: initialize ECCPx pin low, set output on compare match (set CCPxIF)
1001
= Compare mode: initialize ECCPx pin high, clear output on compare match (set CCPxIF)
1010
= Compare mode: generate software interrupt only, ECCPx pin reverts to I/O state
1011
= Compare mode: trigger special event (ECCPx resets TMR1 or TMR3, starts A/D conversion,
sets CCPxIF bit)
1100
= PWM mode: PxA and PxC are active-high; PxB and PxD are active-high
1101
= PWM mode: PxA and PxC are active-high; PxB and PxD are active-low
1110
= PWM mode: PxA and PxC are active-low; PxB and PxD are active-high
1111
= PWM mode: PxA and PxC are active-low; PxB and PxD are active-low