Had a quick question regarding programming fuses and settings for the new 328PB.
Im having some boards produced, and I figured it would be easiest for me to just send the company the full hex file with boot loader, and they can burn it for me, saving me the time of sitting there with an ISP for each board to put the Arduino boot loader in there.
The PCB company sent me this, and I was wondering if anyone could confirm that this is correct for the 328PB? Im using the “Elektor Uno R4” boot loader for the 328PB.
(My project needs the extra pins of the 328PB, which is why Im using the new chip as opposed to the standard old 328P)
Last stupid question…I assume I just go to “Sketch—>export compiled binary”, and send the PCB assembly place that outputted hex file?
So the elektor_uno_r4 rule will build the hex file, the other rule is next. And bellow that is where your fuse setting.
As an FYI the elektor_uno_r4_isp rule will set values (e.g. HFUSE, LFUSE, EFUSE) and then run the "isp" rule.
I wish Arduino would have there IDE create a makefile for the project and then use it to build. Once I learned some stuff about makefiles I was able to use whatever editor was convenient (nano on Pi, gedit on Ubuntu) and also building remotely over SSH without any sort of GUI, a real build tool is awesome.
The fuses in your original message are almost certainly incorrect; they specify the use of the internal clock and the div8 fuse for a final clockrate of 1MHz, they have the wrong bootloader size, and they don't set the fuse that "enables" the bootloader. I'm pretty sure that the 328PB uses the same fuses as the 328P, so you should be able to copy the fuse values from the Elektor "boards.txt" file.
As of recent versions of the IDE, the build process has been producing TWO .hex files, one of which contains both the sketch and the bootloader. I don't know if the "export binary" copies both of them, though.
As of recently versions of avr-libc and/or avr-gcc, there is a mechanism for including the fuse values in the .elf file. I don't know whether this extends to .hex files or not. I also don't know if the various device programmers and their associated software have started supporting this (I don't think that avrdude does.)