0% found this document useful (0 votes)
263 views

CCP Module

The document discusses the CCP module in PIC microcontrollers, which provides compare, capture, and pulse width modulation (PWM) functionality. It notes that PICs can have 0 to 5 CCP modules designated as CCPx. Each CCP module has 3 registers associated with it - CCPxCON for selecting the compare, capture, or PWM mode, and CCPRxL and CCPRxH registers used together as a compare, capture, or duty cycle register depending on the mode. The document provides information on programming and operating the CCP modules in compare, capture, and PWM modes.

Uploaded by

Poonthalir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
263 views

CCP Module

The document discusses the CCP module in PIC microcontrollers, which provides compare, capture, and pulse width modulation (PWM) functionality. It notes that PICs can have 0 to 5 CCP modules designated as CCPx. Each CCP module has 3 registers associated with it - CCPxCON for selecting the compare, capture, or PWM mode, and CCPRxL and CCPRxH registers used together as a compare, capture, or duty cycle register depending on the mode. The document provides information on programming and operating the CCP modules in compare, capture, and PWM modes.

Uploaded by

Poonthalir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

CCP Module

• Compare/Capture/Pulse Width Modulation.


• Depending on the family, PIC can have 0 to 5
CCP modules designated as CCPx, where x is
the CCP module number.
• In recent years, the PWM features of CCP are
enhanced for better DC motor control, hence
Enhanced CCP modules (ECCPs) are also
available.
• PIC18F452 has 1CCP and 1 ECCP module.
• To program CCPs, one should have a better
knowledge about PIC18 Timer.
• The allocation of timers among the CCP
features are shown as

• The T3CON register is used to choose the


timer for the compare and capture modes.
CCP registers
• Each CCP module has 3 registers associated
with it :
• CCPxCON
– 8 bit control register.
– We select one of the compare, capture and PWM
modes using this register.
• CCPRxL and CCPRxH form the Low byte and High
byte of the 16 bit register.
• This 16 bit register can be used as a 16 bit compare
register, 16 bit capture register or a 8 bit duty cycle
register by the PWM, but not all at the same time.
CCP1 Control Register
• CCP pins
Compare mode programming
• The compare mode of the CCP module is selected using the select bits in the
CCPxCON register. The Compare mode can cause an event outside the
microcontroller.

• Note that upon match, CCP1IF of the Peripheral Interrupt Flag Register will go
HIGH.
Compare mode Operation
Capture mode Programming
Capture Mode Operation
PWM Programming
ECCP Pins

You might also like