0
\$\begingroup\$

I am trying to design an STM32F411 USB host. I will be connecting it to a USB MIDI device. The USB MIDI device I am using is AKAI Professional MPK Mini MKII which only has 1 USB port both for power and data which means that I need to power the device through USB.

From the STM32F411 datasheet, I have found some relevant circuit schematics:

enter image description here

However, I am unsure about the VBUS part. How am I supposed to power my USB device with microcontroller? My microcontroller logic is +3.3V and USB required +5V. Do I need to power USB device through VBUS pin on the microcontroller?

I have read somewhere that VBUS is used for sensing:

The USB device is bus-powered, VBUS sensing is not mandatory (USB is always connected when the device is powered)

For my application, the microcontroller is going to be host only therefore I assume I don't even need to use the VBUS? Can I just connect the external +5V source to the USB VBUS pin instead?

\$\endgroup\$
1
\$\begingroup\$

You are mixing statements that apply when STM32 is USB device and when it is USB host. Yes, as a USB host, you need to have 5V supply at the connector for the USB device. The datasheet schematic is correct, the VDD is 5V and there is a switch component so MCU can control the port power and safely determine overcurrent situation. But the MCU is the host so it does not need to monitor the 5V supply at the connector with MCU VBUS pin. The 5V at USB connector just happens to be also named as VBUS.

\$\endgroup\$
10
  • \$\begingroup\$ Thanks for replying. What would happen if I supply external +5V supply to 5V pin at the connector? Could you give me an example of the "current limiter power switch" device as I am not able to find something relevant Also, is external oscilator necessary for USB host as I have seen most of the schematics examples use an external oscilator \$\endgroup\$ – Lukas Jul 8 '19 at 13:06
  • \$\begingroup\$ If you just supply 5V to the USB connector, the STM32 cannot turn it on and off to reset the USB device. Best source to find a power switch is to look at STM32 evaluation kit boards, OnSemi and ST current limited power switches are popular there. Do you mean external crystal or external oscillator? Need of an external clock source depends entirely if the internal clock is accurate enough or not, and this reads in the datasheets. I would not spend time thinking about it, I would just put an external crystal there to avoid the issue. \$\endgroup\$ – Justme Jul 8 '19 at 13:48
  • \$\begingroup\$ Thank you very much. \$\endgroup\$ – Lukas Jul 8 '19 at 14:22
  • \$\begingroup\$ I have found an example as such : farnell.com/datasheets/… In the example schematic, the Vin is used as 5V, I assume that this will not do for me as it needs to be powered from the VCC +3.3V ? \$\endgroup\$ – Lukas Jul 8 '19 at 14:32
  • 1
    \$\begingroup\$ Well there are two things. Don't pull up flag to 5V but to 3.3V. Or make sure you use 5V tolerant pin on STM32. Just look at how ST has designed their boards for USB host. \$\endgroup\$ – Justme Jul 8 '19 at 15:16
-1
\$\begingroup\$

You need the voltage converter which will convert 3.3V VDD to 5V required by the USB. Vbus uC pin does not power anything!!!! It is used in the device mode to sense the presence of the USB power.

\$\endgroup\$
8
  • 1
    \$\begingroup\$ Lots of USB devices are powered from VBUS. \$\endgroup\$ – Ben Voigt Sep 22 '19 at 5:00
  • \$\begingroup\$ @benvoigt really? Vbus STm32 uC pin? Show me one. This pin can source 10mA and is 3.3V. So please show me any device powered by this pin \$\endgroup\$ – 0___________ Sep 22 '19 at 6:55
  • \$\begingroup\$ I'm talking about the VBUS pin on the USB connector, not on the microcontroller. If you didn't mean the VBUS-pin-defined-by-the-USB-standard pin, it would be good to be clear (in your answer, not a comment) what pin you are talking about. \$\endgroup\$ – Ben Voigt Sep 22 '19 at 12:10
  • \$\begingroup\$ @benvoigt refer to the orinal question and schematics posted there. Did you dv me? Did you vote to delete my answer? \$\endgroup\$ – 0___________ Sep 22 '19 at 13:33
  • \$\begingroup\$ Referring to the schematic posted in the question, the only appearance of VBUS is on the USB-A connector. That one does need to be supplied with +5V. OP already has a 5V source, and should use that rather than using a boost converter fed by VDD. \$\endgroup\$ – Ben Voigt Sep 22 '19 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.