I have problems with my Arduino Uno.
If I repower it (doesn't matter if usb or external), it most time doesn't start the sketch. I tried to wire TX to RX (although that should only be necessary for older models) but that doesn't help. If I activate Serial Monitor or Reset the board it will start the sketch.
I checked if my sketch may be the problem and tried the Blink example. That one starts way more often but sometimes doesn't start too.
If the arduino doesn't start reliable, it will be useless for my project (wan't to oil the chain of my motobike).
What could be the source for that behavior and what can I do?
After some further reading I can tell, that not even the bootloader will start. Just the green power led is on. Led on pin 13 will stay off.
If the bootloader runs (Led pin 13 blinking) the sketch will run too.
If I plug in my little selfmade shield (connects DOGM163 + Backlight) it will work less often with blink sketch. Maybe its something with the current that is needed for the Lcd (5V+ pin).
So thats the facts again:
- Bootloader does more or less often not start, if powered up (independend if usb or external power)
- Bootloader WILL start, if I push reset, upload sketch or just activate serial monitor if connected via usb
- Shield seems to have an impact on the behavior, but a blank arduino with blink sketch will not start bootloader too (not often but it does)
- Sketch seems to have an impact on the behavior. Blink sketch runs more often, than my own sketch. My own sketch actualy has a size of 13k and uses Onewire + DallasTemperature + DogLcd
Maybe that helps a little.
Anyone any idea?
Shield seems to have an impact on the behavior, but a blank arduino with blink sketch will not start bootloader too (not often but it does)
You may want to measure the amount of current your shield is drawing. Sounds like on power up the power rails are unstable. If the shield is drawing too much current, the regulators would be having difficulty stabilizing. This would prevent the 8u2 and ATmega from properly coming out of reset.
It doesn't explain why it would happen when the shield isn't connected, except if one of the on-board regulators is now damaged.
As a alternative measure you may want to place a large cap on the RESET line. It may help to hold the ATmega in RESET a little bit longer, giving more time for the rails to stabilize.
I tried to connect +5V with 1microF to reset pin.
Now the LED13 doesn't blink anymore but the sketch is starting.
That way I can't upload anymore. I know that I have to change capacity but in which direction? Smaller or bigger?
My suggestion to use the capacitor is just a work around. First I would troubleshoot the root cause of the problem. Do some testing to find out if there is a regulator issue or if you are drawing too much power for the regulators to work well.
If delaying RESET does seem to fix the problem then when you want the sketch to run reliably, you would use the capacitor. During development, when you continuously resetting it you would remove the capacitor.
Are the regulators involved, when I use usb for powering? I have the problem there too, its not only with external power.
I think I will have to live with that workaround.