Nottingham, UK
Offline
Jr. Member
Karma: 0
Posts: 90
Wait! Don't touch that wire...
|
 |
« on: May 09, 2010, 09:26:07 am » |
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 : 
|
|
|
|
|
Logged
|
|
|
|
|
Nottingham, UK
Offline
Jr. Member
Karma: 0
Posts: 90
Wait! Don't touch that wire...
|
 |
« Reply #1 on: May 10, 2010, 03:45:53 am » |
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...?)
|
|
|
|
|
Logged
|
|
|
|
|
Michigan, US
Offline
Full Member
Karma: 3
Posts: 148
Go Huskies
|
 |
« Reply #2 on: May 10, 2010, 05:19:10 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Offline
Shannon Member
Karma: 116
Posts: 10144
|
 |
« Reply #3 on: May 10, 2010, 05:23:05 pm » |
or if they are done by gcc based on the -mmcu command line option? Yes.
|
|
|
|
|
Logged
|
|
|
|
|
Nottingham, UK
Offline
Jr. Member
Karma: 0
Posts: 90
Wait! Don't touch that wire...
|
 |
« Reply #4 on: May 11, 2010, 04:51:32 am » |
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).
|
|
|
|
|
Logged
|
|
|
|
|
Dresden / Germany
Offline
Sr. Member
Karma: 3
Posts: 451
Entwicklungsklaus
|
 |
« Reply #5 on: May 27, 2010, 07:16:05 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Nottingham, UK
Offline
Jr. Member
Karma: 0
Posts: 90
Wait! Don't touch that wire...
|
 |
« Reply #6 on: May 27, 2010, 09:55:12 am » |
No not yet, (paid) work keeps getting in the way.  I have the Sanguino stuff to work with, which is lots of help.
|
|
|
|
|
Logged
|
|
|
|
|
Amsterdam
Offline
Full Member
Karma: 0
Posts: 136
he's looking at you, kiddy...
|
 |
« Reply #7 on: May 27, 2010, 01:44:29 pm » |
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) 
|
|
|
|
|
Logged
|
-- "We're all in this together..."
|
|
|
|
Dresden / Germany
Offline
Sr. Member
Karma: 3
Posts: 451
Entwicklungsklaus
|
 |
« Reply #8 on: May 28, 2010, 07:19:10 am » |
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
|
|
|
|
« Last Edit: May 28, 2010, 07:21:08 am by ChrisS »
|
Logged
|
|
|
|
|
Michigan, US
Offline
Full Member
Karma: 3
Posts: 148
Go Huskies
|
 |
« Reply #9 on: May 29, 2010, 06:45:16 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Dresden / Germany
Offline
Sr. Member
Karma: 3
Posts: 451
Entwicklungsklaus
|
 |
« Reply #10 on: May 29, 2010, 07:04:58 am » |
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)
|
|
|
|
« Last Edit: May 29, 2010, 07:10:20 am by ChrisS »
|
Logged
|
|
|
|
|
Dresden / Germany
Offline
Sr. Member
Karma: 3
Posts: 451
Entwicklungsklaus
|
 |
« Reply #11 on: May 29, 2010, 07:14:49 am » |
Maybe, have a look at this... last Update... espacially 0S.... http://forums.adafruit.com/viewtopic.php?f=25&t=13596Could be the next Hint in this Dungeon of compatibility  Greetings ChrisS
|
|
|
|
|
Logged
|
|
|
|
|
Michigan, US
Offline
Full Member
Karma: 3
Posts: 148
Go Huskies
|
 |
« Reply #12 on: May 29, 2010, 03:26:53 pm » |
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.
|
|
|
|
« Last Edit: May 29, 2010, 03:41:05 pm by mdmetzle »
|
Logged
|
|
|
|
|
Michigan, US
Offline
Full Member
Karma: 3
Posts: 148
Go Huskies
|
 |
« Reply #13 on: May 29, 2010, 05:17:20 pm » |
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
|
|
|
|
« Last Edit: May 29, 2010, 05:21:07 pm by mdmetzle »
|
Logged
|
|
|
|
|
Dresden / Germany
Offline
Sr. Member
Karma: 3
Posts: 451
Entwicklungsklaus
|
 |
« Reply #14 on: May 29, 2010, 06:29:47 pm » |
Did you recognise my post ....? -Os Did you recognise the neccessary changed LDadress?
Links i have already posted?
Greetings ChrisS
|
|
|
|
|
Logged
|
|
|
|
|
|