27.4.2.2 32-Bit Timer Mode
The 32-Bit Timer mode is selected when T32 = 1
. In this mode, CCPxTMR
will be used as single 32-bit register.
This mode provides a simple timer function when it is important to track long time
periods. It is useful for the following functions:
- Periodic CPU Interrupts
- Synchronization and Trigger Generation for Other CCP Modules
- Periodic ADC Conversion Triggering
- Periodic Wake from Sleep (if an Appropriate Clock Source is Available)
No input or output functions are available from the CCP module in this operating mode.
When external synchronization is not selected (SYNC[4:0] = 00000
), the
CCPxPR register sets the count period for the timer. A match between the CCPxTMR and the
CCPxPR register also automatically generates the Sync output signal whenever the module
is enabled (CCPON = 1
).
To use the module in 32-Bit Timer mode:
- Set CCSEL =
0
to select the Time Base/Output Compare mode of the module. - Set T32 =
1
to select the 32-bit time base operation. - Set MOD[3:0] =
0000
to select the Time Base mode. - Set SYNC[4:0] to the desired timer synchronization source:
- Configure and enable the external source selected by SYNC[4:0] before enabling the timer.
- If the timer is not using
an external Sync source (SYNC[4:0] =
00000
), or if the module is synchronizing to itself (SYNC[4:0] selects the module’s own value as a Sync source), write the desired count period to CCPxPR.
- Enable the module by setting the CCPON bit.