Due serial port being sensitive?

Whenever I plugged in the USB port and touch the board, this happens:

Any ideas why?

There is absolutely no reason to touch the uc pins !!

ard_newbie:
There is absolutely no reason to touch the uc pins !!

It also happens when I plugged in a wire in the serial port that got initialised (but the wire is not connect to anywhere else!!).

Please post your full sketch.

If possible, you should always post code directly in the forum thread as text using code tags:

  • Do an Auto Format (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor) on your code. This will make it easier for you to spot bugs and make it easier for us to read.
  • In the Arduino IDE or Arduino Web Editor, click on the window that contains your sketch code.
  • Press "Ctrl + A". This will select all the text.
  • Press "Ctrl + C". This will copy the selected text to the clipboard.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the sketch between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.
  • Repeat the above process if your sketch has multiple tabs.

This will make it easy for anyone to look at it, which will increase the likelihood of you getting help.

If the sketch is longer than the 9000 characters maximum allowed by the forum, then it's OK to add it as an attachment. After clicking the "Reply" button, you will see an "Attachments and other settings" link.

So I just tested again with the code below. I connect the USB cable to programming port of the Due and the other end to my laptop.

As soon as I have a wire coming from pin 19 (RX1) and use my finger touching the wire, the same thing happened immediately.

Weird thing is it does not happen if I use an external power source. I tried printing out the character a but apparently it's empty? Switching to type int for a, I got number 0.

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial1.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (Serial1.available())  {
    char a = Serial1.read();
    Serial.println("I'm not supposed to receive anything!!!");
  }
}

Does it do this when the laptop is powered at the wall and/or running on battery?
(I'm betting plugged in only).

vitsensei:
As soon as I have a wire coming from pin 19 (RX1) and use my finger touching the wire, the same thing happened immediately.

You may find that your body has an electrical charge and that your body can act as an antenna. Not so weird.

Here you may find this information on ESD ( Electrostatic Discharge) informative:

My money is on a reasonable ac voltage between the laptop ground and earth...