I am using Atmega328p in my circuit. I will be programming this IC using Arduino. But because this is a PCB, so I will programming using USBasp programmer. So before uploading code as upload using programmer, I will select my arduino board in board select menu and then I will select USBasp as my programmer. But I want to know that is it really necessary to burn bootloader on a new Atmega328p IC. On some page, they say you do not require it. But some say, its necessary because you will be using Arduino functions like Serial.Begin() etc.

So I want to know what does this bootloader contains. Do I really need it. Can I directly upload my code using programmer. Can anyone please explain this to me.?

  • 1
    The bootloader is used to allow flash "self-programming" by the MCU, though USB. If you program the MCU through ISP, you don't need it. If you want to recover bootloader bytes though, you'll have to change some fuses (can't remember which ones, it also depends on the MCU, but you can google for it).
    – jfpoilpret
    Feb 21 '17 at 9:41
  • In fact, the bootloader is used to program a board through serial, not USB. So you may want to flash a bootloader on the 328p with an USBasp, then you just need to use the serial interface to download new sketches. On the other hand, you can gain a bit more space and faster boot times without a bootloader
    – frarugi87
    Feb 21 '17 at 10:41
  • You don't need to, but it has the side effect of setting the fuses. You you could just run it once. Then when you program your sketch, it will overwrite the bootloader, but keep the fuses. You could also manually set the fuses, which is preferable but a bit more complicated.
    – Gerben
    Feb 21 '17 at 12:33
  • IIRC, at least the BOOTRST fuse should be programmed differently depending on whether you are using a bootloader or not. Feb 21 '17 at 15:02

No, you do not need the bootloader for your chip to function. The bootloader is merely a convenience.

If you are programming through USBasp you don't even need it on a "normal" Arduino board.

All it does is allow you to program through the UART interface (or USB interface in the case of ATMega32U4 boards). If you don't want to do that then you don't need the bootloader.

If you do not provide a UART interface to the user that can be connected to then the bootloader would be pointless anyway since you cannot communicate with it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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