5V pin question, program starts instantaneously

westfw:
Yes, it’s a bootloader feature labeled “no wait”; The idea is that if the AVR is restarted by a RESET signal (either button or auto-reset via the serial port), it will enter the bootloader (blinks + pause), but if it is restarted for some other reason (specifically power-on) it will run the sketch immediately.

Where is this feature documented? I’d be interested in reading up on that.

One thing I wonder is how this all plays into the complexity of the program. So far the only program I’ve been running is a simple loop that sends a step signal to all three motors in sequence. The real program that I’ll be running is fairly complex, a three axis telescope tracker (obviously I’m not writing that, my CS graduate son is!). Not really understanding what’s going on here makes me worry that it won’t initialize properly. I’ve decided at this point not to chance it and keep trying to run the Uno by the 5V pin, but just go ahead and input the 12V into Vin so that it works the ‘normal’ way. But maybe I worry for no good reason?

Dan

Google “bootloader arduino delay” and start reading. Lots of bits of information scattered around. Nothing I found quickly that describes the process in detail. But the code is available for you or your son to look at!

Again, I think you are worrying for nothing. If when you flip the switch, the bootloader kicks in, then you will need to wait the few seconds before it gives up and calls your setup routine. If the bootloader does not get called, setup gets called much sooner. In both cases, your code will run as expected.

Now if you want to get to the bottom of this, you will need a scope. I will bet that the rise times on the power to the Arduino are different in each case. In one case the Arduino sees a cold start, in the other it sees a brownout/reset. Just a guess but one that matches the data at hand.

Alright, I’ll do the search on the bootloader info, sounds like interesting stuff. Thanks everybody, and I’ll try not to be such a worrywart 8).

Dan

When you get to the bottom of this, please post back and then mark this thread as solved (little icon up near the quote button).

Edit for grammar

I’ll do that. Thanks, Skye.

http://www.ladyada.net/library/arduino/bootloader.html

The bootloaders are not extensively documented. You can read the source code…

In Arduino, the bootloader and the sketch code are completely independent. Sketches do not need to bootloader to have done anything in the way of initialization, nor does the bootloader even need to be present for a sketch to run. In fact, the newer bootloaders go to some effort to start the sketch with the CPU in a state “as close as possible” to “just reset”…