Skip to main content
Visitor II
March 1, 2023
Solved

Use GPIO Analog for ADC read value on STM32H735

  • March 1, 2023
  • 3 replies
  • 3938 views

Hello,

Is it possible to configure PA10 on STM32H735 as GPIO Analog and use it to read ADC Value ?

The AN4899, 4.3.4 Analog Configuration says :

Few STM32 GPIO pins can be configured in analog mode which allows the use of ADC, DAC, OPAMP, and COMP internal peripherals. To use a GPIO pin in analog mode, the following register are considered:

 - GPIOx_MODER to select the mode (Input, Output, Alternate, Analog)

- GPIOx_ASCR to select the required function ADC, DAC, OPAMP, or COMP

However, I don't think there is the register GPIOx_ASCR in H7 and the reference manual, Figure 77 is not using PA10.

    This topic has been closed for replies.
    Best answer by Peter BENSCH

    Welcome, @Esaab.1​, to the community!

    Well, you can find the available (alternative) functions of the individual GPIO in the data sheet. For PA10, only the following are given in Table 8, which does not contain any ADCx_INxx:

    • TIM1_CH3
    • LPUART1_RX
    • USART1_RX(boot)
    • OTG_HS_ID
    • MDIOS_MDIO
    • LCD_B4
    • DCMI_D1/PSSI_D1
    • LCD_B1
    • EVENTOUT

    PA10 cannot therefore be used as an ADC input.

    Does it answer your question?

    Regards

    /Peter

    3 replies

    Technical Moderator
    March 1, 2023

    Welcome, @Esaab.1​, to the community!

    Well, you can find the available (alternative) functions of the individual GPIO in the data sheet. For PA10, only the following are given in Table 8, which does not contain any ADCx_INxx:

    • TIM1_CH3
    • LPUART1_RX
    • USART1_RX(boot)
    • OTG_HS_ID
    • MDIOS_MDIO
    • LCD_B4
    • DCMI_D1/PSSI_D1
    • LCD_B1
    • EVENTOUT

    PA10 cannot therefore be used as an ADC input.

    Does it answer your question?

    Regards

    /Peter

    Esaab.1Author
    Visitor II
    March 1, 2023

    Hello, thanks for your fast answer @Peter BENSCH​ .

    So what is Gpio analog option in cubeMX?

    Technical Moderator
    March 2, 2023

    The GPIO analogue option is not to be confused with an ADC input, but in principle has two functions:

    • Disconnecting the external pin from the digital function. This is useful, for example, to disconnect the Schmitt trigger present at the digital input from a floating input, because this can lead to high-frequency switching of this trigger with associated current consumption.
    • Connecting any analogue peripherals (e.g. opamp, comparator, ADC) that may be present, but do not necessarily have to be in the respective case.

    If the problem is solved, please mark this thread as answered by selecting Select as best, as also explained here. This will help other users find that answer faster.

    Regards

    /Peter

    Explorer
    January 10, 2024

    Hello @Peter BENSCH could you elaborate a little more on the first point you explained? For example, I need to read digital values ​​with ref voltage such as variable voltage (0.5- 0.7... 1.3v..) from the pin that does not have an ADC input.

    Technical Moderator
    January 10, 2024

    For such tasks you need an external matching circuit, which can be realised e.g. with comparators whose comparison level is generated e.g. by a DAC (if the respective derivative has one).