XIAO ESP32C3 Multiple Software Serial Ports

Hi there,

Just not well supported I used BSP 3.0.7 BTW for the C3

so the general idea. On the ESP32-based Xiao boards (for example, the ESP32-C3 or ESP32-S3), one hardware UART is typically used for USB debugging/console (UART0), and the chip provides a second hardware UART that you can assign to available pins (like pins 6 and 7, if the board design allows). That gives you a reliable, hardware-based serial port for your application.

If you need an additional serial interface (for a third channel), you could try using a software serial library (like ESPSoftwareSerial or another ESP32‑compatible library) on a pair of other pins (such as pins 9 and 10). However, keep in mind:

  • Hardware UARTs are Always Preferred:
    The hardware UARTs on the ESP32 are much more reliable and efficient than software serial. Software serial on ESP32 can be a bit tricky due to timing issues, so if you can avoid it by reassigning or using a hardware UART (or if you’re using an ESP32-C6 with three UARTs), that’s usually best.
  • Pin Multiplexing and Board Design:
    Not all pins on the board may support the functions required for a software serial receiver, so you’ll need to verify that pins 9 and 10 (or whichever you choose) are supported by the library you plan to use.
  • Configuration:
    For each serial port (whether hardware or software), you need to define the correct pins, baud rate, data bits, stop bits, and parity if necessary.

So, in summary:

  • Use the USB port (UART0) as usual.
  • Use the second hardware UART on the available pins (like 6 & 7) for one channel.
  • If needed, add another channel via SoftwareSerial (e.g. on pins 9 & 10), keeping in mind potential limitations.

That way, you can have three serial channels: one hardware (USB), one hardware on assigned pins, and one software serial.

HTH
GL :slight_smile: PJ :v: