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 52. Counter timing diagram with prescaler division change from 1 to 2<br />

CK_PSC<br />

CEN<br />

Timer clock = CK_CNT<br />

Counter register<br />

F7<br />

F8 F9 FA FB FC<br />

00<br />

01 02 03<br />

Update event (UEV)<br />

Prescaler control register 0 1<br />

Write a new value in TIMx_PSC<br />

Prescaler buffer 0 1<br />

Prescaler counter 0 0 1 0 1 0 1 0 1<br />

Figure 53. Counter timing diagram with prescaler division change from 1 to 4<br />

CK_PSC<br />

CEN<br />

Timer clock = CK_CNT<br />

Counter register<br />

F7<br />

F8 F9 FA FB FC 00<br />

01<br />

Update event (UEV)<br />

Prescaler control register 0 3<br />

Write a new value in TIMx_PSC<br />

Prescaler buffer 0 3<br />

Prescaler counter 0 0 1 2 3 0 1 2 3<br />

13.3.2 Counter modes<br />

Upcounting mode<br />

In upcounting mode, the counter counts from 0 to the auto-reload value (content of the<br />

TIMx_ARR register), then restarts from 0 <strong>and</strong> generates a counter overflow event.<br />

If the repetition counter is used, the update event (UEV) is generated after upcounting is<br />

repeated for the number of times programmed in the repetition counter register<br />

(TIMx_RCR). Else the update event is generated at each counter overflow.<br />

Setting the UG bit in the TIMx_EGR register (by software or by using the slave mode<br />

controller) also generates an update event.<br />

The UEV event can be disabled by software by setting the UDIS bit in the TIMx_CR1<br />

register. This is to avoid updating the shadow registers while writing new values in the<br />

Doc ID 13902 Rev 9 257/995

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

Saved successfully!

Ooh no, something went wrong!