GD32A50x User Manual
591
Figure 22-1. CMP block diagram
MISEL[2:0]
PL
000
001
010
011
100
101
000
001
010
011
100
101
110
111
MESEL[2:0]
000
001
010
011
100
101
110
111
PSEL[2:0]
BLK[2:0]
000
001
010
011
Note
: V
REFINT
is 1.2V.
22.3.1.
CMP inputs and outputs
These I/Os must be configured in analog mode in the GPIOs registers before they are
selected as CMP inputs.
Considering pin definitions in datasheet, the CMP output must be connected to corresponding
alternate I/Os.
The timer is internally connected to the output of the comparator to realize the function of
input capture and measurement timing.
In order to work even in deep-sleep mode, the polarity selection logic and the output
redirection to the port work independently from PCLK.
The CMP output can be redirected internally and externally simultaneously.
The CMP output are internally connected to the extended interrupts and events controller.
CMP has its own EXTI line and can generate either interrupts or events. The same
mechanism is used to exit from power saving modes.
22.3.2.
CMP output blanking
In order to prevent the current regulation to trip upon short current spikes at the beginning of
the PWM cycle, the blanking window is selected by software, which is a timer output compare
signal. The CMP outputs final signal is obtained by perfroming an ANDed with the
complementary signal of the blanking signal and the raw output of the comparator.