01.06.2014 Views

STM32W108C8

STM32W108C8

STM32W108C8

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>STM32W108C8</strong><br />

General-purpose timers<br />

Figure 35 shows some center-aligned PWM waveforms in an example where:<br />

● TIMx_ARR = 8,<br />

● PWM mode is the PWM mode 1,<br />

●<br />

The output compare flag is set when the counter counts down corresponding to the<br />

center-aligned mode 1 selected for TIM_CMS = 01 in the TIMx_CR1 register.<br />

Figure 35. Center-aligned PWM waveforms (ARR = 8)<br />

Hints on using center-aligned mode:<br />

●<br />

●<br />

When starting in center-aligned mode, the current up-down configuration is used. This<br />

means that the counter counts up or down depending on the value written in the<br />

TIM_DIR bit in the TIMx_CR1 register. The TIM_DIR and TIM_CMS bits must not be<br />

changed at the same time by the software.<br />

Writing to the counter while running in center-aligned mode is not recommended as it<br />

can lead to unexpected results. In particular:<br />

Doc ID 018587 Rev 2 128/215

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!