Page 1 of 1

Connecting ESP32-S2 to a USB Host Shield

Posted: Mon May 16, 2022 9:58 pm
by Da Flex
Hi,
I currently use ESP32-S2 as USB device (GPIO19 and GPIO20). This works fine (detected as USB-MIDI device on my PC).

Now I also want USB host capabilities. So I want to connect this USB host controller by SPI:

https://www.ebay.de/itm/234532559207?ha ... SwWRdibMd6 .

It should work with this driver (part of Arduino IDE's library):

https://github.com/felis/USB_Host_Shield_2.0 .

The above driver documentation says, I should connect like this:
GPIO5 : SS
GPIO17 : INT
GPIO18 : SCK
GPIO19 : MISO
GPIO23 : MOSI
.

This can't be true. I investigated this for ESP32-S2:

GPIO12 : SCK
GPIO13 : MISO
GPIO11 : MOSI .

I have no clue about "SS" and "INT" (I'm no SPI expert). What's the right wiring?


Thank you!
Da Flex

Re: Connecting ESP32-S2 to a USB Host Shield

Posted: Tue May 17, 2022 2:43 am
by ESP_Sprite
The ESP series of chips has a GPIO matrix, that is, you can reconfigure most peripheral signals to use any GPIO pin, so the docs of the driver could be entirely correct. However, given the driver wants to use GPIO19, you may need to modify it to use another pin for that.

Re: Connecting ESP32-S2 to a USB Host Shield

Posted: Tue May 17, 2022 3:11 am
by Da Flex
Thanks. So I think I can order that USB host shield now, because it's compatible with ESP32-S2.

Then I'll have a deeper look at the driver to create proper wiring. I'll report results or problems after this.

Re: Connecting ESP32-S2 to a USB Host Shield

Posted: Tue May 17, 2022 11:22 pm
by Da Flex
Just to solve the above little puzzle:

- SS stands for slave select, which is equal to CS (chip select)
- INT stands for interrupt, and it's not part of the SPI standard definition

It means I can use pre-defined pins GPIO10 - GPIO13 for SPI, and GPIO14 becomes interrupt pin by driver definition.