SLAU893B October 2023 – July 2024 MSPM0C1103 , MSPM0C1103-Q1 , MSPM0C1104 , MSPM0C1104-Q1
The Up/Down counting mode can count in an down-up direction or an up-down direction depending on TIMx.CTRCTL.CVAE value. The TIMx.CTRCTL.CVAE bits specify the initialization condition of the counter.
TIMx.CTRCTL.CVAE Value | Counter Value After Enable |
---|---|
0x0 | Load Value |
0x1 | No Change |
0x2 | Zero |
When TIMx.CTRCTL.CVAE = 0, TIMx.CTR is set to TIMx.LOAD register value and TIMx counts in the down direction. When it reaches zero, a Zero event is generated and TIMx counts back up to TIMx.LOAD value. A Load event is generated when it reaches TIMx.LOAD value.
Figure 15-7 shows TIMx counting in the down-up direction when TIMx.CTRCTL.CVAE = 0.
When TIMx.CTRCTL.CVAE = 2, TIMx.CTR is set to zero and TIMx counts in the up direction. When it reaches TIMx.LOAD, a Load event is generated and TIMx counts back down to zero. A Zero event is generated when it reaches zero.
Figure 15-8 shows TIMx counting in up-down direction when TIMxCTRCTL.CVAE = 2.