USB on esp32-s3 wroom

qheinal
Posts: 25
Joined: Tue Feb 20, 2024 4:38 pm

USB on esp32-s3 wroom

Postby qheinal » Sun Mar 31, 2024 5:04 pm

I have some esp32-s3-wroom-1u modules and was wondering if its okay to connect esp32s usb data (dp and dm) pins directly to hosts data pins. Since esp32 is 3.3v device while host pc is a 5v device doesnt esp32 need a level shifter? I have seen online that others have just connected them directly to usb ports data pins. It would make sense if esp32 has an internal level shifter but im not sure.

Another question is how does the otg work on it. On cellphones with otg support and using usb micro B port ,shorting the ID pin to ground switches a device to otg mode. How does it work for esp32 s3?

ESP_Sprite
Posts: 9727
Joined: Thu Nov 26, 2015 4:08 am

Re: USB on esp32-s3 wroom

Postby ESP_Sprite » Mon Apr 01, 2024 1:48 am

qheinal wrote:
Sun Mar 31, 2024 5:04 pm
I have some esp32-s3-wroom-1u modules and was wondering if its okay to connect esp32s usb data (dp and dm) pins directly to hosts data pins. Since esp32 is 3.3v device while host pc is a 5v device doesnt esp32 need a level shifter? I have seen online that others have just connected them directly to usb ports data pins. It would make sense if esp32 has an internal level shifter but im not sure.
The data lines of USB are always 3.3V, so that will work. An USB host will output 5V to power a device, so if you want to use that, you'll need a LDO or something to get it down to 3.3V.
Another question is how does the otg work on it. On cellphones with otg support and using usb micro B port ,shorting the ID pin to ground switches a device to otg mode. How does it work for esp32 s3?
It depends on the stack that you use, but in most cases people hardcode the program running on the ESP32 to either run as a device or as a host. I think you can do full OTG, but it's normally not necessary.

qheinal
Posts: 25
Joined: Tue Feb 20, 2024 4:38 pm

Re: USB on esp32-s3 wroom

Postby qheinal » Mon Apr 01, 2024 2:19 am

Since USB Signaling is indeed 3.3v then It makes sense that it wouldn't need level shifting. Also it makes sense why if VBus shorts to data pins it can damage the usb controllers on electronics.

Its kinda funny how I've written host/device drivers for baremetal but i didnt know usb signaling was actually 3.3v not 5v. Even when reading the usb docs it didnt say that.

Who is online

Users browsing this forum: No registered users and 91 guests