Electronic – Dealing with USB VBUS on a 3.3v board


I have an STM32 board I am currently designing which is going to use the USB bus for communication and programming. The ground connector on the USB will be tied to the board ground, and the D+ and D- lines will go to the STM32's USB_DP and USB_DM with a pull up on the D+ line to signal full speed.

What I want to know is what to do with the USB VBUS line. I have no need for the board to be running off of the 5v USB power, it will always be connected to an external power supply. However I have read that the VBUS line may be important for communications, so I do not want to leave it floating, as that may make the communications inoperable.

What is the best thing to do with the VBUS line in a situation like this?

Best Answer

According to the reference manual for the STM32F205, page 950, you want to do the following:

First, you want to disable the VBUS sensing option. This is done by setting the NOVBUSSENS bit in the OTG_FS_GCCFG register. In this case VBUS is considered internally to always be at VBUS valid level (5 V), so you don't need to run a trace from the VBUS pin on the USB connector over to the STM32F205 at all.

Note: you can also skip this step, and tie VBUS from the connector to the VBUS pin on the STM32F205, keeping the VBUS sensing capability (so, for example, you can tell if a USB cable has just been plugged in). Just don't implement the voltage regulator as shown in Figure 351 of the Reference Manual so your device doesn't try to power itself off the USB.

You can also disable the OTG capability and force a peripheral-only mode by setting the force device mode bit in the GlobalUSB configuration register (FDMOD in OTG_FS_GUSBCFG) to 1, forcing the OTG_FS core to work as a USB peripheral-only.