• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

TXD1 on ESP8266 and equivalent on ESP32

Q&A Forum › Category: ESP32 › TXD1 on ESP8266 and equivalent on ESP32
0 Vote Up Vote Down
Anthony asked 5 years ago

Is there an equivalent pin on ESP32?  Also is there a RXD1 on ESP32 and what pin is it?

4 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi.

TXD1 on ESP8266 is GPIO2 (D4).

On the ESP32:

  • TXD1:GPIO 9
  • RXD1: GPIO10

However, these GPIOs are internally connected to the SPI Flash of the ESP32. So, I don’t recommend using those pins.

I recommend taking a look at the following articles that describe in detail the pinout of these bords:

  • ESP8266: https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/
  • ESP32: https://randomnerdtutorials.com/esp32-pinout-reference-gpios/

Let me know if you need further help.
Regards,
Sara

0 Vote Up Vote Down
Anthony answered 5 years ago

Thank you for your answer.  I need two serial ports.  If I switch to ESP32, can I use TXD2 and RXD2 instead.  I believe this is supported by the Arduino IDE.  Is there a project in the ESP32 eBook that uses the TXD2 and RXD2? 

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi Anthonny.

If you need two serial ports in the ESP32, you can use:

  • TX0 and RX0: GPIO 1 and GPIO 3
  • TX2 and RX2: GPIO 17 and GPIO 16

Format for setting a serial port:

Serial.begin(baud-rate, protocol, RX pin, TX pin);

Example for initializing two serial ports:

#define RXD2 16
#define TXD2 17

#define RXD0 3
#define TXD0 1

void setup() {
Serial1.begin(9600, SERIAL_8N1, RXD2, TXD2);
Serial2.begin(9600, SERIAL_8N1, RXD0, TXD0);
}

Then, use the usual functions to interact with serial objects.

I hope this helps.
Regards,
Sara

0 Vote Up Vote Down
Anthony answered 5 years ago

Thank you.

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.