Connecting ESP32-S2 to a USB Host Shield

Da Flex
Posts: 19
Joined: Mon Jul 12, 2021 10:32 pm

Connecting ESP32-S2 to a USB Host Shield

Postby Da Flex » Mon May 16, 2022 9:58 pm

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

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

Re: Connecting ESP32-S2 to a USB Host Shield

Postby ESP_Sprite » Tue May 17, 2022 2:43 am

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.

Da Flex
Posts: 19
Joined: Mon Jul 12, 2021 10:32 pm

Re: Connecting ESP32-S2 to a USB Host Shield

Postby Da Flex » Tue May 17, 2022 3:11 am

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.

Da Flex
Posts: 19
Joined: Mon Jul 12, 2021 10:32 pm

Re: Connecting ESP32-S2 to a USB Host Shield

Postby Da Flex » Tue May 17, 2022 11:22 pm

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.

Who is online

Users browsing this forum: Baidu [Spider] and 70 guests