1

Having this basic example for using the SerialUSB function on the Arduino Due under Windows:

// ARDUINO DUE BLINK LED
void setup(){
  pinMode(13,OUTPUT);
  SerialUSB.begin(2000000);
  while(!SerialUSB){
    digitalWrite(13,HIGH);
    delay(100);
    digitalWrite(13,LOW);
    delay(100);
  }
}

void loop(){
  SerialUSB.println("Hello, World!");
  digitalWrite(13,HIGH);
  delay(100);
  digitalWrite(13,LOW);
  delay(900);
}

I am having trouble understanding which shall be the operating sequence for this use. Normally I follow these steps:

  1. Open Arduino IDE, select Arduino Due (Programming Port) at COM 01, and connect it to PC USB,
  2. Compile and Upload the code,
  3. Open a Serial Monitor App, with COM 02, 2000000 bps or 9600 bps, 8b data, 1b stop, no parity, RTS|CTS flow control.

If I keep the Arduino connected to the Programming Port after trying the Native USB Port, I have to disconnect and connect everything to program it again (??), or disable it through the windows Device Manager.

Which is the proper sequence (and perhaps the code) for doing this the right way?.

2
  • 1
    You have to have flow control set to hardware for the Arduino to know the port has been opened.
    – Majenko
    Oct 4 '20 at 22:28
  • 1
    Thanks @Majenko. That solved a big part of the problem. I have updated the question.
    – Brethlosze
    Oct 4 '20 at 22:35
0

Assume the Arduino is already programmed and energized, i.e. from the Barrel 5V Power Source or from a USB Charger (as minimum) at Programming USB Port.

The following should be the proper steps:

  1. If not Programmed: Program the Arduino, either through the Programming USB Port, Native USB Port, etc.
  2. If Native USB Cable to PC is Plugged: Unplug Cable, or Reset Arduino,
  3. Plug Native USB Cable to PC,
  4. Check COM Number for the Native USB Port, i.e. COM01,
  5. If Serial Monitor Connected: Disconnect Serial Monitor,
  6. Connect through a Serial Monitor App, with COM01, any bps, 8b data, No parity, 1b stop, RTS|CTS flow control.

Done. The data flow should start immediately as soon as you Reset.

Check this for a deeper post with another example for debugging.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.