ESP32 Feather V2: How to use TX and RX pins on board?

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Dijkstraaa
 
Posts: 2
Joined: Thu Jul 21, 2022 4:43 pm

ESP32 Feather V2: How to use TX and RX pins on board?

Post by Dijkstraaa »

Hi Adafruit support people,

I am following the ESP32 Feather V2 tutorial to learn how to use the board.
https://learn.adafruit.com/adafruit-esp ... v2/pinouts

On the Pinouts page, it mentioned that:
RX - This is the UART RX (receive) pin. It is also pin 8. Connect to the TX pin found on a breakout or device. This is separate than the 'debug UART' which is connected to the USB-to-Serial converter, so it will not interfere during upload.
TX - This is the UART TX (transmit) pin. It is also pin 7. Connect to the RX pin found on a breakout or device. This is separate than the 'debug UART' which is connected to the USB-to-Serial converter, so it will not interfere during upload.


I want to use these two pins for UART communication, but there is no example on how to do this. When I use the regular Serial.println() command, it seems like it is connected the USB-to-Serial device. I see the output on Serial monitor, but I cannot detect the signal changes on TX pin. So my question is how to read and write from external device using TX and RX? Thank you!

Code: Select all

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.println("start");
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println("loop");
  delay(1000);
}

User avatar
dastels
 
Posts: 15660
Joined: Tue Oct 20, 2015 3:22 pm

Re: ESP32 Feather V2: How to use TX and RX pins on board?

Post by dastels »

Try using Serial1 in place of Serial.

Dave

User avatar
Dijkstraaa
 
Posts: 2
Joined: Thu Jul 21, 2022 4:43 pm

Re: ESP32 Feather V2: How to use TX and RX pins on board?

Post by Dijkstraaa »

Hi Dastels,

Thank you for your help!

I didn't know Serial1 exists lol. I tried it and it worked! I saw data output on TX pin haha

I have two quick follow-up questions if you don't mind:D
1. how many Serial ports are available on ESP32? it seems like I can also use keywords Serial2, Serial3, etc. But I don't know which pins they are related to.
2. If I need to use more than five Serial ports on this Feather V2 port, am I supposed to use SoftwareSerial solutions like this one (https://github.com/plerup/espsoftwareserial)?

Thank you again! really appreciated!

User avatar
dastels
 
Posts: 15660
Joined: Tue Oct 20, 2015 3:22 pm

Re: ESP32 Feather V2: How to use TX and RX pins on board?

Post by dastels »

It depends on the MCU and the board support package. Some I've seen only have Serial & Serial1 implemented.

You can look around in the source for the board support for the code that sets up the serial ports. It's sometimes pretty straightforward to add more. The GrandCentral M4, for example.

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”