What boot loaders and how to burn them would you recommend for the following devices?
Atmega328p-pu
Atmega4809
Please note that I have zero experience with burning bootloaders.
Thank you.
What boot loaders and how to burn them would you recommend for the following devices?
Atmega328p-pu
Atmega4809
Please note that I have zero experience with burning bootloaders.
Thank you.
Optiboot is very much standard on 328p. You have your choice of versions - a relatively old version that ships with most Arduino Uno-like boards and is part of the standard IDE download, the newer version that is part of MCUDude's "minicore", or the version from the Optiboot github repository (which is slightly different than the minicore version.) If compiling from source, you have compile options to consider. But the easiest is surely the one built in to Arduino, programmed with the "burn bootloader" command.
There are numerous tutorials on how to do this. Some of them correct. Many "mostly correct." I recommend Nick Gammon's stuff.
Note that many 4809 boards (Nano Every and Uno WiFi 2, for example) don't use a bootloader. Instead, they have actual device-programming code built into the USB/Serial chip that they use.
For boards that do use a bootloader, "Optiboot_x" is popular. There's a version distributed with MCUDude's "MegaCoreX", and the github optiboot repository (I'm afraid I've lost track of whether those are different or not.) Tutorials are less common.
In both cases, you'll need a "device programmer", which is either something you've bought, or special software and wiring of an existing Arduino. The programming hardware/software required is different between 328p (SPI ISP programming) and 4809 (UPDI programming.)
Wow!
So you would recommend the standard Arduino boot loader for a beginner for atmega328p?
I am ok with fiddling with stuff as long as there are instructions.
What about if I don’t have a dedicated serial chip yet and just want to program it with a diffrent Arduino?
If you have a read of the MegaCoreX webpage that was suggested by @westfw you should see a section under Programming called SerialUPDI.
SerialUPDI is a programmer that utilize a simple serial connection. It uses a USB serial adapter which can be turned into a UPDI programmer by adding a few passive components. You can read more about the details on how the SerualUPDI works here.
There's also jtag2updi which uses an UNO as a programmer.
There are UPDI equivalents to "Arduino as ISP", notably the jtag2updi that markd833 mentioned. They're not as painless and well-documented as the ISP sketch, though.
I guess I will start with the Atmega328s then.
Thank you!
which atmega328 boot loader is the most memory efficient?
All of the optiboot versions use only 512bytes (or slightly less) of flash memory (unless you enabled extra features.)
The hardware support for bootloaders on 328 is "quantized", and 512bytes is the minimum size.
Can I burn a different boot loader on to a chip that I have already burned a bootloader?
Yes you can overwrite the bootloader with a new/completely different bootloader.
However, be careful when setting the fuse bits. For a 328P it's possible to "brick" your chip if you accidentally disable the serial programming (SPIEN) and/or disable the RESET pin (RSTDISBL). You can still recover the chip but you need a high voltage programmer to do it.
So can I set the chip to use the built in crystal and then later burn the bootloader again and use a external crystal?
Short answer is yes you can. With an external crystal present, you can flip between internal and external clock sources.
However, with the 328P you can get stuck if you set the fuses to use an external crystal when you don't have one connected.
If that happens, then you need to provide an external clock in order to be able to write to your 328P again. There's a modified Arduino as ISP sketch that I think generates a 4MHz clock as well just for this scenario.
Thanks!
Any recommendations for bootloaders for Attiny85?
The newest bootloader you might want to look into is GitHub - stefanrueger/urboot: Small AVR bootloader using urprotocol
This uses a protocol that was designed from the ground up for bootloaders, allowing it to implement some additional features and size reductions, compared to optiboot. (optiboot uses the stk500v1 protocol that was originally designed to talk to a device programmer board, so it has to "fake" a number of options that are not relevant to a bootloader, while lacking features that ought to be there.
On the minus side, I think you need to manually install a new version of avrdude to get support for the urboot protocol.
Hmmm seems complex.
Anything good for a beginner?
Preferably offers support for many chips
Thanks!
a beginner should probably use the bootloaders that are included with the various Arduino projects (either the default optiboot for "real" Arduinos, the new optiboots for things like minicore, optiboot_x for 4809 and "xTiny", or optiboot_dx for the newer avr-DA/DB/etc chips.
Spence Konde ("DrAzzy") and MCUDude have gone to significant efforts to build and include bootloaders for an astounding number of chip/configuration combinations, and AFAIK they work fine.
I think I will start with Optiboot.
Thanks!
What does that stand for?
Thanks!
As Far As I Know
Minicore, MightyCore, MegaCore and MajorCore will very soon replace Optiboot in favour of Urboot. For the end user, it will be as simple as updating the core through the boards manager.
I guess I will just install all of them ![]()