Re: avrdude firmware writing question #qcx #firmware

Hans Summers

Hi Jim

> The Extended byte used by your Arduino programmer is inverted as compared to my
> universal programmer, so my 0xFC matches your 0x04 

Just to be clear: the extended byte is NOT inverted! In fact, the actual situation is that the unused upper 5 bits of it are defaulted to 1 in your programmer (and mine). This is an unfortunate point of inconsistency between AVR programmers, which can lead to some unnecessary confusion. The ATmega328 uses only the three least significant bits of the Extended byte. The correct setting for the QRP Labs firmware is 0x04 or 0xFC, these are the same... In Binary:
(where the X indicate that the chip doesn't care whether it's a 1 or a 0). 
The only difference between programmers is the way they read back the un-used bits; some read them back as 1, some read them back as 0. If you program the fuses as 0xFC i.e. 0b11111100 or as 0x04 i.e. 0b00000100 it makes absolutely no difference to the ATmega328 chip. But it DOES make a difference when you read back the fuses in your programmer during the verification step! If the programmer reads back 1's and you said 0x04, then you get a complaint; if it reads back 0's and you said 0xFC then you get a complaint. So... the moral of the story is to check the error message carefully and bear in mind all of the above :-)

So for clarification, these are the correct fuse settings for all current QRP Labs products using the ATmega328:

Low: 0xF7
High: 0xD1
Ext: 0xFC or equivalently, 0x04 (see above)

You may also see the High fuse set to 0xD9, this just means that the "preserve EEPROM contents through chip erase" fuse has not been set. Then when you erase the chip to flash the firmware, it will also wipe out the EEPROM contents. It is much better to preserve the EEPROM contents (and in the QCX, it is NECESSARY). In the U3S etc it avoids re-doing all the configuration settings. In any case where the new updated firmware has a different EEPROM layout to the former firmware version you had, then the firmware will automatically re-write the EEPROM to factory defaults. QCX chips and others now supplied have High 0xD1, which means the EEPROM contents ARE preserved. So I recommend this setting 0xD1 for everyone. 

The above applies whether the chip supplied (or the blank that you procured) is an ATmega328 or an ATmega328P. For the purposes of QRP Labs kits these two types of chip are both suitable and equivalent. We supply one or the other type depending just on availability and price. The suffix PU e.g. ATmega328-PU just indicates the 28-pin DIP carrier. 

A reminder of QRP Labs policy on firmware for all kits:

  • Firmware upgrades on any product are free for life; the .hex files are published here in the group files section for you to upgrade your chip
  • If you don't want to or can't upgrade your own chip, then you can buy the physical upgrade chip for any QRP Labs product here in the shop:
  • If you feel sufficiently upset or aggrieved about some kind of malodorous bug which has significantly perturbed your state of happiness, you can email me off-list and I will arrange a free upgrade chip to be sent to you
  • In general, Source code is not available (not open source)
  • Using QRP Labs firmware in your own one-off homebrew projects is Ok, but using QRP Labs firmware in any other commercial or quantity-produced kits or products is absolutely prohibited and severely un-cool!!

73 Hans G0UPL

Join to automatically receive all group messages.