307
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
Bit field
Name
Description
10: Center-aligned mode 2. The counter counts in center-aligned mode, and the output compare
interrupt flag bit is set to 1 when up-counting.
11: Center-aligned mode 3. The counter counts in center-aligned mode, and the output compare
interrupt flag bit is set to 1 when up-counting or down-counting.
Note: Switching from edge-aligned mode to center-aligned mode is not allowed when the counter
is still enabled (TIMx_CTRL1.CNTEN = 1).
4
DIR
Direction
0: Up-counting
1: Down-counting
Note: This bit is read-only when the counter is configured in center-aligned mode or encoder
mode.
3
ONEPM
One-pulse mode
0: Disable one-pulse mode, the counter counts are not affected when an update event occurs.
1: Enable one-pulse mode, the counter stops counting when the next update event occurs
(clearing TIMx_CTRL1.CNTEN bit)
2
UPRS
Update request source
This bit is used to select the UEV event sources by software.
0: If update interrupt or DMA request is enabled, any of the following events will generate an
update interrupt or DMA request:
–
Counter overflow/underflow
–
The TIMx_EVTGEN.UDGN bit is set
–
Update generation from the slave mode controller
1: If update interrupt or DMA request is enabled, only counter overflow/underflow will generate
update interrupt or DMA request
1
UPDIS
Update disable
This bit is used to enable/disable the Update event (UEV) events generation by software.
0: Enable UEV. UEV will be generated if one of following condition been fulfilled:
–
Counter overflow/underflow
–
The TIMx_EVTGEN.UDGN bit is set
–
Update generation from the slave mode controller
Shadow registers will update with preload value.
1: UEV disabled. No update event is generated, and the shadow registers (AR, PSC, and
CCDATx) keep their values. If the TIMx_EVTGEN.UDGN bit is set or a hardware reset is
issued by the slave mode controller, the counter and prescaler are reinitialized.
0
CNTEN
Counter Enable
0: Disable counter
1: Enable counter
Note: external clock, gating mode and encoder mode can only work after TIMx_CTRL1.CNTEN
bit is set in the software. Trigger mode can automatically set TIMx_CTRL1.CNTEN bit by
hardware
.