STM32C5 MCU COMP2_IN Pins assignment
Dear Gentlemen,
as a relative beginner using STM32C5 MCU-s,
I need your help to resolve one issue.
Namely,
In new design, where planned MCU is STM32C542CCT6 device, (LQFP48 package),
I plan to use internal Comparator COMP2.
Problem (for me) arises when I have to declare connection between Comparator nodes
(INP- (M), INP + (P) and OUTPUT) with some specific pins on LQFP48 package,
more precisely it would be ideal for me to use
PA7 pin as Comparator2 Output
and pin PA2 as Comparator2 -INPut,
and pin PA3 as Comparator2 +INPut.
In short,
it is not a problem to "connect" Comparator Output, COMP2_OUT as shown in
Table 12 STM32C542xx pin/ball definition, on STM32C542xx data sheet (DS), page 41, or in
Table 13 Alternate functions,
since i will declare AF14 = COMP2_OUT in appropriate GPIOA_AFRL register,
see page 352 in RM0522 Reference manual, (RM)
but I have problem to declare Comparator2 INPut pins, since it is selected thru peripheral registers,
as stated in Table 11 in device DS,
...Additional functions / Functions directly selected/enabled through peripheral registers...
However,
when I look at Comparator2 INPSEL bits, from page 712 in RM
Table 169. COMP implementation non-inverting input assignment for STM32C53x/542
I see three (3) Input signals, with "names"
COMP2_INP1
COMP2_INP2
COMP2_INP3
also,
when I look at Comparator2 INMSEL bits, from page 714 in RM
Table 172. COMP inverting input assignment
I see three (3) Input signals, with "names"
COMP2_INM1
COMP2_INM2
COMP2_INM3
but, in DS page 41,
Pin name PA2 could be connected with Additional functions :
ADC1_IN2,
COMP2_INM,
OPAMP1_VINM0,
TAMP_IN3, WKUP2
my question is, what I have to do,
to "connect" pin PA2 with COMP2_INM, and with one of three(3)
COMP2_INM1
COMP2_INM2
COMP2_INM3 choices ?
Besides, the very same question is :
in DS page 41,
Pin name PA3 could be connected with Additional functions :
ADC1_IN3,
COMP2_INP
my question is, what I have to do,
to "connect" pin PA3 with COMP2_INP, and with one of three(3)
COMP2_INP1
COMP2_INP2
COMP2_INP3 choices ?
Many thanks for your help !

