![GigaDevice Semiconductor GD32A50 Series Скачать руководство пользователя страница 359](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32a50-series/gd32a50-series_user-manual_2225782359.webp)
GD32A50x User Manual
359
Figure 18-39. TIMER0 master/slave mode example
TIMER0
TIMER 7
Prescaler
Counter
Master
mode
control
Trigger
selection
ITI0
ITI1
CI0F_ED
CI0FE0
CI1FE1
ETIFP
TRGS
TIMER 1
Prescaler
Counter
Master
mode
control
TRGO
TIMER 19
Prescaler
Counter
Master
mode
control
ITI2
ITI3
TRGO
TIMER 20
Prescaler
Counter
Master
mode
control
TRGO
TRG
MUX
CI2FE2
CI3FE3
MCI0FEM0
MCI1FEM1
MCI2FEM2
MCI3FEM3
TRGO
Other interconnection examples:
TIMER1
as the prescaler for TIMER0
TIMER1 is configured as a prescaler for TIMER0. Refer to
for connections. Steps are shown as follows:
1.
Configure TIMER1 in master mode and select its update event (UPE) as trigger output
(MMC=3’b010 in the TIMER1_CTL1 register). Then TIMER1 drives a periodic signal on
each counter overflow.
2.
Configure TIMER1 period (TIMER1_CAR register).
3.
Select TIMER1 as TIMER0 input trigger source (TRGS=3’b010 in the TIMERx_SMCFG
register).
4.
Configure TIMER0 in external clock mode 0 (SMC=3’b111 in TIMERx_SMCFG register).
5.
Start TIMER0 by writing ‘1’ to the CEN bit (TIMER0_CTL0 register).
6.
Start TIMER1 by writing ‘1’ to the CEN bit (TIMER1_CTL0 register).
Start TIMER0 with TIMER1’s enable signal
First, enable TIMER0 with the enable signal of TIMER1. Refer to
TIMER0 with enable signal of TIMER1
. TIMER0 starts counting from its current value with
the divided internal clock after being triggered by TIMER1 enable signal output.
When TIMER0 receives the trigger signal, its CEN bit is set and the counter counts until
TIMER0 is disabled. Both clock frequency of the counters are divided by 3 from TIMER_CK
(f
PSC_CLK
= f
TIMER_CK
/3). Steps are shown as follows:
1. Configure TIMER1 in master mode to send its enable signal as trigger output