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.

Advanced-control timers (TIM1&TIM8) <strong>RM0090</strong><br />

14.3.14 6-step PWM generation<br />

When complementary outputs are used on a channel, preload bits are available on the<br />

OCxM, CCxE and CCxNE bits. The preload bits are transferred to the shadow bits at the<br />

COM commutation event. Thus you can program in advance the configuration for the next<br />

step and change the configuration of all the channels at the same time. COM can be<br />

generated by software by setting the COM bit in the TIMx_EGR register or by hardware (on<br />

TRGI rising edge).<br />

A flag is set when the COM event occurs (COMIF bit in the TIMx_SR register), which can<br />

generate an interrupt (if the COMIE bit is set in the TIMx_DIER register) or a DMA request<br />

(if the COMDE bit is set in the TIMx_DIER register).<br />

Figure 110 describes the behavior of the OCx and OCxN outputs when a COM event<br />

occurs, in 3 different examples of programmed configurations.<br />

Figure 110. 6-step generation, COM example (OSSR=1)<br />

counter (CNT)<br />

OCxREF<br />

Example 1<br />

Example 2<br />

Example 3<br />

COM event<br />

OCx<br />

OCxN<br />

OCx<br />

OCxN<br />

OCx<br />

OCxN<br />

(CCRx)<br />

CCxE=1<br />

write OCxM to 100<br />

CCxNE=0<br />

OCxM=100 (forced inactive)<br />

Write CCxNE to 1<br />

and OCxM to 101<br />

CCxE=1<br />

CCxNE=0<br />

OCxM=100 (forced inactive)<br />

write CCxNE to 0<br />

CCxE=1<br />

and OCxM to 100<br />

CCxNE=0<br />

OCxM=100 (forced inactive)<br />

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

Write COM to 1<br />

CCxE=1<br />

CCxNE=0<br />

OCxM=100<br />

CCxE=0<br />

CCxNE=1<br />

OCxM=101<br />

CCxE=1<br />

CCxNE=0<br />

OCxM=100<br />

ai14910

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

Saved successfully!

Ooh no, something went wrong!