2015-09-01 01:23 PM
I am planning to use STM32L4 on a device powered by two alkaline batteries, and I'd like to use USB OTG. After reading the docs, i have came across a few problems:
The first problem is the limitation regarding the 5V tolerance on VBUS (PA9). This is the problem described in/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F105%20PA9OTG_FS_VBUS%20Issues&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=1796
(but the thread deviates to another problem related to the bootloader). Basically, the PINs are 5V tolerant only when power is applied to the chip. In my case, if the USB plug is attached to a device that contains no batteries, 5V will be applied to PA9 while no power is provided to the chip (until the external USB regulator that takes over the batteries starts, but it takes a few ms). The first idea is using a resistor between VBUS and PA9, but if we use USB OTG with SRP, is it still relevant ? The USB PHY charges and discharges VBUS through PA9, right ? So a high value resistor would defeat this purpose. I tried to imagine a simple way using a mosfet driven only when the chip is powered, but it is not that easy, since current can flow both ways and VBUS can go down to 0V. Commerically available analog switches also limit the input voltages to the supply voltages, so the problem remains. Is there a simple solution ?The second problem is when the device acts as a USB A-device. VDD is provided from two batteries (so from ~1.8V to ~3.0V). I plan to power only VDDUSB through a tiny boost regulator (at 3.3V) to make the design as efficient as possible. Then I came across the errata and problem 2.1.3 (Some I/Os must not be used as output when VDDUSB > VDD + 0.6 V). Does the usage of PA9 as OTG_FS_VBUS count as an output ? Does it fall into this limitation ? What magnitude is the leakage ? In this case, is powering the whole chip at 3.3V when I use USB OTG the only solution ? I saw this is fixed for silicon rev 4, but I don't know yet which revision my sample chips will be.An additional question: what is the consumption on VDDUSB ? I saw on the datasheet that the OTG_FS consumes 23.2µA/MHz (independant clock domain) + 16.4µA/MHz (AHB), but is it through VDD or VDDUSB ?Thanks null2015-09-02 01:30 PM
Regarding the first problem, here is what I came up with. I must say I am quite proud of it...