cancel
Showing results for 
Search instead for 
Did you mean: 

What is the maximum input voltage that can be applied to my STM32 GPIO?

Stefanie LAU
ST Employee

STM32s are typically composed of a mixture of three-volt (3V) tolerant and five-volt (5V) tolerant GPIOs. Tolerant represents the voltage value which can be accepted by the GPIO. Please be wary of each GPIO's maximum voltage tolerance, as applying more voltage than the GPIO's rated tolerance could severely damage the chip. 
Some uses for 5V tolerant GPIOs include but are not limited to communicating directly with 5V buses (e.g. I2C, UART), 5V ADC conversions, and driving white LEDs. For additional application examples, please review section 5V tolerant application examples within AN4899.
We recommend planning and mapping out each GPIO’s tolerance structures to help you maximize your selected STM32 and its GPIOs’ capabilities.
In this article we will go over how to determine which GPIOs are 3V and 5V tolerant as well as go over the general "rule of thumb" to follow in terms of determining the maximum input voltage that can be applied to the GPIO when the STM32 is powered within the specifications per the part’s datasheet. 


Determining the tolerance of your GPIO: 


As an example, we will use the STM32G0B1CE and will be evaluating the pins PA5 and PE5. 
However, as each STM32 device is unique you will need to refer to your specific STM32’s datasheet as table labeling and content could vary between different devices.


Step 1. Locate your GPIO in the pin assignment and description table within your device’s datasheet.
Using the table below, we can see that PA5 has I/O structure TT_ea:
1100.png
Using the table below, we can see that PE5 has the I/O structure FT:
1102.png
Step 2. Several GPIO structures are available across the range of STM32 devices, and each structure is associated with a list of options. You will want to locate the terms and symbols table or section within your device’s datasheet which summarizes the GPIO definitions and abbreviations applicable to STM32 products.
In the STM32G0B1’s datasheet, the legend to use to decipher the I/O’s structure in Table 11 as shown below:  
1104.png
Step 3. Using the determined I/O structure in step 1 along with I/O structure legend in step 2, decipher the GPIO’s voltage tolerance and if applicable, options.
PA5’s I/O structure is TT_ea. Referring to the table in step 2, we can determine that PA5 is a 3.6V tolerant I/O with both analog switch function and switchable diode to VDDIOx.
PE5’s I/O structure is FT. Referring to the table in step 2, we can determine that PE5 is simply a 5V tolerant I/O with no additional options.


3V tolerant / compliant GPIOs (TT):
In general, the input voltage on 3V tolerant GPIOs cannot exceed VDD+0.3V. Furthermore, this holds true if the pin is used as a GPIO input or as some digital alternate function input (e.g. USART_RX).
However, if some analog input function is enabled on the GPIO (e.g. I/O’s structure is of TT_a with an ADC input active, COMP input, or an OPAMP input), the maximum voltage applied must be less than VDDA (respective of VREF+) + 0.3V. Otherwise, there will be injection into VDDA or VREF+.
The injection current is forbidden because the injection occurs inside the ADC through small parasitic diodes not capable of handling the current. 

This voltage maximum information can be found in AN4899 within the 3V and 5V tolerant section:
1107.png
5V tolerant GPIOs (FT):
These GPIOs are tolerant to VDD + 3.6V, meaning that the I/O pins can accept such voltages without causing leakage current and damages on the GPIOs. Furthermore, this holds true if the pin is used as a GPIO input or as some digital alternate function input (e.g. USART_RX).
However, if some analog input function is enabled on the GPIO (e.g. I/O’s structure is of FT_a, FT_fa, FT_ea, etc. with an ADC input active, COMP input, or an OPAMP input), then the maximum voltage applied must be less than VDDA (respective of VREF+) + 0.3V. Otherwise, there will be injection into VDDA or VREF+. The injection current is forbidden because the injection is inside the ADC where small structures reside and injection current is limited (through small parasitic diode).
This voltage maximum information can be found in AN4899 within the 3V and 5V tolerant section:
1110.png
Step 4. In step 3 we concluded the following about PA5 and PE5:
PA5 is a 3.6V tolerant I/O with both analog switch function and switchable diode to VDDIOx whereas PE5 is simply a 5V tolerant I/O.
This means that my input voltage to PA5 cannot exceed VDD+0.3V. However, I must also remember that if PA5 has some analog input function enabled on it, then my input voltage must be less than VDDA (respective to VREF+) + 0.3V.
As PE5 is a simple FT (5V tolerant) pin without analog functionality, my input voltage for this GPIO can range up to VDD + 3.6V.


Related links

Comments
SKuma.37
Associate

Hi Laura,

Thanks for sharing the required information. Is it possible to get any 5V Supply MCU with same memory and pin out configurations like (STM32L562RET6TR).

Thanks in advance for your kind support.

Regards.

Sendhil kumar.

Stefanie LAU
ST Employee

Hello Sendhil,

I would say that a majority of our MCUs are pin compatible across the board, however to compare other specs such as: memory, peripheral availbility, etc we recommend to use STM32CubeMX's cross selection tool to review comparable MCUs.

You can find an article on how to use STM32's cross selection tool here:

https://community.st.com/s/article/how-to-compare-different-stm32-part-numbers-using-the-cross-selection-tool-of-stm32cubemx

Best Regards,

ST MCU Support Team

Konami
Senior II

Very helpful article, however it doesn't help me understand what the voltage tolerance is for a FT pin that is configured as output (open drain). AN4899 instructs me to refer to the Vin parameters of the datasheet which still shows the same 5V tolerance.

Stefanie LAU
ST Employee

Hi Daniel,

Thanks for your feedback! Agreed on your point as we're currently working with our documentation team to bring up this issue. Hopefully we can add in some additional notes regarding voltage tolerance for a FT pin that is configured as output (open-drain).

To answer your question "what is the voltage tolerance for a FT pin that is configured as output (open-drain)", five-volt tolerant is only in input mode, and a FT_a pin cannot be permanently set to 5V DC in open drain output mode. In this case, the maximum acceptable voltage on an open drain output mode is 3.3V.

Best Regards,

ST MCU Support Team

Konami
Senior II

Thanks for the quick reply! So no margin at all? Not able to handle VDD+0.3?

Stefanie LAU
ST Employee

Hi Daniel,

You're welcome! From the initial question to our design team, it seems like 3.3V is the maximum acceptable voltage and there is no margin. However, I'm double-checking just to be sure on your ask and will let you know as soon as I hear back from them.

Best Regards,

ST MCU Support Team

Konami
Senior II

Thanks! I think it's worth noting that AN4899 actually shows an example of these pins being pulled to 5V for an I2C application (5.3.3) which I would think is using an Open-Drain configuration. It seems odd that it's okay for that application but not for mine

Stefanie LAU
ST Employee

Hi Daniel,

I got some more clarification from our design team on this point, please see below:

- When VDD = 0 (STM32 unsupplied), the maximum acceptable voltage on PB0 is min(VDD + 3.6, 5.5) = 3.6V (even in open-drain mode)

- When VDD = 3.3, the maximum acceptable voltage is then 5.5V

What's important to note is the 5V management:

  1. If VDD Is present before the 5V on your pin, then it should be OK
  2. If VDD is ramping up at the same time as the 5V, then there is no issue either
  3. However, if VDD is coming after the 5V then this could cause damage

Hope that helps clarify!

Best Regards,

ST MCU Support Team

Konami
Senior II

Thanks, that's very helpful! It seems like our worst case is about 2V on the IO while VCC is still 0V. After that, the delta between VDD and IO is only less, and never exceeds the maximum 3.6V.


_legacyfs_online_stmicro_images_0693W00000Sue4WQAR.png

Stefanie LAU
ST Employee

Hi Daniel,

You're welcome!

Best Regards,

ST MCU Support Team

diverger
Senior

@Laura C. It seems the datasheet of the STM32 devices are confused for me. Take Datasheet - STM32G431x6 STM32G431x8 STM32G431xB - Arm® Cortex®-M4 32-bit MCU+FPU, 170 MHz /213 DMIPS, up to 128 KB Flash, 32 KB SRAM, rich analog, math accelerator as example. In Table 14, it states the Max Vin at TT_xx pins is 4V, I will think it can tolerant 4V in any condition, even the device is not powered, right?

LauraCx
ST Employee

Hello @diverger​ ,

@Stefanie LAU​ should be able to help you!

Thanks

Stefanie LAU
ST Employee

Hello @diverger​ ,

In the STM32G0B1CE's datasheet, DS13560 Rev 3 (per the example in the article), table 21 also indicates that the maximum voltage is 4V.

Since the STM32G4xx's allows for a VDD voltage range of 1.71V - 3.6V, for TT_xx pins the input voltage on 3V tolerant GPIOs cannot exceed VDD+0.3V if the pin is used as a GPIO input or as some digital alternate function input.

However, if some analog input function is enabled on the GPIO the maximum voltage applied must be less than VDDA (respective of VREF+) + 0.3V.

Let me double check with our design team and get back to you as soon as possible on the tolerance of TT_xx pins when VDD = 0 (STM32 unsupplied) as it's also not clear to me in our documentation.

Hope that helps!,

ST MCU Support Team

Stefanie LAU
ST Employee

Hello @diverger​,

Thanks for your patience on this as I confirmed with our internal team on the tolerance of TT_xx pins when VDD = 0 (STM32 unsupplied).

Following the device's datasheet (e.g. DS12288), Chapter 5.3.1 General Operating Conditions in Table 17. it's indicated that:

VIN_MIN on TT_xx = -0.3V

VIN_MAX on TT_xx = VDD + 0.3V

In this use case where STM32 is unsupplied (VDD = 0V), that means that VIN max = +0.3V on TT_xx IO.

Hope that helps!,

ST MCU Support Team

Lan
Associate

Hi, ST MCU Support Team, 

In the Datasheet - STM32F103xB, March 2022, PA0 - PA7 are not under FT or TT, but with a "-". 

Could you advise the meaning of this "-"? Does it mean "TT" or others?

Thanks.

Lan

Untitled.jpg

TDK
Guru

On the STM32F103, "-" means not 5V tolerant. The datasheet has specifications for non 5V tolerant pins. No need to bring definitions from other datasheets onto the STM32F1 datasheet. Each stands on their own.

Lan
Associate

Hi, ST MCU Support Team, 

Thanks for your replies.

I am now using the Nucleo - F103RB board. 

I connect PC13 (which is labelled as "-": not 5V tolerant) to below circuit. 

It can work well under mbed studio programming, i.e., button on/off. 

Could you advise what is the actually max input voltage for "not 5V tolerant" pin?

From previous comments here, the max input voltage for "not 5V tolerant" pin seems to be 4V.

But for my below circuit, it can accept 5V. 

Any secret here? 

Thanks.

Lan_0-1693894250823.png

 

Version history
Last update:
‎2024-06-18 01:44 AM
Updated by:
Contributors