Does pro mini pause 2sec when on battery?

I was gonna ask how to burn bootloader on pro mini, because when I power it up via my USB cable there's a 2 second pause while the green led blinks before my program runs.

And this tutorial for the regular mini says you have to remove the green LED from pin 13:

And the pro mini has a green led soldered on the board on pin 13 and it would be really inconvenient to remove that.

(Do you need to? I'd still like to know!)

But I just went to plug the pro mini in now, and I failed to plug the usb cable in all the way, and I noticed that it began executing my code immediately instead of waiting, And that's great!

But is there some undocumented feature at work here? Does the pro mini not wait two seconds for code to be uploaded if nothing is done on the Tx or Rx pins, or what? What's going on here exactly, and under what conditions will the Arduino Pro Mini pause before executing code?

It may be worth noting that my plan for some of my projects is to plug the pro mini into a socket, and remove it to program it, so that I can make use of those serial pins. I would be connecting those to ground or to other pins, depending on whether I hook them up to a piezo, a switch, or an led array. So knowing if those would affect the boot time would be very helpful to me.

You probably do have to remove the 13 LED, or else bypass it and connect the wire directly to the corresponding pin on the Chip.

I think it's that way, because the LED will "eat" any signal you send into the pin, instead of the chip reading it and using it.

I really need to know is if connecting a battery will cause the sketch to run immediately or not. I don't have a battery to test with at the moment and if it won't, and there's no way to cause that to happen, I'm gonna need to buy a cable from Sparkfun today so I can burn my own bootloader.

I suspect there is a way to do this though. My arduino pro mini consistently runs the sketch immeidately when I plug in the usb cable only partway.

Well I had a chance to go out today to get a battery to test with, and I found out that there is indeed no pause when simply connecting the battery up to the pro mini.

So that's perfect then! Disaster averted. No need to buy another cable and overwrite the bootloader just to get rid of the pause I get with the usb cable.

As long as you are happy with that. In fact it makes no difference, how can it? I wonder if the time to establish the USB to PC communications is fooling you.

When connecting an Arduino via USB, the DTR signal will (typically) be asserted and this can influence startup time. At startup the bootlader can be programmed to check for cause of reset/restart (e.g. wtachdog, hardware reset, power on) and choose to either wait for serial input (causing a delay) or start the sketch immediately.

Still I expect most applications will do just fine with a 2s delay power on time. If immediate response is needed, using a sleep mode might be a preferred option.

When I said the startup time was two seconds via USB, that was just an estimate. I just tested the startup time with USB again and and it's actually more like 8 seconds to startup when connected to USB.

I wonder if the time to establish the USB to PC communications is fooling you.

I thought that might be the issue. That's why I mentioned that the problem went away when I plugged the USB cable in only part way.

Why is there is no documentation of this behavior anywhere though? The only mentions of startup delays I could find were talk of the two second startup delay and some folks trying to figure out how to get rid of it by replacing the bootloader. When I encountered the USB delay, I thought that's what they were talking about. And maybe it is. Maybe they, like me, were confused by the USB handshake time; becuase I can't see why someone would be particularly concerned about the tiny delay I get when I connnect a battery to it.

When connecting an Arduino via USB, the DTR signal will (typically) be asserted and this can influence startup time.

Well, that would explain why connecting via USB makes a difference I guess.

The thing which confused me though is the basic breakout board is what is connected to the USB cable. It should be the thing doing the handshaking. And the Arduino is clearly getting power as soon as I plug in the cable because the leds blink. So I would expect that while the basic breakout board is busy doing it's handshaking the Arduino would be free to start immediately. One might assume the Arduino would pause if when power is applied, it is reciving serial data, but it shouldn't be getting serial data from the breakout board, because that hasn't recived any commands to upload from the software. But I guess that's not the case.

Anyway, mystery solved!