1

I am using atmega328P IC in my project. Currently my process to upload a code is to burn the bootloader according to my requirements and then upload using programmer USBasp .

Now from what I read is when you upload using ICSP you will overwrite the bootloader. I have a .hex file with and without bootloader I generated by compiling in arduino-cli.

Can I change the fuse settings and upload the code both from one .hex file directly ? Even if the fuse settings are different (different clock)?

dharmikP
  • 525
  • 2
  • 11
  • AVRs use ISP. ICSP is for PICs. As to whether the USBASP can program the fuses depends on what software you're using to drive it, so to answer that question, read the documentation. You'll want to make sure that the fuse settings align with what the bootloader expects otherwise the result will be sub-optimal. – Kartman Apr 20 '21 at 12:13
  • @Kartman Yes, ISP and ICSP are different but they are still often used interchangeably even though they are for very different micro-controllers. Even Arduinos have ICSP written o their board. – Artichoke Apr 26 '21 at 09:24
  • @hotglue - it helps to be precise. – Kartman Apr 26 '21 at 09:26
  • @Kartman Yes, it does open less opertunity for comfusion and error. – Artichoke Apr 26 '21 at 10:33

1 Answers1

0

This bit isn't quite clear:

Can I change the fuse settings and upload the code both from one .hex file directly ? Even if the fuse settings are different (different clock)?

You can use an AVR fuse calculator to work out what fuses to set and then use Avrdude (or Avrdudess for a GUI version) to set them. I would just overwrite the bootloader and upload using a programmer.

Not really sure if this answers your question but I am not quite clear on what you are trying to ask. If you fix the question I might be able to help a bit more.

EDIT:

You can set the fuse settings to the chip, then upload a hex file using a programmer like AVR ISP or USBASP if you want to avoid the bootloader. I'm pretty sure when you upload the hex file, it will not and can not do anything to the fuse settings, so do the fuses first. Also, you can upload your code straight from the Arduino IDE using a programmer by holding the shift key down during upload. However you can not set the fuse settings with it so better to just use avrdude or a GUI for it.

Artichoke
  • 437
  • 4
  • 11