Only two wires are needed to transmit data between two UARTs. The transmitting UART converts parallel data from a controlling device like a CPU into serial form, transmits it in serial to the receiving UART, which then converts the serial data back into parallel data for the receiving device. Introduction to UART Communication In UART communication, two UARTs communicate directly with each other. A UART’s main purpose is to transmit and receive serial data. It’s not a communication protocol like SPI and I2C, but a physical circuit in a microcontroller, or a stand-alone IC. UART stands for Universal Asynchronous Receiver/Transmitter. Having said that, the UART drivers that I recommend to use don’t have this level of optimization built into them and as a result, you are pretty much free to use any pins you choose. The pin mapping table for this hardware assistance is as follows. However, the UARTs can also have direct access which marginally improves performance. Like all peripherals, the pins for the UARTs can be logically mapped to any of the available pins on the ESP32.
There are three hardware supported serial interfaces on the ESP32 known as UART0, UART1 and UART2. T here are three serial ports on the ESP32 known as U0UXD, U1UXD and U2UXD all work at 3.3V TTL Level.