GD32F20x User Manual
354
3 by the prescaler compared to TIMER_CK (f
CNT_CLK
= f
TIMER_CK
/3).
Timer0’s SMC is set as
event mode, so Timer0 can not be disabled by Timer2’s disable signal. Do as follow:
1.
Configure Timer
2 master mode to send its enable signal as trigger output(MMC=3’b001
in the TIMER2_CTL1 register)
2.
Configure Timer0 to select the input trigger from Timer2 (TRGS
=3’b010 in the
TIMERx_SMCFG register).
3.
Configure
Timer0 in event mode (SMC=3’b 110 in TIMERx_SMCFG register).
4.
Start Timer2 by writing 1 in the CEN bit (TIMER2_CTL0 register).
Figure 18-27. Triggering TIMER0 with enable signal of TIMER2
TIMER_CK
CNT_REG
CNT_REG
CEN
33
11
12
TRGIF
34
35
36
CEN
13
TIMER0
TIMER2
10
software clear
14
hardware set
In this example, we also can use update Event as trigger source instead of enable signal.
Refer to
Figure 18-28. Triggering TIMER0 with update signal of TIMER2
. Do as follow:
1.
Configure Timer2 in master mode and send its update event (UPE) as trigger output
(MMC=
3’b010 in the TIMER2_CTL1 register).
2.
Configure the Timer2 period (TIMER2_CARL registers).
3.
Configure Timer0 to get the input trigger from Timer2 (TRGS=
3’b010 in the
TIMERx_SMCFG register).
4.
Configure Timer0 in event
mode (SMC=3’b110 in TIMERx_SMCFG register).
5.
Start Timer
2 by writing ‘1 in the CEN bit (TIMER2_CTL0 register).
Summary of Contents for GD32F20 Series
Page 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Page 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Page 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Page 385: ...GD32F20x User Manual 385 ...
Page 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...