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:
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...