09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Basic timers (TIM6&TIM7) <strong>RM0090</strong><br />

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

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

17.3.2 Counting mode<br />

CK_PSC<br />

CNT_EN<br />

Timer clock = CK_CNT<br />

Counter register<br />

Update event (UEV)<br />

F8 F9 FA FB FC<br />

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

The counter counts from 0 to the auto-reload value (contents of the TIMx_ARR register),<br />

then restarts from 0 and generates a counter overflow event.<br />

An update event can be generate at each counter overflow or by setting the UG bit in the<br />

TIMx_EGR register (by software or by using the slave mode controller).<br />

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

register. This avoids updating the shadow registers while writing new values into the preload<br />

registers. In this way, no update event occurs until the UDIS bit has been written to 0,<br />

however, the counter and the prescaler counter both restart from 0 (but the prescale rate<br />

does not change). In addition, if the URS (update request selection) bit in the TIMx_CR1<br />

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

F7<br />

Prescaler control register 0 1<br />

Write a new value in TIMx_PSC<br />

Prescaler buffer 0 1<br />

CK_PSC<br />

CNT_EN<br />

Timer clock = CK_CNT<br />

Counter register<br />

Update event (UEV)<br />

F7<br />

00<br />

01 02 03<br />

F8 F9 FA FB FC 00<br />

01<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

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

Saved successfully!

Ooh no, something went wrong!