cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 and 5V tolerant GPIOs for USB usage

ELowe
Associate III

Hi!

I have STM32F469 and I am analysing how to connect an USB port to it.

My MCU will act as a device. PC will be the host.

My MCU has power supply equal to 3.3V which is created via LDO which is independently powered (not from VBUS, from host’s USB).

MCU sits on a PCB with rest of the components which are hungry for power. I presume the whole circuit will sink minimum 1A at 3.3VDC, or even more.

Problem is how to protect 5V-tolerant GPIOs (used for D+ and D- USB lines) from injected current in case my MCU is unpowered and somebody connects it via USB port to a alive host.

AN4899 has a solution for this in form of Zenner diodes. This are the extracts:

ELowe_0-1701251233613.png

 

ELowe_1-1701251233641.png

 

..now there are 2 questions:

  • What do they want to say with connecting 5V VBUS directly to MCU (green circle)? MCU supports only 3.3VDC.
  • This is nicely thought out, but I don’t see how this is going to solve my problem because:

Zenner diode can have voltage drop of 3.3V, but Zenner diode also requires this external resistor. This resistor should limit the current so Zenner does not burn up. Resistor will also have some kind of voltage drop, so final voltage difference between MCU’s GPIO and MCU’s VDD will be 3.3V + voltage drop on resistor, so MCU’s input will be on a higher voltage than specified 3,6V. As I see it, voltage drop on resistor should be exactly 5V – 3,3V = 1,7V, and have resistance equal to 1,7V / (Zenner diode’s rated reverse current). Now the Zenner diode will be protected but my MCU’s input will be fried because of 5V difference between Vdd and GPIO.

Any thoughts?

1 ACCEPTED SOLUTION

Accepted Solutions
LCE
Principal

I'm not 100% sure, but I think that the differential USB data line is working with 3.3V, so there's no need to use more than the typical ESD protection.

View solution in original post

4 REPLIES 4
Peter BENSCH
ST Employee

The reference in AN4899, section 5.3.5 is only an example, which is why no component parameters are specified there. The meaning of the example could now be discussed, but perhaps it is more helpful to concentrate on practical solutions such as those in figure 12 of the same section?

Otherwise, a similar discussion has already been held here in the community, which also refers to this thread.

Hope that helps?

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.
LCE
Principal

I'm not 100% sure, but I think that the differential USB data line is working with 3.3V, so there's no need to use more than the typical ESD protection.

TDK
Guru

LCE is right. USB signals are max 3.6V, so no protection is needed.

TDK_0-1701266097538.png

Could also consider putting a schottky from VDD to your supply rail, but of course 1A is too much to pull from USB. Perhaps two different supply rails, one that powers the CPU and can be powered from USB or externally and one that powers everything else, not powered from USB.

 

If you feel a post has answered your question, please click "Accept as Solution".
ELowe
Associate III

Thanks, I now understand that I only need to figure out how to sense connection of USB socket, and that can be done via voltage divider circuit.

DP and DN are no problem because they are lower than 3.6V.