SLAU846A June 2023 – October 2023 MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G3105 , MSPM0G3105-Q1 , MSPM0G3106 , MSPM0G3106-Q1 , MSPM0G3107 , MSPM0G3107-Q1 , MSPM0G3505 , MSPM0G3505-Q1 , MSPM0G3506 , MSPM0G3506-Q1 , MSPM0G3507 , MSPM0G3507-Q1
Compare mode is selected when TIMx.CCCTL_xy[0/1].COC = 0. Compare mode is used to generate event or PWM output signals at specific time intervals.
Many types of compare mode events can be generated based on the configuration of the CC action control register CCACT_xy[0/1]. A compare event occurs for a CC channel when TIMx.CTR counts up (CCU) or down (CCD) to the value in TIMx.CC_xy[0/1]. Additionally, secondary compare up (CC2U) or down (CC2D) events for a CC channel can be generated from another CC block's CCU or CCD event with respect to its TIMx.CC_xy[0/1] value in the same timer instance. Compare events can be used to generate a timing base internally or generate a PWM output with specific profiles using active, inactive, or toggle action behaviors.
Secondary compare events in up/down counting mode can be used to generate PWM signals with twice the PWM frequency (but half the PWM resolution).
In TIMA only, an additional internal 5th and 6th CC block (TIMA.CC_45[0/1]) can be used for secondary compare events while continuing to use CC channels with dedicated output pins for external PWM signal generation.
Table 25-15 shows the types of compare mode events that can be generated and conditions to generate the events.
Event | Name | Event condition |
---|---|---|
CCDn (n = CC channel) | Capture/compare down event | When timer is counting down, TIMx.CTR = TIMx.CC_xy[0/1] |
CCUn (n = CC channel) | Capture/compare up event | When timer is counting up, TIMx.CTR = TIMx.CC_xy[0/1] |
CC2Dn (n = CC channel) | Secondary capture/compare down event | Occurs when CC2SELD is configured for the source of the CCDn event |
CC2Un (n = CC channel) | Secondary capture/compare up event | Occurs when CC2SELU is configured for the source of the CCUn event |