
GD32A50x User Manual
360
(MMC=3’b001 in the TIMER1_CTL1 register).
2.
Select TIMER1 as TIMER0 input trigger source (TRGS=3’b010 in the TIMERx_SMCFG
register).
3. Configure TIMER0 in event mode
(SMC=3’b110 in TIMERx_SMCFG register).
4. Start TIMER1 by writing 1 to the CEN bit (TIMER1_CTL0 register).
Figure 18-40. Triggering TIMER0 with enable signal of TIMER1
TIMER_CK
CNT_REG
CNT_REG
CEN
61
62
63
11
12
13
TRGIF
14
TIMER1
TIMER0
Using an external trigger to start two timers synchronously.
The start of TIMER0 is triggered by the enable signal of TIMER1, and TIMER1 is triggered by
its CI0 input rising edge. To ensure that two timers start synchronously, TIMER1 must be
configured in master/slave mode. Steps are shown as follows:
1.
Configure TIMER1 in slave mode, and select CI0F_ED as the input trigger (TRGS=3’b100
in the TIMER1_SMCFG register).
2.
Configure TIMER1 in event mode (SMC=3’b110 in the TIMER1_SMCFG register).
3.
Configure TIMER1 in master/slave mode by writing MSM=1 (TIMER1_SMCFG register).
4.
Select TIMER1 as TIMER0 input trigger source (TRGS=3’b010 in the TIMERx_SMCFG
register).
5.
Configure TIMER0 in event mode (SMC=3’b110 in the TIMER0_SMCFG register).
When the CI0 signal of TIMER1 generates a rising edge, two timer counters start counting
synchronously with the internal clock and both TRGIF flags are set.