0
\$\begingroup\$

In the datasheet of ESP32, Table 1 "Pin description" there is the list of all pins and their function. For example, let's see the UART ones:

GPIO16 25 I/O GPIO16, HS1_DATA4, U2RXD, EMAC_CLK_OUT GPIO17 27 I/O GPIO17, HS1_DATA5, U2TXD, EMAC_CLK_OUT_180 SD_DATA_2 28 I/O GPIO9, HS1_DATA2, U1RXD ,SD_DATA2, SPIHD SD_DATA_3 29 I/O GPIO10, HS1_DATA3, U1TXD, SD_DATA3, SPIWP U0RXD 40 I/O GPIO3, U0RXD, CLK_OUT2 U0TXD 41 I/O GPIO1, U0TXD, CLK_OUT3, EMAC_RXD2 

But in Table 10 "Peripheral Pin Configurations", I read:

UART U0RXD_in Any GPIO Pins U0TXD_out U1RXD_in U1TXD_out U2RXD_in U2TXD_out 

(note: for clarity I removed the flow-control pins)

What does the first table actually mean?

It cannot be the "default" function, because for each pin are listed several functions. From the second table I assume I can configure each UART function to any GPIO pin.

May I rely on the second table? I mean, I really can assign UART, I2C, SPI, etc... to any GPIO as stated?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

You need to read about the IO_MUX function in the Technical Reference Manual. For complex processors like this it is not uncommon to split the pinout and parametric characteristics into a "datasheet" and put the functional information in a "technical reference manual".

\$\endgroup\$
2
  • \$\begingroup\$ If I understand correcly, we can summarize as: "GPIO Matrix (see Table 10) allows to configure almost any pin to almost any peripheral, but some specific high-performance features needs to by-pass this. Hence, IO_MUX is less flexible (see Table 1) but allows to directly connect the pin to the related internal hardware". \$\endgroup\$ Commented Jan 23, 2021 at 6:27
  • \$\begingroup\$ In other words, if I'm interested in standard UARTs like the example above, relying on GPIO Matrix I can map them to any GPIO. It remains to be seen if the Arduino framework handles this automagically... \$\endgroup\$ Commented Jan 23, 2021 at 6:28

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.