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.

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

Figure 196. Counter timing diagram, update event when ARPE=1 (TIMx_ARR<br />

preloaded)<br />

17.3.3 Clock source<br />

The counter clock is provided by the Internal clock (CK_INT) source.<br />

The CEN (in the TIMx_CR1 register) and UG bits (in the TIMx_EGR register) are actual<br />

control bits and can be changed only by software (except for UG that remains cleared<br />

automatically). As soon as the CEN bit is written to 1, the prescaler is clocked by the internal<br />

clock CK_INT.<br />

Figure 197 shows the behavior of the control circuit and the upcounter in normal mode,<br />

without prescaler.<br />

Figure 197. Control circuit in normal mode, internal clock divided by 1<br />

17.3.4 Debug mode<br />

CK_PSC<br />

CNT_EN<br />

Timer clock = CK_CNT<br />

Counter register<br />

Counter overflow<br />

Update event (UEV)<br />

Update interrupt flag (UIF)<br />

F0<br />

F1 F2 F3 F4 F5 00 01 02 03 04 05 06 07<br />

Auto-reload preload register F5 36<br />

Auto-reload shadow register F5 36<br />

Write a new value in TIMx_ARR<br />

CK_INT<br />

CEN=CNT_EN<br />

UG<br />

CNT_INIT<br />

Counter clock = CK_CNT = CK_PSC<br />

Counter register 31 32 33 34 35 36 00 01 02 03 04 05 06 07<br />

When the microcontroller enters the debug mode (Cortex-M4F core - halted), the TIMx<br />

counter either continues to work normally or stops, depending on the DBG_TIMx_STOP<br />

configuration bit in the DBG module. For more details, refer to Section 33.16.2: Debug<br />

support for timers, watchdog, bxCAN and I2C.<br />

Doc ID 018909 Rev 3 526/1416

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

Saved successfully!

Ooh no, something went wrong!