29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

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.

RM0008<br />

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

Figure 70.<br />

Counter timing diagram, Update event with ARPE=1 (counter overflow)<br />

CK_PSC<br />

CEN<br />

Timer clock = CK_CNT<br />

Counter register<br />

F7<br />

F8 F9 FA FB FC 36 35 34 33 32 31 30 2F<br />

Counter overflow<br />

Update event (UEV)<br />

Update interrupt flag (UIF)<br />

Auto-reload preload register FD 36<br />

Write a new value in TIMx_ARR<br />

Auto-reload active register FD 36<br />

13.3.3 Repetition counter<br />

Section 13.3.1: Time-base unit describes how the update event (UEV) is generated with<br />

respect to the counter overflows/underflows. It is actually generated only when the repetition<br />

counter has reached zero. This can be useful when generating PWM signals.<br />

This means that data are transferred from the preload registers to the shadow registers<br />

(TIMx_ARR auto-reload register, TIMx_PSC prescaler register, but also TIMx_CCRx<br />

capture/compare registers in compare mode) every N counter overflows or underflows,<br />

where N is the value in the TIMx_RCR repetition counter register.<br />

The repetition counter is decremented:<br />

● At each counter overflow in upcounting mode,<br />

● At each counter underflow in downcounting mode,<br />

● At each counter overflow <strong>and</strong> at each counter underflow in center-aligned mode.<br />

Although this limits the maximum number of repetition to 128 PWM cycles, it makes it<br />

possible to update the duty cycle twice per PWM period. When refreshing compare<br />

registers only once per PWM period in center-aligned mode, maximum resolution is<br />

2xT ck , due to the symmetry of the pattern.<br />

The repetition counter is an auto-reload type; the repetition rate is maintained as defined by<br />

the TIMx_RCR register value (refer to Figure 71). When the update event is generated by<br />

software (by setting the UG bit in TIMx_EGR register) or by hardware through the slave<br />

mode controller, it occurs immediately whatever the value of the repetition counter is <strong>and</strong> the<br />

repetition counter is reloaded with the content of the TIMx_RCR register.<br />

Doc ID 13902 Rev 9 265/995

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

Saved successfully!

Ooh no, something went wrong!