I wrote an C# application to communicate with an Arduino Nano Every. When I plug the USB connector to Arduino for the 1st time, the port opened but doesn't communicate (the Arduino must send a message with Serial.println("Hello!"); that I don't receive). Even if I press the PB reset on the board, nothing happens.
Remark: the Arduino is supplied only via USB plug.
If I launch the Serial Monitor from Arduino IDE I receive the write message (Hello!). Now, if I return to my C# program and run it again, I receive the right message "Hello!" on each reset, until I'll disconnect the USB.
I tried an experiment:
I load this simple program in my Arduino:
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
Serial.println("HIGH");
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
Serial.println("LOW");
delay(1000); // wait for a second
}
and I launch a serial terminal software (Termite 3.4).
I can observe the same behavior that is after plugging USB the terminal output displays a sequence of [00][00]....just after reset and so after each second.
Now, if I launch the Arduino IDE Serial Monitor, I receive immediately the right message:
Hello!
HIGH
LOW
...
And if I launch the Termite Terminal instead of Serial Monitor, I receive the same right message.
Hold down DTR when serial communication is started. You can keep it low or just give a short pulse of let's say 100ms at the start of the session, it shouldn't matter much. Yes, it's done in software.
I don't understand.
I use the USB connector of Arduino Nano Every. It has its own USB-UART transceiver. I looked at the board schematic, there is no DTR signal.
If it is done in software, what is the instruction code?
Sounds like your C# program isn't doing what it's supposed to do then. It's outside the scope of Arduino itself and I have no experience with C# specifically, so I can't help you with that. Perhaps try in this category: Interfacing w/ Software on the Computer - Arduino Forum
After opening the port, I must enable Dtr and (very important) wait a delay before send message.
It is working.
I deduced that the Serial Monitor do this and not the Termite terminal.
Thank you