cancel
Showing results for 
Search instead for 
Did you mean: 

Use GPIO Analog for ADC read value on STM32H735

Esaab.1
Associate

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

5 REPLIES 5
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Esaab.1
Associate

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

So what is Gpio analog option in cubeMX?

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

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.

Peter BENSCH
ST Employee

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).

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.