cancel
Showing results for 
Search instead for 
Did you mean: 

VDDUSB connection

Posted on August 22, 2017 at 15:07

Hello there,

I have a question regarding VDDUSB connection in STM32L452 MCU. Should it be applied all the time, or only when the USB cable is being connected? I was wondering either it is possible to apply it from the USB cable (with 5 V to 3.3 V conversion) because the device normally runs on battery and I dont want to power the USB module for the time of no USB connection if that is possible. If such solution would be considered, should one reinitialize the USB module in software each time USB is connected? In F4 device there was a dedicated pin for notifying the device that USB was connected. In STM32L4 there are only D+/D- lines available.

I would appreciate all help regarding this issue.

#vdd #stm32l4 #usb
11 REPLIES 11
Posted on August 23, 2017 at 12:20

What does the related datasheet say?

JW

Posted on August 23, 2017 at 13:02

I found couple things (DocID027294 Rev 2):

The V DDUSB voltage level is independent from the VDD voltage and should preferably be connected to VDD when the USB is not used.The following sequence must be done before using the USB_FS peripheral:

1. If V DDUSB is independent from V DD : (a)

a) Enable the PVM1 by setting PVME1 bit in the Power control register 2 (PWR_CR2).

b) Wait for the PVM1 wakeup time

c) Wait until PVMO1 bit is cleared in the Power status register 2 (PWR_SR2).

d) Optional: Disable the PVM1 for consumption saving.

2. Set the USV bit in the Power control register 2 (PWR_CR2) to remove the V DDUSB power isolation.

STM32L4452 has no USB detect line. In this case I assume I would need an additional external interrupt line in order to find out that a USB host was connected. I would then have to follow the steps from above point 1 and 2. Is that correct? I wonder either it is worth the hassle is software. Because if the USB peripheral powered and turned on permanently does not consume significant current, maybe its not needed to turn it off at all? But where to find the information on current usage of the USB peripheral?

What do you think?

Posted on August 23, 2017 at 13:49

OT: I went for the

http://www.st.com/content/ccc/resource/technical/document/reference_manual/group0/b0/ac/3e/8f/6d/21/47/af/DM00151940/files/DM00151940.pdf/jcr:content/translations/en.DM00151940.pdf

(I believe this is the newer, better, shinier) to find out this:0690X00000607z5QAA.png

JW

Posted on August 23, 2017 at 13:56

I have moved to this datasheet now as well. I am not sure what is on page 57 that would reffer to my problem? The parts I found in RM0393 are the same in provided by you RM0394.

Posted on August 23, 2017 at 14:02

No, it's not related; I just highlighted that the bookmarks are messed up and the messup appears to start at page 57. Sorry for confusion.

Posted on August 23, 2017 at 14:07

More (largely unrelated) doc messup:

0690X00000607gyQAA.png
Posted on August 23, 2017 at 14:14

1. Use PVM1 -> EXTI38 for detecting VBUS (i.e. host/cable attachment)

2. I don't see separate USB-PHY consumption numbers in the DS which is a pity (ask ST if you are curious); it may or may not be neglectable but that should be pretty easy to measure once the VDDUSB pin is separate.

JW

Posted on August 23, 2017 at 16:44

1. Use PVM1 -> EXTI38 for detecting VBUS (i.e. host/cable attachment)

Is this some kind of acronym? Because I cannot find any mention of EXTI38 in the datasheet nor the library. Could you elaborate?

Edit: Ok, I think I understand. This is an internal interrupt source. But this is not configurable in the MX cube right?

Also I think there might be another error in the datasheet, because it says EXTI35 in here:

0690X00000607zjQAA.png2. I don't see separate USB-PHY consumption numbers in the DS which is a pity (ask ST if you are curious); it may or may not be neglectable but that should be pretty easy to measure once the VDDUSB pin is separate.

Id rather ask ST, because I need to know this before I design the PCB. Thank you.

Posted on August 23, 2017 at 16:48

Is this some kind of acronym? Because I cannot find any mention of EXTI38 in the datasheet nor the library. Could you elaborate?

Here's a quote from the RM:

Each PVM output is connected to an EXTI line and can generate an interrupt if enabled

through the EXTI registers.

Your controller's EXTI number for PVM1 can be different. In my case it's EXTI35. Search for 'PVM features' table in the RM.