installing an arduino bootloader
HTML-код
- Опубликовано: 7 сен 2024
- One thing that can happen with cheap arduino clones is that they sometimes come without a bootloader installed.
Fortunately it's not too hard to install yourself.
Here's a couple of methods - one that is easier (in my experience) than the other.
Feel free to comment on my mistakes in the convenient comment section below.
-----
My tip jar: / pileofstuff
-----
This isn't the only way to do it.
It's probably not the best way to do it.
But it's how I do it.
Back to working on my blown 16U2, and my ISP through a UNO failed like yours. Had a play and changed the COM port to the UNO COM port, and it worked. Looks like you direct to the target, but use the COM of the device you are using to do the talking.
Inneresting.. I'll have to re-visit this and give that a try.
thanks for the tip.
The USB serial ATMEGA16U2 IC on my MEGA2560 caught fire so I soldered a new Ebay on. Unfortunately it looks like it needs FW as well, so I'll have to work that out now.
Apparently Nick Gammmon's bootloader sketch can also do the 12U2. Haven't tried it myself, but it looks promising.
I tried the FLIP method but it didn't work, so I will look that up.
Basically the main problem is that I don't know what I'm doing. lol
I don't really either!
Fortunately, there's some people with more experience on some of these things that I'm learning, and some of them give a bit of help in the comments.
Super ok 100% functional :))
Nick Gammon wrote and maintains a bootloader sketch that autodetect the IC (168/328/...) and burns the correct bootloader for a 5V arduino. Just Google for it.
Nick Gammon writes tonnes of useful stuff! I live without any Arduino hardware, or factory made ICSPs. It can be a bootstrapping adventure to buy an unfamiliar AVR8 chip and make it work the first time. Interesting to install USBASPLoader, a bootloader that bit-bangs USB 1.0 on the atmegas. Micronucleus is similar for attiny chips. Optiboot (probably installed on this video) can be frustrating on home projects, because it really needs DTR/RTS signals to pull RESET low at precisely the right time.
That sounds clever. I'll have to check it out.
Thanks for the heads up!
GnuReligion: Yeah, This probably used optiboot. It seems to be the "factory default" that comes with the IDE.
As you can probably tell, I'm not a software guy, so I tend to take teh defaults when they are available. I tend to treat software as just a means to the end of getting my hardware working most of the time.
It probably did come with a bootloader, only not the one the IDE expects. ;) It probably comes with the old bootloader like they did for years and years. But recently Arduino started to ship the Nano with the Optiboot bootloader (exactly the same as an Uno) and published an update for the board files. From that moment the default when selecting the Nano as target is to expect Optiboot aka it does the same as the Uno selection. For the older type you now have to select "old bootloader" under target device. Aka, the behaviour of the IDE changed. You could probably have uploaded just fine when you selected "Nano old bootloader" or even "Pro Mini 16MHz". Not that it's a bad thing to switch to Optiboot! It's smaller (leaves more space for your program), uploads faster and has no waiting time on boot. So I always burn Optiboot to all Nano's and even Pro Mini's I receive. And if I'm correct (from the top of my head, I'm on vacation), if you install the MiniCore board you also have a Optiboot compatible option for other processors and clock speeds.
Those are all good suggestions.
I did try the "old bootloader" and other speed and processor options (and even an older version of the IDE) before I decided it was actually the lack of bootloader.