- Thu Nov 17, 2022 3:02 pm
#237082
Dear all.
I am trying to use Serial1 on pins D9/10 on my Artemis nano board to talk to a sensor and i have some very strange behavior.
If i try :
If i now invert the order of initialization of serial ports:
So it seems that changing baudRate on Serial1 changes Serial and reciprocally. More intriguing , why can is see the output of Serial.printf on the pin D9 using my scope ? How can the ouput of the the Serial.printf command be on two physically separated UART TX pins ?
How do i decouple Serial (which should only be talking to the USB bridge) and Serial1 which should be a hardware UART connected to pins D9/D10 ?
Thank you so much for any clarity you can bring. I purchased that board specifically because i has 2 UARTS (on top of BLE off course
) , so i am kind of stuck there
I am trying to use Serial1 on pins D9/10 on my Artemis nano board to talk to a sensor and i have some very strange behavior.
If i try :
Code: Select all
Then both prints are sent both on physical pin D9 and on the USB console at 9600 bauds. I am using a scope to capture pin D9 and i see both messages concatenated on that pin.#define BAUD 115200 // any number, common choices: 9600, 115200, 230400, 921600
#define CONFIG SERIAL_8N1 // a config value from HardwareSerial.h (defaults to SERIAL_8N1)
void setup() {
Serial.begin(BAUD);
Serial1.begin(9600); // set the baud rate with the begin() method
}
void loop() {
Serial.printf("this print on Serial\n");
Serial1.printf("this on Serial1\n");
delay(1000);
}
If i now invert the order of initialization of serial ports:
Code: Select all
both prints are sent to pin D9 and USB console (i get both messages on both UARTS again) , but this time at 115200 bauds (on both UARTS)void setup() {
Serial1.begin(9600); // set the baud rate with the begin() method
Serial.begin(BAUD);
}
So it seems that changing baudRate on Serial1 changes Serial and reciprocally. More intriguing , why can is see the output of Serial.printf on the pin D9 using my scope ? How can the ouput of the the Serial.printf command be on two physically separated UART TX pins ?
How do i decouple Serial (which should only be talking to the USB bridge) and Serial1 which should be a hardware UART connected to pins D9/D10 ?
Thank you so much for any clarity you can bring. I purchased that board specifically because i has 2 UARTS (on top of BLE off course
