09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

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.

General-purpose timers (TIM9 to TIM14) <strong>RM0090</strong><br />

Figure 183. Edge-aligned PWM waveforms (ARR=8)<br />

16.4.10 One-pulse mode<br />

Counter register<br />

OCXREF<br />

CCRx=4<br />

CCxIF<br />

OCXREF<br />

CCRx=8<br />

CCxIF<br />

OCXREF ‘<br />

CCRx>8<br />

CCxIF<br />

OCXREF ‘<br />

CCRx=0<br />

CCxIF<br />

One-pulse mode (OPM) is a particular case of the previous modes. It allows the counter to<br />

be started in response to a stimulus and to generate a pulse with a programmable length<br />

after a programmable delay.<br />

Starting the counter can be controlled through the slave mode controller. Generating the<br />

waveform can be done in output compare mode or PWM mode. You select One-pulse mode<br />

by setting the OPM bit in the TIMx_CR1 register. This makes the counter stop automatically<br />

at the next update event UEV.<br />

A pulse can be correctly generated only if the compare value is different from the counter<br />

initial value. Before starting (when the timer is waiting for the trigger), the configuration must<br />

be as follows:<br />

CNT < CCRx≤ ARR (in particular, 0 < CCRx)<br />

Figure 184. Example of one pulse mode.<br />

Counter<br />

493/1416 Doc ID 018909 Rev 3<br />

TI2<br />

OC1REF<br />

OC1<br />

TIM1_ARR<br />

TIM1_CCR1<br />

0<br />

t DELAY<br />

0 1 2 3 4 5 6 7 8 0 1<br />

t PULSE<br />

t

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

Saved successfully!

Ooh no, something went wrong!