Hello,
I am using ESP32 WEMOS LOLIN32 board.
The project I am developing is using an external battery to run. I am trying to use USB connection only for charging the battery, and to stop the program execution when it is connected.
Is there any solution to detect (pin, register, interrupt, etc) if USB is connected without changing the hardware (soldering wires to VBUS)?
I can't find anywhere on the internet this information.
Thank you!
Detect if USB is connected
Re: Detect if USB is connected
Hi CtnAdrian,
On the ESP32 development boards, USB is provided by an external component, usually a CP2102, CP2104 or FT223H chip. These chips do have outputs to indicate whether USB is connected (check respective datasheets). However on all the boards I know these outputs are not wired to the ESP32. You might be able to solder a wire from the respective USB-UART chip pad to one of the ESP32 inputs.
On the ESP32 development boards, USB is provided by an external component, usually a CP2102, CP2104 or FT223H chip. These chips do have outputs to indicate whether USB is connected (check respective datasheets). However on all the boards I know these outputs are not wired to the ESP32. You might be able to solder a wire from the respective USB-UART chip pad to one of the ESP32 inputs.
Who is online
Users browsing this forum: No registered users and 49 guests