GD32VF103 User Manual
239
has several types of output function. These include keeping the original level by configuring
the CHxCOMCTL field to 0x00, setting to high by configuring the CHxCOMCTL field to 0x01,
setting to low by configuring the CHxCOMCTL field to 0x02 or toggling signal by configuring
the CHxCOMCTL field to 0x03 when the counter value matches the content of the
TIMERx_CHxCV register.
The PWM mode 0/PWM mode 1 output is another output type of OxCPRE which is setup by
configuring the CHxCOMCTL field to 0x06/0x07. In these modes, the OxCPRE signal level is
changed according to the counting direction and the relationship between the counter value
and the TIMERx_CHxCV content. Refer to the definition of relative bit for more details.
Another special function of the OxCPRE signal is a forced output which can be achieved by
configuring the CHxCOMCTL field to 0x04/0x05. The output can be forced to an
inactive/active level irrespective of the comparison condition between the values of the
counter and the TIMERx_CHxCV.
Configure the CHxCOMCEN bit to 1 in the TIMERx_CHCTL0 register, the OxCPRE signal
can be forced to 0 when the ETIFP signal derived from the external ETI pin is set to a high
level. The OxCPRE signal will not return to its active level until the next update event occurs.
Complementary outputs
Function of complementary is for a pair of channels, CHx_O and CHx_ON, the two output
signals cannot be active at the same time. The TIMERx has 4 channels, but only the first
three channels have this function. The complementary signals CHx_O and CHx_ON are
controlled by a group of parameters: the CHxEN and CHxNEN bits in the TIMERx_CHCTL2
register, the POEN, ROS and IOS bits in the TIMERx_CCHP register, ISOx and ISOxN bits
in the TIMERx_CTL1 register. The output polarity is determined by CHxP and CHxNP bits in
the TIMERx_CHCTL2 register.