Skip to main content
RRIDDICC
Associate III
May 23, 2025
Solved

what if PA2=5V in analog mode?

  • May 23, 2025
  • 3 replies
  • 521 views

I can c in RM0033 (Rev9) Figure 18, that PA2 is connected with low impedance to a diode to V_DD, if PA2 is configured as analog input...

In Doc ID 15818 Rev 9 I see that R_ADC is at least 1.5kR...

If I connect PA2 in analog mode directly to 5V: Would I create a high current through that diode to V_DD (in my case 3.3V)? Or would the current be less than 1mA (1.4V/1500)? Google's Gemini and DeepSeek say, that that would damage the ADC or its MUX...

In RM0033 (Rev9) Figure 13 it looks like, I can still read the analog value on PA2, if PA2 is configured as digital output (open drain and BSRR|=(1<<2)).

Should I connect PA2 via 50kR to the difficult voltage? I cannot use a voltage divider, because that would interfere with the external pull-up resistor at PA2... I try to read CC1 of a USB-C host port... and DeepSeek says, that the USB-C device might possibly decide to connect CC1 to 5V, although I hoped, that the USB-C cable would not allow that...

Best answer by STOne-32

Dear @RRIDDICC ,

as Explained above if the pin GPIO is configured in Analog Mode , maximum VIN is VDDA/VREF+ + 0.3V . Exceeding that value , a physical damage may happen on Our Analog Circuitry and so whole MCU . Have a look here :

https://www.st.com/resource/en/application_note/an4899-stm32-microcontroller-gpio-hardware-settings-and-lowpower-consumption-stmicroelectronics.pdf

Have a good day,

STOne-32

3 replies

TDK
May 23, 2025

Why not use it as a digital input instead? Dont see analog mode being necessary here.

Datasheet will have limits allowed in analog mode.

"If you feel a post has answered your question, please click ""Accept as Solution""."
RRIDDICC
RRIDDICCAuthor
Associate III
May 24, 2025

CC1 and CC2 can have different voltage levels in the beginning... e. g. appr. 1.7V, which would not allow me to detect, if a device showed up, because VIL is less than 1V at VDD=3.3V...

AScha.3
Super User
May 23, 2025

>what if PA2=5V in analog mode?

cpu is dead.

"If you feel a post has answered your question, please click ""Accept as Solution""."
STOne-32
STOne-32Best answer
Technical Moderator
May 24, 2025

Dear @RRIDDICC ,

as Explained above if the pin GPIO is configured in Analog Mode , maximum VIN is VDDA/VREF+ + 0.3V . Exceeding that value , a physical damage may happen on Our Analog Circuitry and so whole MCU . Have a look here :

https://www.st.com/resource/en/application_note/an4899-stm32-microcontroller-gpio-hardware-settings-and-lowpower-consumption-stmicroelectronics.pdf

Have a good day,

STOne-32