Are these conditions also applicable to the STM32G4 family? This family has
different/newer IP blocks than some other STM32 families, but I'm away from
my computer and can't check the details now. Maybe raiden00pl knows more.
IIRC he fixed some of my mistakes in the pinmap :-)

IIRC STmicro has somewhere an application note describing the analog
features like OPAMP, COMP, etc, and other features and how they differ from
other STM32 families. That document could come in handy.

Nathan


On Tue, Jun 15, 2021 at 10:51 AM Daniel Pereira Carvalho <
daniel...@gmail.com> wrote:

> Hi,
>
> I'm trying to use the analog comparators of the nucleo-g431kb board.  As a
> reference I'm using the implementation and pin definition of the
> nucleo-f334r8 board. Looking at RM0364 Reference manual section *15.3.2
> COMP pins and internal signals* there is the following
>
> *"The I/Os used as comparators inputs must be configured in analog mode in
> the GPIOs registers."*
>
> But looking at file arch/arm/src/stm32/hardware/stm32f33xxx_pinmap.h the
> comparator inputs are defined as Alternate Functions
>
> /* Comparator Inputs non inverting */
>
> #define GPIO_COMP2_INP     (GPIO_ALT|GPIO_AF8|GPIO_PORTA|GPIO_PIN7)
> #define GPIO_COMP4_INP     (GPIO_ALT|GPIO_AF8|GPIO_PORTB|GPIO_PIN0)
> #define GPIO_COMP6_INP     (GPIO_ALT|GPIO_AF8|GPIO_PORTB|GPIO_PIN11)
>
> /* Comparator Inputs inverting */
>
> #define GPIO_COMP2_INM_1    (GPIO_ALT|GPIO_AF8|GPIO_PORTA|GPIO_PIN2)
> #define GPIO_COMP2_INM_2    (GPIO_ALT|GPIO_AF8|GPIO_PORTA|GPIO_PIN4)
> #define GPIO_COMP4_INM_1    (GPIO_ALT|GPIO_AF8|GPIO_PORTB|GPIO_PIN2)
> #define GPIO_COMP4_INM_2    (GPIO_ALT|GPIO_AF8|GPIO_PORTA|GPIO_PIN4)
> #define GPIO_COMP6_INM_1    (GPIO_ALT|GPIO_AF8|GPIO_PORTA|GPIO_PIN4)
> #define GPIO_COMP6_INM_2    (GPIO_ALT|GPIO_AF8|GPIO_PORTB|GPIO_PIN15)
>
> From the STM32F334x8 datasheet, Table 14  Alternate functions, there are no
> corresponding definitions to configure comparator inputs on AF8.
>
> These definitions correct? Or I am understanding something wrong.
>
> Thanks
>
> Daniel Pereira de Carvalho
>

Reply via email to