![GigaDevice Semiconductor GD32F20 Series User Manual Download Page 355](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32f20-series/gd32f20-series_user-manual_2225801355.webp)
GD32F20x User Manual
355
Figure 18-28. Triggering TIMER0 with update signal of TIMER2
TIMER_CK
CNT_REG
CNT_REG
UPE
62
12
TRGIF
63
00
01
02
CEN
13
14
TIMER0
TIMER2
software clear
hardware set
Enable Timer0 count with Timer
2’s enable/O0CPRE signal
In this example, we control the enable of Timer0 with the enable output of Timer2 .Refer to
Figure 18-29. Pause TIMER0 with enable signal of TIMER2
. Timer0 counts on the divided
internal clock only when Timer 2 is enable. Both counter clock frequencies are divided by 3
by the prescaler compared to CK_TIMER (fCNT_CLK = fPCLK /3).
Timer0’s SMC is set as
pause mode, so Timer0 can be enabled/disabled by Ti
mer2’s enable/disable signal. Do as
follow:
1.
Configure Timer2 in input master mode and its output enable signal as trigger output
(MMC=
3’b001 in the TIMER2_CTL1 register).
2.
Configure Timer0 to get the input trigger from Timer2 (TRGS=
3’b010 in the
TIMERx_SMCFG register).
3.
Configure Timer0 in pause mode (SMC=
3’b101 in TIMERx_SMCFG register).
4.
Enable Timer0 by writing ‘1 in the CEN bit (TIMER0_CTL0 register)
5.
Start Timer2 by writing ‘1 in the CEN bit (TIMER2_CTL0 register).
6.
Stop Timer2 by writing ‘0 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 ...