352
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
mode 1, the compare flag is set when the counter counts down corresponding to TIMx_CTRL1. CAMSEL=01.
Figure 12-18 Center-aligned PWM waveform (AR=8)
Notes that user should know when using center-aligned mode are as follow:
It depends on the value of TIMx_CTRL1.DIR that the counter counts up or down. Cautions that the DIR and
CAMSEL bits should not be changed at the same time.
User should not write the counter while running in center-aligned mode, otherwise it will cause unexpected
results. Here are some example:
If the value written into the counter is 0 or is the value of TIMx_AR, the direction will be updated but the
update event will not be generated.
If the value written into the counter is greater than the value of auto-reload, the direction will not be updated.
To be on the safe side, user is suggested setting TIMx_EVTGEN.UDGN to generate an update by software
before starting the counter, and not writing the counter while it is running.
OCXREF
Counter register
0
1
2
3
4
5
6
7
8
7
6
CCxITF
CCDATx=4
OCXREF
CCxITF
CCDATx=7
OCXREF
CCxITF
CCDATx=8
OCXREF
CCxITF
CCDATx>8
1
1
4
3
2
1
0
1
5
CAMSEL=01
CAMSEL=10
CAMSEL=11
CAMSEL=10
或
11
CAMSEL=01
CAMSEL=10
CAMSEL=11
CAMSEL=01
CAMSEL=10
CAMSEL=11
OCXREF
CCxITF
CCDATx=0
0
CAMSEL=01
CAMSEL=10
CAMSEL=11