ESP32 S2 WROOM - UART RTS and CTS

seners
Posts: 2
Joined: Sun Jun 12, 2022 11:06 pm

ESP32 S2 WROOM - UART RTS and CTS

Postby seners » Sun Jun 12, 2022 11:21 pm

Hi,

I am highly confused with UART wiring from ESP32-S2-WROOM to my host device.

The host device requires RX, TX, RTS and CTS. Since I am using UART0 for programming, I want to use UART1 for communication between my host device and ESP32.

From some reference schematics and by googling, I figured that I can use

Code: Select all

GPIO33 as RX and GPIO34 as TX
. So, now my question, what pins can I use for RTS and CTS?

When I read the datasheet, seems to be, most of the GPIO pins can be set as UART1 by muxing.
Besides, if I look at the datasheet, I am supposed to use GPIO17,18,19 and 20 for this.

But, anyway. long story short, I would like to use RTS and CTS within UART1 next to GPIO33 an dGPIO34.

Any input highly appreciated.

Best regards,
Sener

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

Re: ESP32 S2 WROOM - UART RTS and CTS

Postby ESP_Sprite » Mon Jun 13, 2022 2:32 am

You can use any GPIO, indeed (given they're not used for flash or psram). The pins indicated in the datasheet are the 'default' pins (well, they're actually muxed via the IOMUX instead of the GPIO matrix, but for an UART there's not really any difference between the two)

seners
Posts: 2
Joined: Sun Jun 12, 2022 11:06 pm

Re: ESP32 S2 WROOM - UART RTS and CTS

Postby seners » Mon Jun 13, 2022 7:05 am

That's a relief, thank you very much. It is good to hear from you that there can be literally any GPIO assigned as UART1 elements.

My main confusion was coming from the datasheet-self. I was under impression I can only assign pins for the UART1 where the "function" table indicates them.

For example;

While this does indicate UART elements by Muxing;

IO17 20 I/O/T RTC_GPIO17, GPIO17, U1TXD, ADC2_CH6, DAC_1
IO18 21 I/O/T RTC_GPIO18, GPIO18, U1RXD, ADC2_CH7, DAC_2, CLK_OUT3

this doesn't indicate any UART element for muxing;

IO26 25 I/O/T SPICS1, GPIO26

My understanding, orher than UART, we should stick to the "function" table, shouldn't we?

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

Re: ESP32 S2 WROOM - UART RTS and CTS

Postby ESP_Sprite » Mon Jun 13, 2022 8:28 am

seners wrote:
Mon Jun 13, 2022 7:05 am
My understanding, orher than UART, we should stick to the "function" table, shouldn't we?
That is mostly true, but it's a bit more complicated. For instance, for SPI, if speed is super-important (>=40MHz) you should stick to the pins indicated, but otherwise you can use any pin. In general: when in doubt, check the TRM chapter to see if the peripheral can be routed through the GPIO matrix, or (sometimes faster) see if the ESP-IDF API allows you to select your own IO pins.

Who is online

Users browsing this forum: Bing [Bot] and 79 guests