Counter Mode; Figure 9-3 Counter Timing Diagram With Prescaler Division Change From 1 To 4 - Nations N32G430 Series User Manual

32-bit arm cortex-m4 microcontroller
Table of Contents

Advertisement

Prescaler description
The TIMx_PSC register consists of a 16-bit counter that can be used to divide the counter clock frequency by any
factor between 1 and 65536. It can be changed on the fly as it is buffered. The prescaler value is only taken into
account at the next update event.
Timer Clock = CK_CNT
Counter register
Update event(UEV)
Prescaler controller register
Prescaler counter
Prescaler buffer

Counter mode

Up-counting mode
In up-counting mode, the counter will count from 0 to the value of the register TIMx_AR, then it resets to 0. And a
counter overflow event is generated.
If the TIMx_CTRL1.UPRS bit (select update request) and the TIMx_EVTGEN.UDGN bit are set, an update event
(UEV) will generate. And TIMx_STS.UDITF will not be set by hardware, therefore, no update interrupts or update
DMA requests are generated. This setting is used in scenarios where you want to clear the counter but do not want to
generate an update interrupt.
Depending on the update request source is configured in the TIMx_CTRL1.UPRS. When an update event occurs, all
registers are updated and the TIMx_STS.UDITF is set:
• The repetition counter reloads the contents of the TIMx_REPCNT
• Update auto-reload shadow registers with preload value(TIMx_AR), when TIMx_CTRL1.ARPEN = 1.

Figure 9-3 Counter timing diagram with prescaler division change from 1 to 4

CNTEN
CK_PSC
88
87
0
Write a new value in TIMx_PSC
89 8A 8B 8C
00
3
0
1
2
0
0
Nations Technologies Inc.
216 / 647
Tel:+86-755-86309900
Email:info@nationstech.com
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
01
3
3
0
1
2
3

Advertisement

Table of Contents
loading

Table of Contents