Strange behaviour of pin13 on breadboard Atmega 328

GoForSmoke:
I mode my pins though I have trusted the default LOW.

And now I have to watch out for pin 13 defaulting to OUTPUT HIGH?

The short issue isn't about pin 13 defaulting to given level.
By default when the AVR powers up or is reset all pins are inputs so there never is a problem with any pin at that point in time.

But then time advances and if you are using a bootloader, the bootloader runs which can change things and it does.

The bootloader that is used on AVR based Arduino boards reprograms some of the pins. (LED pin, and serial pins)
And while the bootloader can be built several different ways, it is typically built to blink an LED at powerup and reset.
(behavior is slightly different depending on which bootloader you are using and which version you have but 3 blinks is the norm)

The Arduino boards hook an LED to a pin and the bootloader blinks that LED.

That means that the bootloader changes the pin hooked to the LED from being an input to an output to drive the LED.
It sets it low to turn the LED off, and then sets it high to turn on the LED and back to low to turn off the LED.

So if you have something connected to the pin used to drive the LED (typically pin 13) and that something is driving that pin (low or high; doesn't matter) you will have short when the bootloader runs since the bootloader reprograms the AVR port register from its default powerup/reset state to drive the pin pin and the external h/w is also driving the pin.

Doesn't matter if the external h/w is driving the LED pin high or low, there will be short.

What is disappointing is that the Arduino boys changed the LED circuit on the newer boards and they could have resolved this potential short issue but they didn't.
i.e. they could have made it such the the LED would be off if the pin were an input or low and on if the pin were high or had the pullup turned on.
That way the bootloader could switch the pin from input to input pullup to blink the LED.
While that could still cause issues for external h/w it would never create a short as it would never be making the pin an output.

The current LED circuit, IMO, is worse from a visual point of view than the old circuit.
While it removed the LED load from the pin (which was good), the LED is now on unless the pin is driven low.
So if you have a newer board and make pin 13 an input, the LED is on.
This is different than the old circuit behavior which the LED was off unless the pin was a high output.

The only way to avoid this issue is to rebuild the bootloader to no longer blink an LED, or not to use a bootloader.
IMO, if I was using pin 13 and concerned about it, I'd ditch the bootloader.
ISP programmers are dirt cheap today and supported "out of the box" by the IDE so it isn't like it was 10 years ago where there was not a easy and inexpensive way to program the AVR including using the IDE to program the boards without using a bootloader.

--- bill