Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
190
/
631
3. Start counter (TIMx_CTRL1.CNTEN = 1)
After starting the timer, when TI1 detects a rising edge, the counter resets and restarts counting, and the trigger flag
is set (TIMx_STS.TITF=1);
The delay between the rising edge on TI1 and the actual reset of the counter is due to the resynchronization circuit
on TI1 input.
Figure 10-27 Control circuit in reset mode
Slave mode: Trigger mode
In trigger mode, the trigger event (rising edge/falling edge) of the input port can trigger the counter to start counting.
The following is an example of a trigger pattern:
1. Channel 2 is configured as input to detect the rising edge of TI2 (TIMx_CCMOD1.CC2SEL=01,
TIMx_CCEN.CC2P=0);
2. Select from mode to trigger mode (TIMx_SMCTRL.SMSEL=110), select TI2 for trigger input
(TIMx_SMCTRL.TSEL=110);
When TI2 detects a rising edge, the counter starts counting, and the trigger flag is set (TIMx_STS.TITF=1);
The delay between the rising edge on TI2 and the actual start of the counter is due to the resynchronization circuit on
TI2 input.
TI1
Counter register
60 61 62 63 64 65 66 00 01 02 03
01 02 03
00
UDGN
TITF
Counter clock = ck_cnt = ck_psc