2.1.10. Capture/Compare/PWM Modules
In the PIC18F452 microcontroller, there are two Capture/Compare/PWM (CCP) modules, and they work with Timers 1, 2, and 3 to capture and compare and for PWM operations. Each module has two 8-bit registers. Module 1 registers are CCPR1L and CCPR1H, and module 2 registers are CCPR2L and CCPR2H. Together, each register pair form a 16-bit register and can be used to capture, compare, or generate waveforms with a specified duty cycle. Module 1 is controlled by register CCP1CON, and module 2 is controlled by CCP2CON. Figure 2.35 shows the bit allocations of the CCP control registers.
Figure 2.35. CCPxCON Register Bit Allocations
In capture mode, the registers operate like a stopwatch, and when an ...