GD32A50x User Manual
201
decrement only occurs when the low 8-bits equal to zero and decrement.
A timer comparison event is triggered when the timer counter decrements to 0. The trigger of
the timer comparison event will cause the timer counter to load the contents of the comparison
register, the timer output to the toggle, the send shift register of any configuration to load, and
the receive shift register of any configuration to store. Depending on the timer mode, can set
the timer status flag.
Timer disable and stop bit
The timer is configured to add a stop bit to each compare, and the following additional events
will occur. When the timer is configured to insert a stop bit on each compare transmit shifters
must be configured to load on the first shift.
1.
Configure SSTOP[1:0] can controlled Transmit shifters will output their stop bit.
2.
Receive shifters controlled by this timer will store the data of the shift register in their shift
buffer, as configured by SSTOP[1:0].
3.
On the first rising edge of the shifter clock after the compare, the timer counter will reload
the current value of the compare register.
When detect the condition configured by timer disable (TMDIS[2:0]), the following events will
occur.
1.
The timer counter will load the current value from the compare register, decrement
according to the configuration of TMDEC[1:0].
2.
The timer output clears shifters controlled by the timer, which do not treat it as a falling
edge on the timer shift clock, but can generate a shift event if the timer shift clock will
generate a shift event.
3.
The transmit shifters controlled by this timer will output their stop values.
4.
The receiving shifter controlled by this timer will store the contents of the shift register
and the shift buffer configured by SSTOP
The timer counter continues to decrease and, if the timer stop bit is enabled, does not end
until the next rising edge of the shifted clock is detected. The timer shift clock can be switched
during the stop bit without generating a shift event. The timer output is forced down during the
stop bit.
In the same cycle as a timer disable condition (stop bit is disabled) timer enable condition can
be detected, or on the first rising edge of the shift clock after the disable condition (stop bit is
enabled). Receive shift registers with stop bit enabled will store the contents of the shift
register into the shift buffer and verify the state of the input data on the configured shift edge
while the timer is in the stop state condition. If the un-configured edge is between the disabled
timer and the next rising edge of the shift clock, the final storage and validation will not occur.
9.4.4.
Pin
Each timer and shifter can be configured for input, output data, output enabled or bidirectional
output. Pins configured to output enable can be used as an open drain or to control the enable