GD32F20x User Manual
353
Figure 18-26. Timer0 master/slave mode timer example
TIMER0
TIMER 4
Pre scaler
Counter
Master
mode
control
Trigger
selection
ITI0
IT1
ITI1
CI0F_ED
CI0FE0
CI1FE1
ETIFP
TRGS
Slave mode
control
Pre scaler
Counter
TRG O
TIMER 1
Pre scaler
Counter
Master
mode
control
TRG O
TIMER 2
Pre scaler
Counter
Master
mode
control
ITI2
IT1
ITI3
TRG O
TIMER 3
Pre scaler
Counter
Master
mode
control
TRG O
Other interconnection examples:
Timer 2 as prescaler for timer 0
We configure Timer2 as a prescaler for Timer 0. Refer to
Figure 18-26. Timer0 master/slave
for connections. Do as bellow:
1.
Configure Timer2 in master mode and select its update event (UPE) as trigger output
(MMC=3’b010 in the TIMER2_CTL1 register). Then timer2 drives a periodic signal on
each counter overflow.
2.
Configure the Timer2 period (TIMER2_CAR registers).
3.
Select the Timer0 input trigger source from Timer2 (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 in the CEN bit (TIMER0_CTL0 register).
6.
Start Timer2 by writing ‘1 in the CEN bit (TIMER2_CTL0 register).
Start timer0 with timer
2’s Enable/Update signal
In this example, we enable Timer0 with the enable output of Timer2. Refer to
Triggering TIMER0 with enable signal of TIMER2
. Timer0 starts counting from its current
value on the divided internal clock after trigger by timer2 enable output.
When Timer0 receives the trigger signal, its CEN bit is set automatically and the counter
counts until we disable timer0. In this example, both counter clock frequencies are divided by
Содержание GD32F20 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F20x ARM Cortex M3 32 bit MCU User Manual Revision 2 2 Oct 2019 ...
Страница 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Страница 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Страница 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Страница 385: ...GD32F20x User Manual 385 ...
Страница 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...