2017-08-22 06:07 AM
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 #usb2017-08-23 03:20 AM
What does the related datasheet say?
JW
2017-08-23 06:02 AM
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 timec) 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?
2017-08-23 06:49 AM
OT: I went for the
(I believe this is the newer, better, shinier) to find out this:JW
2017-08-23 06:56 AM
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.
2017-08-23 07:02 AM
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.
2017-08-23 07:07 AM
More (largely unrelated) doc messup:
2017-08-23 07:14 AM
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
2017-08-23 09:44 AM
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:
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.Id rather ask ST, because I need to know this before I design the PCB. Thank you.
2017-08-23 09:48 AM
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.