Hello, I would like to ask what is the current status of the 7O1(7E1 seems to have the same behavior) Serial1 mode. I am running this simple loop-back test, which I expect it to print the “hello\n” string on each loop iteration, but it does not (never gets in the while loop). Furthermore, I found that the Serial1.available() > 0 condition is necessary, because it would return negative values, thus printing junk chars in the while loop.
#include "application.h"
#include "stdarg.h"
void setup() {
Serial.begin();
// SERIAL_8N1 works properly
Serial1.begin(19200, SERIAL_7O1);
while (!Serial1) {
delay(500);
}
while (!Serial) {
delay(500);
}
}
void loop() {
static uint32_t msLastTime = 0;
if (millis() - msLastTime > 1000) {
msLastTime = millis();
Serial1.println("hello"); // Write to Serial1
}
while (Serial1.available() > 0) {
char c = Serial1.read();
Serial.printlnf("%d, %c: available buffer %d\n", c, c, Serial1.available()); // Write to USB
delay(100);
}
delay(800);
}