GD32A50x User Manual
435
Mode Selection
Source Selection
Polarity Selection
Filter and Prescaler
Exam3
The counter will start
to count when a rising
edge of trigger input
comes.
ETIFP is selected. ETI does not change.
divided by 2.
ETFC = 0, ETI does not
filter.
Figure 18-59. Event mode
TIMER_CK
CNT_REG
5E
5F
60
61
ETI
TRGIF
ETIFP
Single pulse mode
Single pulse mode is opposite to the repetitive mode, which can be enabled by setting SPM
in TIMERx_CTL0. When you set SPM, the counter will be clear and stop when the next update
event. In order to get pulse waveform, you can set the TIMERx to PWM mode or compare by
CHxCOMCTL.
Once the timer is set to the single pulse mode, it is not necessary to configure the timer enable
bit CEN in the TIMERx_CTL0 register to 1 to enable the counter. Setting the CEN bit to 1 or
a trigger signal edge can generate a pulse and then keep the CEN bit at a high state until the
update event occurs or the CEN bit is written to 0 by software. If the CEN bit is cleared to 0
by software, the counter will be stopped and its value will be held.
In the single pulse mode, the active edge of trigger which sets the CEN bit to 1 will enable the
counter. However, there exists several clock delays to perform the comparison result between
the counter value and the TIMERx_CHxCV value. After a trigger rising occurs in the single
pulse mode, the OxCPRE signal will immediately be forced to the state which the OxCPRE
signal will change to, as the compare match event occurs without taking the comparison result
into account.