Arduino Using USBASP
I bricked my Arduino UNO the other day - it was an accident waiting to happen.

I have been working with GPS recievers, pulling the NMEA $GPRMC time stamp messages from a Garmix. Of course it was bound to happen, I upload
new code while forgetting to disconnect the serial data being transmitted from the Garmin into Pin 0, serial RX, of my UNO - double data clash and a
corrupted serial transceiver on my Arduino based in the 16U2.

You get lucky most of the time, the upload fails, you unplug the GPS from the GPS, re-upload and voila.....but not this time.

I knew it would take ages to fix, I hadn't used my USBASP for two years and I was rusty

I had a USBASP of questionable firmware : I will come to that
I ran Arduino 1.6.5 and libusb-win32 driver for my  USBASP from

TWO lost weekends struggling  and I think I have it.......

For ease I copied avrdude.conf to the SAME directory as avrdude.exe

FIRST : Flash the Serial 16u2 port

avrdude -p m16u2 -F -P usb -c usbasp -U flash:w:Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m
-U efuse:w:0xF4:m -U lock:w:0x0F:m

Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex = MD5 of 374845d004d03c6ca0535bb4b6f19235

SECOND : Flash the bootloader into the 328

avrdude -p m328p -F -P usb -c usbasp -U flash:w:ATmegaBOOT_168_atmega328_pro_8MHz.hex

ATmegaBOOT_168_atmega328_pro_8MHz.hex = MD5 654f86b6aff0ce8a50e161bfa497f787

After this : BOTH my unos talked via ISPASP and the Arduino software correctly

For a MEGA 2560 R 3 board

~~\bin> avrdude -p m16u2 -F -P usb -c usbasp -U flash:w:GenuinoMega2560Serial_june17.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m
-U lock:w:0x0F:m

GenuinoMega2560Serial_june17.hex : MD5 : 780a27d0ad33444c431855d2d85423d7

The MEGA Serial
Hex file that worked for me

I will update on flashing my USBASp : The page I have found and will copy is from
Roger Clarke's post ( thank you ! )

It's sunny here in Cheshire - I'm off for a bicycle ride!

A :)