Code: Select all
import machine
def is_usb_connected():
# SIE_STATUS register, VBUS_DETECTED bit0
return machine.mem32[0x50+0x50110000] & 0x1
Code: Select all
import machine
def is_usb_connected():
# SIE_STATUS register, VBUS_DETECTED bit0
return machine.mem32[0x50+0x50110000] & 0x1
You are completly right. I somehow assumed it was powered by USB directly, rather than via the 3.3V regulator. So yes, for all those HW designs mentioned, there is little benefit in using the code above.How could the MCU know that USB power is powering the regulator unless there is a separate input from USB power to the MCU?
good information, thanks for the pointer. indeed that‘s what I really needed.You might want to have a look at my post