I had a PCB already made, with an ATmega328 soldered on. I had an AVRISP MKII laying around and an Arduino Duemilanove. Rather than desoldering the ATmega328 off the PCB and plugging it into the duemilanove, I just used the ICSP port I had on the board.
- Power up the PCB so that the ATmega328 or ATmega168 gets 5v of power.
- Plug the USB Cable into the AVRISP MKII and the programming cable from the AVRISP MKII into the ICSP of the board.
- Make sure the chip has the bootloader on it.
- Open up C:\Program Files (x86)\arduino-0022\hardware\arduino\boards.txt (file path may be different) and add the appropriate code below. You can add both if you want.
How to Burn the Bootloader onto ATmega Chip
Board Code for ATmega168 and AVRISP mkII
###############################################
avrispmkii.name=AVRISP mkII w/ ATmega168
avrispmkii.upload.protocol=avrispmkii
avrispmkii.upload.maximum_size=14336
avrispmkii.upload.speed=19200
avrispmkii.upload.using=avrispmkii
avrispmkii.bootloader.low_fuses=0xff
avrispmkii.bootloader.high_fuses=0xdd
avrispmkii.bootloader.extended_fuses=0×00
avrispmkii.bootloader.path=atmega
avrispmkii.bootloader.file=ATmegaBOOT_168_diecimila.hex
avrispmkii.bootloader.unlock_bits=0×3F
avrispmkii.bootloader.lock_bits=0×0F
avrispmkii.build.mcu=atmega168
avrispmkii.build.f_cpu=16000000L
avrispmkii.build.core=arduino
###############################################
Board Code for ATmega328 and AVRISP mkII
###############################################
avrispmkii.name=AVRISP mkII w/ ATmega328
avrispmkii.upload.protocol=avrispmkii
avrispmkii.upload.maximum_size=30720
avrispmkii.upload.speed=19200
avrispmkii.upload.using=avrispmkii
avrispmkii.bootloader.low_fuses=0xFF
avrispmkii.bootloader.high_fuses=0xDA
avrispmkii.bootloader.extended_fuses=0×05
avrispmkii.bootloader.path=atmega
avrispmkii.bootloader.file=ATmegaBOOT_168_atmega328.hex
avrispmkii.bootloader.unlock_bits=0×3F
avrispmkii.bootloader.lock_bits=0×0F
avrispmkii.build.mcu=atmega328p
avrispmkii.build.f_cpu=16000000L
avrispmkii.build.core=arduino
###############################################
After adding the code you should be able to change the board to use the AVRISP mkII programmer. See the below screenshot.
- Sony Cybershot W120 Teardown and LCD Replacement
- How to Hook up an N-Channel MOSFET
- LCD Screen No Power, No Signal






Hi,congratulation!!,
Can you tell me how to configure the “board.txt” for use with the ATMEGA2560?
Best regards,
Jon
Hi Jon,
Yes, try adding this code for Arduino Mega 2560. I don’t have this chip/board so I can’t test it to double check. Let me know if it works.
##############################################################
mega2560.name=Arduino Mega 2560
mega2560.upload.protocol=stk500v2
mega2560.upload.maximum_size=258048
mega2560.upload.speed=115200
mega2560.bootloader.low_fuses=0xFF
mega2560.bootloader.high_fuses=0xD8
mega2560.bootloader.extended_fuses=0xFD
mega2560.bootloader.path=stk500v2
mega2560.bootloader.file=stk500boot_v2_mega2560.hex
mega2560.bootloader.unlock_bits=0×3F
mega2560.bootloader.lock_bits=0×0F
mega2560.build.mcu=atmega2560
mega2560.build.f_cpu=16000000L
mega2560.build.core=arduino
##############################################################
Also you may need the hex file mentioned in that code above. Download: stk500boot_v2_mega2560.hex and save it to the appropriate arduino folder.