Using Pin 7 as RX and any other pin as TX (Reassigning TX pin) on a XIAO SAMD21

Can we reassign the TX pin on any other pins (due to an error in project layout and component placement) for serial communication with another pudding board? I am using pin 7 as RX (which is prescribed), but I need to use a pin on the same column as with pin 7 because pins 1 to 6 is blocked of access (due to horrible placement in my project). Is this possible, and if so how can I know if it established a working serial connection?

Which board? it should be assigned in software in the serial begin statement

Sorry I forgot to indicate. I am using a SEEEDUINO XIAO SAMD21. I did indicate it though:
#include <TinyGPSPlus.h>

#include <SoftwareSerial.h>

#include <Wire.h>

static const int RXPin = 7, TXPin = 8;

unsigned long interval = 10000;

static const uint32_t GPSBaud = 9600;

unsigned long previousMillis = 0;

int data_counter;

const size_t BUFSIZE = 300;

char f_buffer[BUFSIZE];

float f_buf = (float)f_buffer;

TinyGPSPlus gps;// The TinyGPSPlus object

SoftwareSerial ss(RXPin, TXPin);// The serial connection to the GPS device

void setup()




SoftwareSerial ss(RXPin, TXPin);// The serial connection to the GPS device

sorry i see it now… my window was minimized so it was chopped off… lol

Nice, but is there a way to know if serial connection is established?

well ideally, it will just start working… or it will not… thats typically how it works
if not make sure you dont have tx and rx backwards and baud rate 9600 or 4800… whatever its supposed to be

I used this device

when i was playing around with serial communication

i also found on the XIAO SAMD21… you can use Hardware serial and not have to use software serial… you have a hardware serial … but that is extra research you can do on your own

you can try this standard sketch Two Port Recieve, you have to follow the directions or connect the rx and tx pins together with a jumper and modify the code to select the proper mode…

The samd does serial in code a little different than esp32 so you have that issue as well

On Recieve Demo… is for XIAO ESP32 and will not work on XIAO SAMD but you may be able to understand the differences by examining the code… thats how i learned more about the Serial connections… good luck

Hi there,
SO as C has described and indicated the correct path, I would offer also that I have posted an example of dual serial ports on ESP32C3 for GPS setup, use the search for it. There’s code in there with softserial implementation.
GL :slight_smile: PJ