Dienstag, 29. Mai 2012

arduino BootLoader on ATmega328 (non pico power)

If you want to flash a ATMEGA328-PU (non pico power) with the arduino bootloader you have to change the chip signature.

I have created a "new" Board in Arduino which is only for flashing the bootloader.
Open [arduino-dir]\hardware\tools\avr\etc\avrdude.conf in Editor and search for ATMEGA238P
you'll find this line:
#------------------------------------------------------------
# ATmega328P
#------------------------------------------------------------




then copy the header with all information (to the next header) and paste it right before the next header.
Then change the Header, id, desc...
#------------------------------------------------------------
# ATmega328
#------------------------------------------------------------

part
    id            = "m328";
    desc        = "ATMEGA328";
 ...and the signature:
    signature        = 0x1e 0x95 0x14;
Save it and close avrdude.conf

Next Step is [arduino-dir]\hardware\arduino\boards.txt:
You can copy and paste following lines:

##############################################################

unoFlash.name=Arduino Uno BL flash to ATMEGA328
unoFlash.upload.protocol=arduino
unoFlash.upload.maximum_size=32256
unoFlash.upload.speed=115200
unoFlash.bootloader.low_fuses=0xff
unoFlash.bootloader.high_fuses=0xde
unoFlash.bootloader.extended_fuses=0x05
unoFlash.bootloader.path=optiboot
unoFlash.bootloader.file=optiboot_atmega328.hex
unoFlash.bootloader.unlock_bits=0x3F
unoFlash.bootloader.lock_bits=0x0F
unoFlash.build.mcu=atmega328
unoFlash.build.f_cpu=16000000L
unoFlash.build.core=arduino
unoFlash.build.variant=standard

##############################################################
Then you can start arduino and you'll see something like this:


Now select "Burn Bootloader" and you're finished!

Please Note: This is only for flashing the bootloader! For uploading the sketch to the ATmega you need to select "Arduino Uno" or you'll get an error.


If you use the AVR ISP MKII by Atmel you'll need the driver which is located here:
[arduino-dir]\hardware\tools\avr\utils\libusb\bin\avrisp2.inf

 Have Fun!


Keine Kommentare:

Kommentar veröffentlichen