GD32VF103 User Manual
242
(CKM) in RCU. The break function is enabled by setting the BRKEN bit in the TIMERx_CCHP
register. The break input polarity is configured by the BRKP bit in TIMERx_CCHP register.
When a break occurs, the POEN bit is cleared asynchronously. As soon as POEN is 0, the
level of the CHx_O and CHx_ON outputs are determined by the ISOx and ISOxN bits in the
TIMERx_CTL1 register. If IOS is 0, the timer releases the enable output, otherwise, the enable
output remains high. The complementary outputs are first in the reset state, and then the dead
time generator is reactivated to drive the outputs with the level programmed in the ISOx and
ISOxN bits after a dead time.
When a break occurs, the BRKIF bit in the TIMERx_INTF register will be set. If BRKIE is 1,
an interrupt will be generated.
Figure 15-19. Output behavior of the channel in response to a break (the break high
active)
OxCPRE
CHx_O
CHx_ON
BRKIN
CHx_O
CHx_ON
CHx_O
CHx_ON
= ISOx
= ISOxN
= ISOx
= ISOxN
CHxEN: 1 CHxNEN: 1
CHxP : 0 CHxNP : 0
ISOx = ~ISOxN
CHxEN: 1 CHxNEN: 0
CHxP: 0 CHxNP : 0
ISOx = ~ISOxN
CHxEN: 1 CHxNEN: 0
CHxP : 0 CHxNP : 0
ISOx = ISOxN
Quadrature decoder
The quadrature decoder function uses two quadrature inputs CI0 and CI1 derived from the
TIMERx_CH0 and TIMERx_CH1 pins respectively to interact with each other to generate the
counter value. Setting SMC=0x01, 0x02, or 0x03 to select that the counting direction of timer
is determined only by the CI0, only by the CI1, or by the CI0 and the CI1. The DIR bit is
modified by hardware automatically during the voltage level change of each direction
selection source. The mechanism of changing the counter direction is shown in.
Counting direction versus encoder signals
. The quadrature decoder can be regarded as
an external clock with a direction selection. This means that the counter counts continuously
from 0 to the counter-reload value. Therefore, users must configure the TIMERx_CAR register