287
/
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
Examples of center-aligned PWM waveforms is as follow, and the setting of the waveform are: TIMx_AR=8, PWM
mode 1, the compare flag is set when the counter counts down corresponding to TIMx_CTRL1. CAMSEL=01.
Figure 11-22 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.
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