
GD32A50x User Manual
200
configured by a 16-bit counter. When the 16-bit counter equal to zero and decrement, the
timer output switches and the counter is reloaded from the comparison register. When the 16-
bit counter equal to zero and decrement, the timer comparison event occurs and the timer
status flag is set.
8-bit high pwm mode
The 16-bit counter is divided into two 8-bit counters. Low 8 bits are used to configure the timer
outputs high cycle and the high 8-bits are used to configure the timer output low cycle. When
the lower 8 bits are decrement to zero, the timer output is cleared and the lower 8 bits are
reloaded from the comparison register. The high 8-bits decrement when output is low. And
when decrement to zero, the timer output is set, and the high 8-bits will reloaded from the
compare register. When the upper 8-bits equal to zero and decrement and field TMDEC[1:0]
is set as 0b00 or 0b01, a timer comparison event occurs and timer status flag is set.
If the bit
field
TMMOD[1:0]
is
configured
in
PWM
mode,
the
bit
field
TMSTART/TMSTOP[1:0]/TMOUT[1:0] are not supported.
Timer enable and start bit
When the TMMOD[1:0] in MFCOM_TMCTL register is the required configuration mode, and
the condition is detected by the timer configuration (TMEN[2:0]) then the following events
occur.
1.
The timer counter will load the current value of the comparison register and begin to
decrement according to the TMDEC[1:0] configuration.
2.
Based on the TMOUT[1:0] configuration, the timer output is updated to its initial state.
The shifter controlled by this timer will not see this as the rising edge on the timer shift
clock.
3.
As configured by SSTART[1:0], load the shift register from the shift buffer and output the
first bit, or the timer-controlled transfer shifter will output the starting bit value.
When the timer start bit is enabled, the timer is compared on the first rising edge of the shift
clock and the compare register is reloaded. On the shift clock if there is no falling edge before
the first rising edge (TMOUT=1), shifter configured to shift on falling edge and will not load
correctly on the first shift.
Timer decrement and reset
According to the TMMOD[1:0] and TMDEC[1:0] fields, the timer generates the timer output
and the timer shift clock. The shifter clock is either equal to the timer output or equal to the
decrement clock. When TMDEC[1:0] is configured to decrement from a pin or trigger, the
timer will decrement on both rising and falling edges.
In the TMRST[2:0] field the timer is configured to reset then the timer counter will load the
current value of the compare register. The timer shift clock and timer output can be configured
to update on timer reset by TMMOD[1:0]. This can result in a timer shift clock edge if the timer
output toggles as a result of the timer reset. In 8-bit Baud Counter mode, high 8-bit counter