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,
-
MATLAB Serial Explorer App (just another serial monitor).
-
Win 98- Connecting directly to physical RS232 port on Dell Lattitude.
-
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-
OUTPUT -
Any leads appreciated!
Thanks in advance!