I have managed to put micronucleus bootloader on an ATtiny85. Using it, I can successfully upload programs to my ATtiny through USB and they run as they should, as long as they are connected to USB. When I only connect the Tiny to +5V and GND, it does not run the program. How can I change that? How can I make it so that my programs run even without connecting the ATtiny85 to USB?
Electronic – run a program, on an ATtiny85 with micronucleus bootloader, without usb connected
attinybootloaderusb
Best Answer
The bootloader should exit and run the user program after 6 seconds if USB is not connected. If that is too slow then you can recompile with a shorter delay, or set AUTO_EXIT_NO_USB_MS >1.
If the user program doesn't appear to be running after the timeout period then you probably have some other problem. Perhaps your program has a bug that stops it from working properly if the bootloader doesn't communicate with the USB port first (check for uninitialized variables, hardware registers not being set to defined states etc.).
Also, if the board is powered by the USB port when plugged into it then make sure that your external power supply is good enough to run it stand-alone.
(in bootloaderconfig.h)