Go Down

Topic: reduce arduino boot time? (Read 5845 times) previous topic - next topic

xarvox

Hello everybody!

My vehicle light system is built around the idea to use a tactile button for system ON, then use software to trigger system OFF.
(this, instead of a ON/OFF main switch.)

This way i can use a combination of user input-buttons, a temperature sensor limit, or a battery voltage limit as a system OFF-trigger.


The auto-off  part of my project is copied from this LINK! (at homecircuits.eu)


Ive constructed my circuit according to the link above, created a clean sketch containing only the part of setting the keep_ON-pin (D8) to HIGH, to take over from the button-press.

Now, my circuit works exactly as described, but it requires a button-press with MINIMUM length of 2-3 seconds before it latches to ON-state.

I know, i shouldnt try to fix what isnt broken, and a 3 second ON-press could be considered a feature to filter out accidental buttonpresses, but i still want to reduce the boot-delay as much as possible...


From what ive gathered, this delay is mostly due to the fact that the arduino waits a defined time at boot-up to see if its being re-programmed.

Is this true?

Is there a way to reduce this number and still be able to upload new sketches?

I do have multiple arduino┬┤s (nano, ch340), so i figure i would be able to use one of them as a programmer, but i have never dived this deep into programming.. :)

Alternatively, i could build a 555 timer circuit between the button and the optocoupler/mosFET pair that works as the ON/OFF-switch.
The ON-button would trigger the timer circuit, witch would in turn keep the circuit up for say 5 seconds, while the arduino starts up to take over.

But ive already started populating the pcb (my own design, ordered online), so its a wee bit late to "throw in" a timing circuit... :/

allanhurst

The bootloader takes time before running your code.

Use a pro-mini -> no bootloader -> fast start-up.

Allan

Robin2

I know, i shouldnt try to fix what isnt broken, and a 3 second ON-press could be considered a feature to filter out accidental buttonpresses, but i still want to reduce the boot-delay as much as possible...
If you use ICSP programming then you won't need the bootloader and its associated startup delay.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

avr_fred

#3
Sep 22, 2017, 03:19 pm Last Edit: Sep 22, 2017, 08:56 pm by avr_fred
Not all bootloaders are created equal...

Just because your (current) bootloader takes 2-3 seconds to boot does not mean you have to dispense with the convenience of a bootloader. After all, what's an Arduino board without a bootloader? To me, it's just a microprocessor that needs a hardware based loading tool.

Please have a read through this thread:

https://forum.arduino.cc/index.php?topic=470086.0

Yes, you can have your fast boot and keep the bootloader. You just need to reflash your board with a current version of Optiboot (6.2). If you need help in doing that, please ask in this thread so that the explanation of the need couples with the solution.

Go Up