Bootloader compatibility  ATmega 1280 and 1284P

Not having access to the datasheets (or much else barring a browser), can anyone tell me whether the bootloader designed for the Arduino Mega board (or indeed the DFRobot MEGA 2010 clone) would work unchanged on the ATMega1284P-PU ?

(Obviously, the 1280, being TQFP, has more pins than a 40-pin DIP, but that aside, is the core functionality the same?

If not, I guess I will have to wait until I can compare the data sheets and work out what would need to be changed to modify the bootloader and core accordingly. Since there are differences for the 168, 328 and 1280 already, and I have a fair amount of experience as a C developer (27yrs+) including low-level (Un*x driver), it should be a fun project ::slight_smile:

Having now read the datasheets, there are a number of differences between the parts (number of USARTS, timers) as well as the obvious ones such as number of available pins.

However, it is fairly simliar to the 1280, so should be doable.

Can anyone tell me where/how the compile-time device type (AVR_ATmega1280, AVR_ATmega8) are actually defined, or if they are done by gcc based on the -mmcu command line option?

Thanks
(And presumably, I should use the developers mailing list to feed back any changes...?)

The ATMega1284p is actually closer to the ATMega644p than the the 1280.

I to am very interested in getting the boot loader onto the 1284, got a few of the DIP versions.

or if they are done by gcc based on the -mmcu command line option?

Yes.

Oh good. Then modifying boards.txt will deal with it, and I can use the 644P as a basis to work from. I expect, if previous experiences with PICs is anything to go by, my most difficult job will be getting the fuses right.

Fortunately, the fuse calculator will be a big help.

Anyone know how imminent 0019 is? (I should ask on the developer mailing list really).

Maybe it's my mistake, but I think a modified Sanguino-Setup should be the key.

So, got you any efforts with 1284p?

Greetings
ChrisS

No not yet, (paid) work keeps getting in the way. :frowning:
I have the Sanguino stuff to work with, which is lots of help.

Can anyone tell me where/how the compile-time device type (AVR_ATmega1280, AVR_ATmega8) are actually defined, or if they are done by gcc based on the -mmcu command line option?

that is done by the arduino IDE in parsing the commands to avrdude. it is taken from

attiny85.build.mcu=attiny85

from the boards.txt file in the ~/documents/Arduino/hardware/attiny85/
folder

you could try it first in the terminal directly with avrdude to see if it knows the part.

more info here:

http://www.nongnu.org/avr-libc/user-manual/using_tools.html

(learned from the "coding badly" user here on the forum) :wink:

hmm, found something nice on DuinOS Thread... part of the board.txt...

seems this is what we search for....

Multiplo_Brain_M1284_DuinOS.name=Multiplo.Brain.M1284 + DuinOS
Multiplo_Brain_M1284_DuinOS.upload.protocol=stk500v2
Multiplo_Brain_M1284_DuinOS.upload.maximum_size=131072
Multiplo_Brain_M1284_DuinOS.upload.speed=19200
Multiplo_Brain_M1284_DuinOS.upload.verbose=true

Multiplo_Brain_M1284_DuinOS.bootloader.low_fuses=0xFF
Multiplo_Brain_M1284_DuinOS.bootloader.high_fuses=0xDC
Multiplo_Brain_M1284_DuinOS.bootloader.extended_fuses=0xFD
Multiplo_Brain_M1284_DuinOS.bootloader.path=ADABootloader
Multiplo_Brain_M1284_DuinOS.bootloader.file=ADABoot_1284p.hex
Multiplo_Brain_M1284_DuinOS.bootloader.unlock_bits=0x3F
Multiplo_Brain_M1284_DuinOS.bootloader.lock_bits=0x0F

Multiplo_Brain_M1284_DuinOS.build.mcu=atmega1284p
Multiplo_Brain_M1284_DuinOS.build.f_cpu=16000000L
Multiplo_Brain_M1284_DuinOS.build.core=arduino.DuinOS
Multiplo_Brain_M1284_DuinOS.verbose=true

So, we have a little bit to modify, but essentially this should be the key...

For Pin assignment we have to adapt from Sanguino, but boards.txt (fuses etc.) should be this i think.

Maybe some of you may try it with 1284?

Greetings ChrisS

Ive tried something similar(modified the board.txt for sanguino) and the version of avrdude in arduino18 does not have the 1284p listed. So when you try and upload the bootloader(again i just modified the sanguino one) it complains about the chip being invalid. The newest avrdude that comes with AVRstudio has no such issue. However I either have a wiring error in my board or the arduino as ISP will not suffice for programming a 1284p.

The problem I have is for instance when i try to read the fuses it gets half way through then throws an error as it seems the arduinoISP sketch has frozen.

So when you try and upload the bootloader(again i just modified the sanguino one) it complains about the chip being invalid.

Would you please post detailed Debuginformation / Debugwindow-Output?

Thank you!

mmh, sketch compiles errorfree right?

arduino-0018\hardware\tools\avr\avr\lib\avr51\crtm1284p.o

I don't know what happens here... 1284p is a chipreplacement for 644p. Should be fully compatible.

Greetings ChrisS

(my 1284p are on the way, i can't test it by myself until they are arrived)

Maybe, have a look at this... last Update... espacially 0S....

http://forums.adafruit.com/viewtopic.php?f=25&t=13596

Could be the next Hint in this Dungeon of compatibility :wink:

Greetings ChrisS

Sure:
When I try to burn the boot loader from the arduino environment with my freeduino running the arduinoISP sketch the output is:

D:\Myles\Desktop\arduino-0018\hardware/tools/avr/bin/avrdude -CD:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega1284p -cstk500v1 -P\\.\COM3 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDC:m -Ulfuse:w:0xFF:m 


avrdude: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf"

avrdude: AVR Part "atmega1284p" not found.

Valid parts are:
  m6450 = ATMEGA6450      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:11732]
  m3250 = ATMEGA3250      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:11543]
  m645 = ATMEGA645       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:11354]
  m325 = ATMEGA325       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:11165]
  usb1287 = AT90USB1287     [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:10977]
  usb1286 = AT90USB1286     [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:10788]
  usb647 = AT90USB647      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:10599]
  usb646 = AT90USB646      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:10409]
  t84  = ATtiny84        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:10226]
  t44  = ATtiny44        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:10044]
  t24  = ATtiny24        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:9862]
  m2561 = ATMEGA2561      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:9669]
  m2560 = ATMEGA2560      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:9476]
  m1281 = ATMEGA1281      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:9288]
  m1280 = ATMEGA1280      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:9099]
  m640 = ATMEGA640       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:8911]
  t85  = ATtiny85        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:8730]
  t45  = ATtiny45        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:8551]
  t25  = ATtiny25        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:8371]
  pwm3b = AT90PWM3B       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:8190]
  pwm2b = AT90PWM2B       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:8007]
  pwm3 = AT90PWM3        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:7824]
  pwm2 = AT90PWM2        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:7640]
  t2313 = ATtiny2313      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:7453]
  m328p = ATMEGA328P      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:7265]
  m168 = ATMEGA168       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:7077]
  m88  = ATMEGA88        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:6891]
  m48  = ATMEGA48        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:6704]
  t861 = ATTINY861       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:6516]
  t461 = ATTINY461       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:6327]
  t261 = ATTINY261       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:6138]
  t26  = ATTINY26        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:5981]
  m8535 = ATMEGA8535      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:5823]
  m8515 = ATMEGA8515      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:5665]
  m8   = ATMEGA8         [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:5505]
  m161 = ATMEGA161       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:5365]
  m32  = ATMEGA32        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:5190]
  m6490 = ATMEGA6490      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:4997]
  m649 = ATMEGA649       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:4812]
  m3290 = ATMEGA3290      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:4629]
  m329 = ATMEGA329       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:4444]
  m169 = ATMEGA169       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:4264]
  m163 = ATMEGA163       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:4121]
  m162 = ATMEGA162       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:3925]
  m644p = ATMEGA644P      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:3734]
  m644 = ATMEGA644       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:3543]
  m324p = ATMEGA324P      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:3351]
  m164p = ATMEGA164P      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:3159]
  m16  = ATMEGA16        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:2981]
  c128 = AT90CAN128      [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:2790]
  m128 = ATMEGA128       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:2612]
  m64  = ATMEGA64        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:2431]
  m103 = ATMEGA103       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:2291]
  8535 = AT90S8535       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:2170]
  8515 = AT90S8515       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:2056]
  4434 = AT90S4434       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:1973]
  4433 = AT90S4433       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:1849]
  2343 = AT90S2343       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:1725]
  2333 = AT90S2333       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:1640]
  2313 = AT90S2313       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:1527]
  4414 = AT90S4414       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:1414]
  1200 = AT90S1200       [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:1299]
  t15  = ATtiny15        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:1166]
  t13  = ATtiny13        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:993]
  t12  = ATtiny12        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:860]
  t11  = ATtiny11        [D:\Myles\Desktop\arduino-0018\hardware/tools/avr/etc/avrdude.conf:796]

latest avrdude output in next post
Edit - tracked down the latest avrdudes errors to being a wireing fault gonna try and fix that before I say anymore.

Yeah it was my circuit I rewired it and i can now download code to it through the ICSP connection. I managed to set the fuses and get the sanguino boot-loader onto it. However the boot-loader does not work. I know its running as it is flashing the led while its in the boot-loader.

I also update copy of avrdude that arduino 18 uses, to do that just backup the avrdude executable and config file and overwrite them for windows they are in:
arduino-0018\hardware\tools\avr\etc\avrdude.conf
arduino-0018\hardware\tools\avr\bin\avrdud.exe

Did you recognise my post ....? -Os
Did you recognise the neccessary changed LDadress?

Links i have already posted?

Greetings
ChrisS

I finally got the ICSP connection working reliably, and the arduino18 environment to burn the bootloader. I successfully uploaded the ADAboot loader with the modifications and the compiler optimizations ChrisS linked to. I however do not know if it is working, as the LED does not blink. Also I have not tried to actually upload any code to the device either. Ill get to work on this more tomorrow but thats all for now.

mmh, ok... gratulation to this step.

I ask because the bottom of the link says:
"RESOLVED: I modified the optimization from -O2 to -Os and NO ERRORS! and now the bootloader is working (led flashes correctly) :D"

you say nothing flashes...
also in your LAST posting with commandprompt, there is no such optimization switch...

I hate to say....mmh, are you shure about your ledwiring?
Have you checked/wired ResetPin?

In my opinion, it should work already if you patched files in 1284p Hardarefolder like for 644p.

Check this to be sure:
http://www.robotcraft.ca/webshop/images/projects/arduino-0011-core-visual-diff-modded-vs-original_2.gif

This is patch modification for 644p... by Robocraft/(maybe NYC Resistor).

mmh, i don't have checked fuses already... please recheck them...

i will do my checks if 1284p have arrived... angry it seems that I have choosen a real real real slow slow company for selling me 1284p. :expressionless:

I don't know if Adaboot needs some special Hardware thingys around mcu to work/startup?

For today, I wish you good luck... hope to hear more good news from you :slight_smile:

Greetings ChrisS

After much frustration I have tracked all my issues down to a breadboard with many faulty junctions....

I did end up getting the bootloader to blink the LED again a bad junction. This is to say the least frustrating. I have not been able to upload code as I am having trouble finding good connections...

Ok here is were I am. I have it so that arduin 18 is able to burn the boot loader correctly, and the status LED does indeed blink while it is in the boot loader however the bootloader does not work. The code downloads and during the verification process all 0xFF is returned. with the modified adaboot loader that chrisS linked too.

0xFF isn't right I think....

Seems you got clock or connection problems....

Check clock Fuses / connection... I think Fuses maybe the Problem...
I know... blinking works...

I got much 0xFF's while testing with 644P.... and the answer where in my task that I used wrong Capacitors for Clock-Quarz. I used micoFrard not Pico... that happend by me.

Checkit... it may help you.

Try the latest AVRStudio for test to burn Bootloader... without IDE... still supports 1284p.

Greetings ChrisS