Skip to content

XIAO as USB-Serial Converter

ref. The XIAO as a USB-Serial Converter

Connection

Eagle


Ealge sch brd

ref. Eagle holes making

1
2
SET FILL_LAYER 116 1;
run drill-aid 0

BOM

Item Qty Price Link
Seeed Xiao 1 4.9USD, 556JPY seeed, digikey, Amazon 3P
Pin Header(1x7) 2 some
Pin Socket(1x7) 2 some
Angle pin socket(1x6) 1 some

Boards

Source

ref. The XIAO as a USB-Serial Converter

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#include <Arduino.h>

void setup() {
    Serial1.begin(115200); // baudrate
}

void loop() {
    // Transmit on pin A6 (Tx of Serial 1) every byte
    // received over the USB connection (Serial)
    //
    while (Serial.available()) Serial1.write(Serial.read());
    Serial1.flush();

    // Transmit over the USB link (Tx of Serial) every byte
    // received on pin A7 (Rx of Serial1)
    //
    while (Serial1.available()) Serial.write(Serial1.read());
    Serial.flush();
}

This worked with echo3216


Last update: April 13, 2021