UART not working for ESP32-PICO-DevKitM-2

I am trying to get simple UART communications working on the ESP32-PICO-DevKitM-2 (Module: ESP32-PICO-MINI-02 and Chip: ESP32-PICO-V3-02).
The UART0 on GPIO3 (U0RXD) and GPIO1 (U0TXD) work fine and I can print to the Arduino serial monitor. I have selected the board: ESP32 PICO-D4.
I am unable to get a second UART working. I have tried using GPIO8 (U2CTS) and GPIO7 (U2RTS) and it is not working. For testing I have the TX line on the ESP32 connected to a serial port converter (TTL to RS232) and viewing results in Putty.
Here is the simple code I am using:

#include <SoftwareSerial.h>

#define rxPin 7
#define txPin 8

// Set up a new SoftwareSerial object
SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);


void setup() {
  Serial.begin(9600);
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  
  // Set the baud rate for the SoftwareSerial object
  mySerial.begin(9600);  
  
  delay(2000);


  mySerial.println("****  PRINTING TO COM6 ****"); 
  Serial.println("---- PRINTING TO COM14 ----");

}

void loop() {
  // put your main code here, to run repeatedly:

}

Hi @barney-was-here ,

Welcome to the forum..
The ESP32 has a few hardware serials available that you can re-assign..

Serial1.begin ( 9600, SERIAL_8N1, 7, 8 );

Not all software serial libs are compatible with esp and it's better if you don't have to use one..

good luck.. ~q

You are correct! That worked.
Thanks so much.

1 Like

You're Welcome..
Let us know here if you have any more issues..

happy coding.. ~q

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.