![GigaDevice Semiconductor GD32E23 Series Скачать руководство пользователя страница 393](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32e23-series/gd32e23-series_user-manual_2225794393.webp)
GD32E23x User Manual
393
value. And CHxIF is asserted. If the CHxIF is high, the CHxOF will be asserted also. The
interrupt and DMA request will be asserted based on the configuration of CHxIE and
CHxDEN in TIMERx_DMAINTEN
Direct generation
: if you want to generate a DMA request or Interrupt, you can set CHxG by
software directly.
The channel input capture function can be also used for pulse period measurement from
signals on the TIMERx_CHx pins. For example, PWM signal connects to CI0 input. Select
CI0 as channel 0 capture signals by setting CH0MS
to 2’b01 in the channel control register
(TIMERx_CHCTL0) and set capture on rising edge. The counter is set to restart mode and is
restarted on channel 0 rising edge. Then the TIMERX_CH0CV can measure the PWM
period.
Channel output compare function
Figure 14-77.
Channel output compare principle
(with complementary output, x=0)
Capture/
compare register
CH0CV
Counter
o
u
tp
u
t
co
m
p
a
ra
to
r
Compare
output control
CH0COMCTL
CNT>CH0CV
CNT=CH0CV
CNT<CH0CV
Output
complementary
protection
register
&Dead-Time
Output enable
and polarity
selector
CH0P,CH0NP
CH0E,CH0NE
O0CPRE
CH0_O
CH0_ON
Figure 14-77. Channel output compare principle (with complementary output,
show the principle circuit of channels output compare function. The relationship between
the channel output signal CHx_O/CHx_ON and the OxCPRE signal (more details refer to
) is described as blew: The active level of O0CPRE is high,
the output level of CH0_O/CH0_ON depends on OxCPRE signal, CHxP/CHxNP bit and
CH0E/CH0NE bit (please refer to the TIMERx_CHCTL2 register for more details). For
examples, configure CHxP=0 (the active level of CHx_O is high, the same as OxCPRE),
CHxE=1 (the output of CHx_O is enabled):
If the output of OxCPRE is active(high) level, the output of CHx_O is active(high) level;
If the output of OxCPRE is inactive(low) level, the output of CHx_O is active(low) level.
Configure CHxNP=0 (the active level of CHx_ON is low, contrary to OxCPRE), CHxNE=1
(the output of CHx_ON is enabled):
If the output of OxCPRE is active(high) level, the output of CHx_O is active(low) level;
If the output of OxCPRE is inactive(low) level, the output of CHx_O is active(high) level.
When CH0_O and CH0_ON are output at the same time, the specific outputs of CH0_O and
CH0_ON are related to the relevant bits (ROS, IOS, POE and DTCFG bits) in the
TIMERx_CCHP register. Please refer to
Channel output complementary PWM
for more
details.
In output compare mode, the TIMERx can generate timed pulses with programmable
position, polarity, duration and frequency. When the counter matches the value in the