bootloader does not start my program

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
schmurfy
 
Posts: 2
Joined: Tue Sep 03, 2013 5:58 am

bootloader does not start my program

Post by schmurfy »

Hi,
I just use a simple program which is blinking a led (not on pin 13) nothing fancy, it works fine as long as the computer is connected but if a disconnect the usb cable and connect an external power supply (9v) then all the arduino does is blink the on onboard on pin 13 :shock:

First I noticed that with a bigger application but since it was driving crazy I stripped it bits by bits to end with... almost nothing and the issue persists, for reference here is my current test case (I even dropped everything and started back from the blink example to be sure):

Code: Select all

int led = 5;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
  pinMode(4, OUTPUT);
  digitalWrite(4, LOW);
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}
A led is connected with a resistor between digital pin 4 and 5, I use pin 4, it works fine when I just uploaded it but when I disconnect the usb cable the onboard led is te only one blinking, it does the same whether I reconnect the usb cable or plug an external power supply.

any idea what might happen ?

Ps: I just tried with the standard blink example and it does not work either, after unplugging and plugging back power the led blinks but not how it should, it looks like it is trying to send data...

Edit: I just tried with another arduino I have and this one works as expected, after boot the on board led flash quickly, then stops and the 1s on/1s off starts. It looks like on my other board the bootloader is somehow stuck (I suppose the fast blinking led is the bootloader doing its thing).

User avatar
Franklin97355
 
Posts: 23903
Joined: Mon Apr 21, 2008 2:33 pm

Re: bootloader does not start my program

Post by Franklin97355 »

Try connecting the LED/resistor from pin 5 to ground. What value resistor are you using and what is the source of the 9VDC? Also which Arduino are we talking about?

schmurfy
 
Posts: 2
Joined: Tue Sep 03, 2013 5:58 am

Re: bootloader does not start my program

Post by schmurfy »

Hi,
This is an arduino uno, but as a last measure I tried to reflash the bootloader to this chip and now it works xD
That's strange because all the chips were bought at the same time but strange things happen :)

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”