Wrong data being displayed- Two way serial comms in Seeeduino XIAO SAMD21

Hello community,

I am trying to establish a 2 way serial communication through single Seeeduino XIAO SAMD21. I am quite new to serial comms, so I may miss or overlook some concepts.

Issue- Not able to communicate correctly through samd21. Observing different output on Serial1. Tried using alternatives like,

  1. MATLAB Serial Explorer App (just another serial monitor).

  2. Win 98- Connecting directly to physical RS232 port on Dell Lattitude.

  3. 2 different laptops.

…the same wrong displayed result.
BUT, when done as this guy suggested, to connect Rx to Tx, creating an internal Serial1, it works. I tried this approach to look for missing/skipped/a pattern oriented lost bits, I could do nothing.

Hardware Setup- I have connected the Serial1 with DB9-RS232 protocol and Tx-Rx (pins 6 & 7) jumper cross wiring on the chip (SERCOM4 Interface) to PuTTY on another COM port on my Win 11 laptop. I am observing both the default Serial (via USB-C on Arduino IDE) and Serial1 simultaneously.

Aim- In the larger context, I want to acquire continuous sensor values and put them into a laptop for further processing.

SETUP CODE - This should just print character 'c ’ on both serial monitors when asked to print ASCII 99. Instead, it prints 'N ’ on Serial1. When tried with ASCII 98 for letter 'b ‘, it prints ’ (an apostrophe of ASCII number 39)’

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600,SERIAL_8N1);
  Serial1.begin(9600,SERIAL_8N1);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.write(99);
  Serial1.write(99);
  delay(1000);
}

PuTTY Setup window-
Screenshot 2024-07-20 005902

OUTPUT -

Any leads appreciated!
Thanks in advance!

try just relaying the serial coms to the computer via the USB cable… sound like some type of wire problem to me

I don’t see any GND signal , RS-232 uses GND signal also.
Add it and are you sending Decimal? or trying to send HEX?
Try it again.
HTH
GL :slight_smile: PJ
:v:

when you switch connections does the data switch to or stay the same?

1 Like

yes data needs common ground…