Go Down

Topic: Issue at power on (Read 758 times) previous topic - next topic

dtluigi

Dear Friends,
I am working with Arduino Uno rev.3, I have finished my code, uploaded on the Arduino Board, and all works fine! ;)
The problem is that when I remove the board from the Pc, and I give a new power on, the board doesn't work anymore...it is all still...
Only attaching the board to the Pc and uploading the code again, I can see the Arduino working again...
Do you have some suggestion for me, please?

dtluigi

I tried to connect a 10kOhm resistor between Rx pin (pin0) and ground (gnd), without any result: at the power on with external power supply, the board blinks led13 twice and then stops, without starting the code previously uploaded.

dtluigi

Problem solved! :)
I had an issue in the setup() of the board: when you declare the Serial.begin() only for debugging test, the board wants the PC to communicate with...without it, the board can't go on and then stop there! ;)

retrolefty


Problem solved! :)
I had an issue in the setup() of the board: when you declare the Serial.begin() only for debugging test, the board wants the PC to communicate with...without it, the board can't go on and then stop there! ;)


That is not the problem, the board does not have to be connected to the PC to run a sketch that has already been uploaded to it. But perhaps the code in your sketch does not do anything useful unless if first receives something from the serial link?

Lefty

Nick Gammon

I had a similar problem with a Leonardo, not a Uno, because of the line that waits for Serial to become available:

Code: [Select]

void setup ()
  Serial.begin (115200);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  // whatever
  }  // end of setup


However that shouldn't happen on the Uno.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

MAS3

I've recently tried your (Nick Gammon) I2C scanner (unmodified), which has this "while (not serial)" line in it on my uno.
The scanner waits for the serial connection to be established and only then runs the scanner once.

I modified it to (as practice) have the actual scanner in void loop() so now it runs continually after the serial connetion is up.
So i guess this also works for uno, even if you don't need to do that.
If OP has this code, he should comment it out and have another try at it.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Nick Gammon

The HardwareSerial library (such as used by the Uno) just implements the "wait" as something that immediately returns:

Code: [Select]

HardwareSerial::operator bool() {
return true;
}


So it doesn't really wait for anything. They just put that code there so you could add the lines:

Code: [Select]

   while (!Serial) { }


... and not have to care whether this was compiled for the Uno or the Leonardo.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

dtluigi



Problem solved! :)
I had an issue in the setup() of the board: when you declare the Serial.begin() only for debugging test, the board wants the PC to communicate with...without it, the board can't go on and then stop there! ;)


That is not the problem, the board does not have to be connected to the PC to run a sketch that has already been uploaded to it. But perhaps the code in your sketch does not do anything useful unless if first receives something from the serial link?

Lefty


If in the Setup() you have defined the Serial.begin() it needs a communication on the serial interface...if you haven't the setup of the serial, the board shows no problem to work with the previously uploaded sketch, away from the Pc.

Go Up