I have used the Sparkfun Pocket AVR Programmer with DEV-09215 cable to successfully load the bootloader into a custom designed product that is essentially an Arduino Uno Rev 3 successfully. But lately it is giving me verification errors on all the atmega 16u2’s I try programming including one that I successfully programmed in the past. The odd thing is that the errors are not repeatable. For example, I get messages like “first mismatch at byte 0x3880 0xe8!=0x8b” but when I try loading again I get, “first mismatch at byte 0x3580 0x60!=0xf1”, etc. I see similar problems when trying to program the bootloader in the atmega328p device. Is there a way to check that the programmer itself is working correctly? I am using avrdude via the dos command with -b 19200 baud rate, but slowing it down further does not seem to help.
I don’t know of a way to test the programmer other than to maybe try connecting it to a Uno and burning the bootloader. A verification error could be caused by a lose connection. Have you tried using another cable? we find that the cables eventually wear out and need replacing.
Miraculously it started working this morning - sort of. I have found that I can load the 16u2 (12KB) and the 328p bootloader <optiboot_atmega328> (2KB) without errors, but I cannot load the 16U2 file (21KB). Using DFU and FLIP, I get a similar problem. FLIP tells me that the 21KB file address is out of range. Others have reported the same problem, but I have not seen a solution on line.
My question now is what is the downside to using the 12 KB file? It does not provide DFU, but why would I ever want that if I can use serial communications from the Arduino IDE?