0

It’s been bugging me lot that Can’t we burn the same bootloader for both 328p and 328p au?

I got confused when I see this linksmd 328p au bootloader burn.

Will there be any impact on performance or any other impact if I use same bootloader for both?

4
  • AFAIR the bootloader is the same for both chips.
    – Majenko
    Commented Jan 9, 2020 at 9:47
  • My question is, I read if we burn 328p bootloader to smd 328p au, it might not perform well. That’s how I got this url as a reference. Because Uno is having through hole chip with 28 pins and smd 328p is having 32 pins. I’ll update where I read that smd chip 32 pins might not perform well if we upload 328p through hole chip bootloader.
    – Learner
    Commented Jan 9, 2020 at 10:36
  • Your link does not mention explicitly, which bootloader is used. The IDE allows to choose different boards, which refers to different sections in boards.txt There the address of the appropriate bootloader is found. Uno and Nano should refer to the same optiboot/optiboot_atmega328.hex Commented Jan 9, 2020 at 12:48
  • @DataFiddler, the tutorial is before Nano had a bootloader selection.
    – Juraj
    Commented Jan 9, 2020 at 13:18

2 Answers 2

1

The bootloader doesn't care about how many pins the device has. All it cares about is the UART pins, and they are the same.

Internally the two chips are the same, it's just the packaging that is different. They take the same silicon chip and mount it on a different lead frame and encapsulate it in epoxy. Which is why the only pin differences are a couple of extra power and ground pins, and two dedicated ADC pins that they don't connect in the DIP package. Even the pins are in the same order around the chip if you examine the pinouts in the datasheet.

Whether you use the DIP (Uno) or the SMD (Nano) bootloader it makes no difference (the two bootloaders are the same anyway). There can be no "perform better" anyway, since that isn't a valid concept. Either it is compatible, in which case it will work, or it's not, in which case it won't.

The only real thing of concern is to ensure that your fuses are set correctly for your chosen clock source, and that the bootloader you install is compiled to run at the speed of your chosen clock source. That has nothing at all to do with which chip it is you are using, but how you have designed your circuit.

2
  • I got the clarity now. Thanks. By the way I’m am using it with 16Mhz and 22pf capacitors as a normal Arduino simple circuit nothing super.
    – Learner
    Commented Jan 9, 2020 at 10:47
  • I was in an impression of two different bootloaders for them. Thanks again for clarifying.
    – Learner
    Commented Jan 9, 2020 at 10:48
0

Two different bootloaders are used for ATmega328p. One is used in Uno, it is based on Optiboot 4. Second is used in Arduio Nano and is based on Atmel bootloader. Arduino replaced the old Nano bootloader with the Uno Optiboot bootloader in 2018, but Nano clones and old Nanos still in use have the old bootloader. In current AVR boards package version there is a bootloader selection in Tools menu.

With the burn of bootloader fuses are written to set the bootloader area size.

The old Nano bootloader is 2 kB large. The Optiboot bootloader is 0.5 kB large (small). But Arduino didn't change for Nano the size of the flash memory reserved for bootloader so 1.5 kB of flash memory is lost because of inaccurate fuse setting.

The old Nano bootloader didn't reset the watchdog flag. If your sketch setup the watchdog for some short time, after the reset the watchdog did reset the MCU while still in bootloader ending in endless reset loop.

The tutorial in your question would flash the Nano bootloader, because the author of the tutorial has Nano as target board while burning the bootloader. In 2017 it would be the Old bootloader.

So the Uno bootloader is recommended for ATmega328p with Uno fuse settings for bootloader size. After uploading the "Arduino as ISP" sketch and before activating "Burn bootloader" change the board selection to Uno.

Notes:

  • For ATmege328p with different frequency then 16 MHz the bootloader must by build with the required frequency.
  • there are newer versions of Optiboot (7 is current) with additional options. Some of the options result in larger bootloader.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.