Using Additional Serial Pins for the ESP32-S3

I ran into trouble getting serial to talk on the GPIO43 and GPIO44 with the Arduino IDE. It ended up being a simple fix.

Raising Awesome

The ESP32-S3 is an amazingly versatile chip.  It comes in a package called the Mini that can be baked onto a PCB with a PCB antenna already attached. For serial, GPIO43 and 44 are stated as UART pins.  I beat my head against the wall trying to get them to work.  I found the problem was that you first had to set the pinMode of 44 (Rx) to input.  For some reason, the Serial core library didn't do this on its own.

 

Example:

void setup() {
  Serial.begin(115200);  // USB serial for debug output
  delay(500);            // Give time for Serial Monitor to connect
  pinMode(44,INPUT);
  // Initialize Serial1 with explicit pins
  Serial1.begin(9600,SERIAL_8N1,44,43);
  Serial.println("Listening for GPS serial data...");
}

void loop() {
  // Read and print incoming GPS data as hex
  while (Serial1.available()) {
    char c = Serial1.read();  // Read one byte
    Serial.print(c);          // Print it as ASCII
  }
  delay(1000);
  Serial.println("Waiting...");  
  byte ubxMonVer[] = {0xB5, 0x62, 0x0A, 0x04, 0x00, 0x00, 0x0E, 0x34};

  Serial.println("Sending UBX MON-VER...");
  Serial1.write(ubxMonVer, sizeof(ubxMonVer));
}
Have a question?
Back to Home