ESP32 GPIO Muxing Function posssibilities: I2S, I2C, SPI, UART, int RAM/ROM, touch and some GPIOs

PepeESP32
Posts: 10
Joined: Tue Jun 04, 2019 7:41 am

ESP32 GPIO Muxing Function posssibilities: I2S, I2C, SPI, UART, int RAM/ROM, touch and some GPIOs

Postby PepeESP32 » Tue Jun 04, 2019 8:16 am

Hello ESP developers,

My company and I are defining a System with the following interface needs:
- WiFI/BT (as wireless frontends), both 2.4GHz CoEx
- I2C (System config)
- I2S (or PDM) (ESP32 Audio output to Amplifier/DAC)
- touch button Matrix 2x3 (user input)
- SPI (to config and feed a small LCD/TFT, controllers ST7789H2 or NT7534 or similar)
- UART (debugging mainly)
- some GPIOs for static control (Backlight, audio Amp on/off /mute etc.)

Currently I am planing to use the WROVER Module for this (suggestions welcome)

I am a bit puzzled by the pin mux of the ESP32. Checking the WROVER KIT for the LCD SPI connection and Lyra T Schematics for the I2S interface the IOs seem to spread a bit.

My intent is to use:
- I2C on GPIO 2(SCL), 15 (SDA)
- I2S on GPIO 0 (MCLK), 26 (SDIN), 25 (LR CLK), 5 (SCLK) (unidirectional Audio, no slave audio return)
- VSPI for the display on GPIO 5 (VSPICS0), 18 (VSPICLK), 23 (VSPIData), 19 (VSPIQ(clk)), 22 (VSPIWP), 21 (VSPIHD)
- UART on GPIO 3 (RX), 1 (TX)
- Touch button matrix 2x3 on GPIO 32, 33, 27, 14, 12, (reserve 4 if i need to use 6 buttons directly for simplicity)
- Remaining GPIOs 36 (PA on/off), 13 (LCD Backlight PWM control)

Maybe you can see that come pins are clashing :
- GPIO 5 is used by VSPICS0 and I2S0SCLK

As I plan to use the WROVER Module with RAM and Flash option I need to keep all SDIO pins (GPIO 6-11) and GPIO 16 +17 (PSRAM and Flash clocks) clear as they are used on the module.

Could you support me in assigning the functions I need correctly to the Module?
A Link to VSPI Display Use and I2S Audio IF use and Documentation will probably help a lot.

PS: Display is currently unclear but plan is 128x64 dor matrix monochrome or 170x320 RGB SPI type IPS TFT....a bit of bandwidth needed on SPI.

Thanks!!

Christian

PepeESP32
Posts: 10
Joined: Tue Jun 04, 2019 7:41 am

Re: ESP32 GPIO Muxing Function posssibilities: I2S, I2C, SPI, UART, int RAM/ROM, touch and some GPIOs

Postby PepeESP32 » Wed Jun 05, 2019 12:57 pm

Hello guys,

I guess I overdid a bit with the first request, so I try to simplify.

do you think it is possible from the I/O pinmux point of view to run both I2S AND a VSPI Interface (or other faster SPI IF) for the display in parallel, maybe considering the other interfaces above?

Is there any guide for the WROVER or WROOM Module usable function due to pinmultiplexing?
I only found one for the ESP32 itself.

thanks

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

Re: ESP32 GPIO Muxing Function posssibilities: I2S, I2C, SPI, UART, int RAM/ROM, touch and some GPIOs

Postby ESP_Sprite » Wed Jun 05, 2019 2:00 pm

You should be able (with some speed restrictions on SPI) to mux any I2S/SPI/I2C/UART... pin to any capable GPIO. The only practical restrictions are that GPIO34 and up are input-only, and that some GPIOs also work as a bootstrap pin and as such need to see a defined level on startup. The ESP32 pin mapping docs are valid for the Wroom/Wrover as well as long as you keep in mind that some of the pins are used by the flash inside the module and cannot be used as GPIOs; check the Wrover/Wroom datasheet for more info on that.

PepeESP32
Posts: 10
Joined: Tue Jun 04, 2019 7:41 am

Re: ESP32 GPIO Muxing Function posssibilities: I2S, I2C, SPI, UART, int RAM/ROM, touch and some GPIOs

Postby PepeESP32 » Tue Jun 11, 2019 12:25 pm

Hi ESP Sprite.

Thanks. I know about the limitiations of the SDIO/QSPI interface for external use when internal PSRAM/FLASH is used.
We intend to use RAM/ROM so we preserve for that by not using those pins.

If all others can be used more or less freely than this is good info.

I was concerned if there is special clock tree pins (which there usually are), that you cannot simply route to any GPIO.
Plus - given there is HW support/config for SPI/I2C or other pins - this will limit the GPIO use to the pinmux given.

I hope the pinmux will work out for me :)

Thanks

Who is online

Users browsing this forum: No registered users and 29 guests