Bootloader flashing pins 0 ,1 & 13

Hi,

Wondered if there was any easy answer to this little problem.

Am using an Uno and every Pin is allocated to output, and when I power the Uno on, the bootloader starts and its signals cause multiple flashes on pins 0, 1 and 13, for about 3 seconds before the user program starts.

This does cause problems for the output devices on those pins; driving a combination of UNL2803, SSR or LL Mosfets

I know I can program up without the bootloader but would prefer to keep it for easy re-programming.

If there any easy mod to the bootloader to stop it outputing like that or any suggestions for a C/R to dampen the signal to the output device; though would think 3 seconds is a long time and might also affect any re-programming ?

Programming the board with USB versus programming with ICSP or FTDI is the same. It's quite easy and fast.

But, you could try to Write(PIN, LOW); before you set the pin to be OUTPUT. i.e.:

digitalWrite(PIN, LOW)
pinMode(PIN, OUTPUT)

Well, 0 and 1 will flash because that's the Serial port to the PC.
You can probably make adjustments to the bootloader code to stop 13 flashing.

Programming via ICSP will make 11, 12, 13 flash so that doesn't really help,

Next option might be to have signals go thru a buffer to feed the 3 devices and have the code enable its output when the sketch starts. Could be an RC time delay even, holds the line high until the cap discharges. Or low, until it charges, and then invert to drive the enable line low. Similar to what the 10K/0.1uF does for the Arduino reset, only for a longer time.

Or add a CMOS 555 timer to control the enable line. Still RC based, but more predictable to operate.

The stock Uno bootloader is Optiboot 4.4 and it runs on power up. More recent version of Optiboot includes a feature called Adaboot no-wait, which prevents the bootloader from running during power up. Bootloader only runs upon reset. Upgrade your Uno's bootloader. Optiboot can be found on github at Optiboot/optiboot.

Changing the bootloader is not going to stop IO from toggling during sketch downloading, as pins still need to get used.
Uploading via ICSP (no bootloader) also uses pins.
You can not upload without toggling pins somewhere.

Yes that's right. The OP's primary concern was pin activity during power up.

Thanks for the replies guys.

Afraid I have mislead myself and you a bit, sorry !

I made the above comments based on running the Uno via the USB cable, where when just using the USB cable for power ( no ide running) it does cause the bootloader to flash those 3 leds.

Just run the Uno from a wall psu and the bootloader runs , but does not flash the leds, so problem sorted.

Again apologies for my stupidity. :blush: :zipper_mouth_face: