Go Down

Topic: Add a new Atmega328 clone device (Read 1 time) previous topic - next topic

HugoPT

Happy new year folks.
I'm strugling to put a new board on boards.txt
I bought some Atmega328P on ebay and for my surprise they have a different Signature. The original one should have a device signature = 0x1e 0x95 0x0F but mine has 0x1e 0x95 0x14 so every time I want to upload a program to it I changed the avrdude.conf to the new signature. I also have a Arduino Duemilanove and when I change to this board has expected it complains about wrong signature and again i change manual the signature to the original one.
I'm tired to very time change the file, so today I try to add a new board to boards.txt
I just copy the existing entry for the original Atmega328 and edit it like this:
Code: [Select]
#atmega328.name=TempController

atmega328.upload.protocol=arduino
atmega328.upload.maximum_size=30720
atmega328.upload.speed=57600

atmega328.bootloader.low_fuses=0xFF
atmega328.bootloader.high_fuses=0xDA
atmega328.bootloader.extended_fuses=0x05
atmega328.bootloader.path=atmega
atmega328.bootloader.file=ATmegaBOOT_168_atmega328.hex
atmega328.bootloader.unlock_bits=0x3F
atmega328.bootloader.lock_bits=0x0F

atmega328.build.mcu=ATmega328
atmega328.build.f_cpu=16000000L
atmega328.build.core=arduino
atmega328.build.variant=standard


If I save and then restart arduino IDE it wont appear on the device list, but if I remove the existing it then appears then.
Also I know this will not fix my problem about the signatures because AVRdude is still using the same cpu target atmega328.build.mcu=ATmega328

Any help how can I fix this?



Debian,Mint,Ubuntu
Arduino Mega 2560
Arduino Nano
Arduino Duemilanove
MAC OS Montain Lion
Raspberry PI Model B

WizenedEE

The very first string before the . is the "internal name" of the device. It has to be different for every board. So change "atmega328.<whatever>" to "<somethingelse>.<whatever>"

eg
Code: [Select]

#tempcontroller.name=TempController

tempcontroller.upload.protocol=arduino
tempcontroller.upload.maximum_size=30720
tempcontroller.upload.speed=57600

tempcontroller.bootloader.low_fuses=0xFF
tempcontroller.bootloader.high_fuses=0xDA
tempcontroller.bootloader.extended_fuses=0x05
tempcontroller.bootloader.path=atmega
tempcontroller.bootloader.file=ATmegaBOOT_168_atmega328.hex
tempcontroller.bootloader.unlock_bits=0x3F
tempcontroller.bootloader.lock_bits=0x0F

tempcontroller.build.mcu=ATmega328
tempcontroller.build.f_cpu=16000000L
tempcontroller.build.core=arduino
tempcontroller.build.variant=standard

HugoPT

#2
Jan 01, 2013, 11:57 pm Last Edit: Jan 02, 2013, 06:07 pm by HugoPT Reason: 1
OK it worked.
Now is there any way to create new devices on AVRDUDE?
Debian,Mint,Ubuntu
Arduino Mega 2560
Arduino Nano
Arduino Duemilanove
MAC OS Montain Lion
Raspberry PI Model B

MarkT

What you seem to have acquired there are ATmega328, not ATmega328P - the difference is the 328P has some extra power-saving features.
Check what's printed on the package.
[ I won't respond to messages, use the forum please ]

WizenedEE


OK it worked.
Now is there any way to create new devices on AVRDUDE?


in avrdude.conf (hardware/tools/avrdude.conf) search for "atmega328p." Copy its entire entry and change the appropriate options (probably id, desc, and signature). Then make your new boards.txt entry reference the new id.

Go Up