Pages: [1]   Go Down
Author Topic: Issue at power on  (Read 679 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear Friends,
I am working with Arduino Uno rev.3, I have finished my code, uploaded on the Arduino Board, and all works fine! smiley-wink
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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Problem solved! smiley
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! smiley-wink
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Problem solved! smiley
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! smiley-wink

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
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 499
Posts: 19065
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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


The Netherlands
Offline Offline
Edison Member
*
Karma: 50
Posts: 1708
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 499
Posts: 19065
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Code:
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:
   while (!Serial) { }

... and not have to care whether this was compiled for the Uno or the Leonardo.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Problem solved! smiley
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! smiley-wink

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

Pages: [1]   Go Up
Jump to: