Go Down

Topic: Bootloader compatibility  ATmega 1280 and 1284P (Read 13226 times) previous topic - next topic


Jun 21, 2010, 01:58 pm Last Edit: Jun 21, 2010, 05:57 pm by ChrisS Reason: 1
mmh, you're right!

Sanguino is good for testing....

I build my own thingy...
...have to solder some lines... and go to the local shop to buy ZehnerDiodes.... then I am ready to test....

1284p is on queue... seems that 1284p is very hard to get...

i get a little bit angry to wait so much time to get one... hope it arrives some day....

soldered MCU is 644p... for testing USBAspLoader... to adapt it later to 1284p.

.... hope you will go on to get it work...

Greetings Chris


Yeahhh!!!! 1284p arrived....

any efforts till now?

I will get testing... but if you have some information yet it will help possibly.

Greetings ChrisS


Jul 01, 2010, 01:06 am Last Edit: Jul 01, 2010, 01:07 am by mdmetzle Reason: 1
I have a theory(well I know this is at least part of the problem) on why the modified adabootloader does not work.  It stems from the fact that we are now dealing with a device thats entire flash space cannot be addressed by a 16bit value and additional modifications will be required to allow for the extended flash to be worked read/written too.  I have attempted to make the changes by but do not know if my changes are successful as I have not had time to test them.  Look at where the m1280 has special stuff done to its addressing vs the other devices which do not.  This would in theory explain why I'm receiving back all 1s on read back as if the system is erasing the rest of the flash it would wrap around back and erase the program (I don't know if it does that or not but hey).

I hope this can point you in the right direction.

Mark S

The Program counter on the AVR chips is a WORD counter, so a 16 pit program counter deals with 128K bytes (64K words)

THe standard STK500v1 bootloader works up to the 128K limit. It does NOT work for the full 2560 and it has comments in the code where the fix needs to happen.

I have successfully made the bootloader to work on the 2560 but you can only use 128K.

The standard mega bootloader should work with just fine. You might have to change some of the fuse bits if there any differences.



I was referring to the flash byte reads which the original patch fails to address (and incorrectly interpreted the writes would be bad as well). The modifications i was referring too were just changing the conditional compilation a bit to get the mega loader to compile for the 1284p.


Got the standard mega boot-loader working on the m1284p by just changing some of the conditional compilation bits.

Everything works have the blink sketch running now ;)


Wow! Thats a good news...

I think in fact of the lenght of this post...

I think it would be really nice, if you explain all steps you have done to make it work.

This is a open Community of special interest.

I think now, and in future many people could do this with your help if you post the answer of get it work here and now.

I am interessted too... :)  got some problems to get it work like you...

So please, post the complete answer here to help us ... and me ;)

Maybe it makes it possible to got a 8515 work also.

Hope, you write some sentences here to explain what you have done.

Greetings ChrisS


I didn't have time last night to list more than what I did but here is the sanguino folder out of my arduino/hardware install.


Just place the sanguino folder in the hardware folder of your arduino install.  AVRdude will need to be updated as the version included does not know about the m1284, I did this by installing winAVR and overwriting the copy of AVRdude that comes with arduino, as well as overwriting the avrdude.conf file; this was on windows I don't know what would need to be done on linux/mac I will see on linux later but I don't have a mac.  If anyone needs a more in depth explanation I will be happy to give one but I don't have time right now.


Thank you very much....!!!!!!

This helps very much!

Maybe, you will explain detailed later... 184 is a great improvement in fact of its features....

Greetings ChrisS


Updating AVRdude under windows:
Find the latest version (I just installed winAVR needed it anyway)
Update avrdude.exe found in arduino-0018/hardware/tools/avr/bin
Update avrdude.conf found in arduino-0018/hardware/tools/avr/etc

If you have a recent version of winAVR installed both files can be found in [winAVR install directory]/bin

As far as what I did to the boot loader I started with the standard standard version that comes with the arduino environment and modified the make file adding:
Code: [Select]
atmega1284p: TARGET = atmega1284p
atmega1284p: MCU_TARGET = atmega1284p
atmega1284p: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=0' '-DBAUD_RATE=57600'
atmega1284p: AVR_FREQ = 16000000L
atmega1284p: LDSECTION  = --section-start=.text=0x1F800
atmega1284p: $(PROGRAM)_atmega1284p.hex

atmega1284p_isp: atmega1284p
atmega1284p_isp: TARGET = atmega1284p
atmega1284p_isp: MCU_TARGET = atmega1284p
atmega1284p_isp: HFUSE = DC
atmega1284p_isp: LFUSE = FF
atmega1284p_isp: EFUSE = FD
atmega1284p_isp: isp

after the mega definitions.

as far as the bootloader itself all I did was add the devices signature, and then looked for where the m1280 specific code was and also made that code compile for the m1284 ex:
#if defined __AVR_ATmega1280__
was changed to were applicable
#if defined __AVR_ATmega1280__  || defined __AVR_ATmega1284P__

All the code was already there its was just a matter of using the correct bits.

The sanguino board.txt additions:
Code: [Select]

atmega1284.name=Sanguino W/ ATmega1284p






Nice work on the above everyone.
Has this been tested to be working well now, and does support for things like the wire library work ok?
Just developing a prototype board which I hope to utilise a 1284P



Thanks for reviving this James, I didn't know someone was working on support for the 1284 as I to am designing a board with this chip.
Rob Gray aka the GRAYnomad www.robgray.com


Well I am using the sanguino libraries so if the sanguino team ported the wiring library at most the changes required would be adding the atmega1284 to the part specific sections. ie:
#if defined __AVR_ATmega644P__  || defined __AVR_ATmega1284P__

Glen A

Sep 16, 2010, 05:04 pm Last Edit: Sep 16, 2010, 05:09 pm by glena Reason: 1
Hello, I'm new to arduino and have a board that uses the m1284p (see bahbots.com).  I have tried to decipher the above docs but have not yet gotten it to work.  Is there any straight forward documentation out there for getting it to work?

A second question is, can I use a crystal frequency of 18,432MHz?  I use this crystal for many projects since its the fastest (within spec) that is still UART friendly.



Mark S

Sep 16, 2010, 05:08 pm Last Edit: Sep 16, 2010, 05:30 pm by msproul Reason: 1
I just created a new web site and it has files to support just about every atmega cpu there is. It already works with the 1284


I just ordered one of the boards you reference so I can test it with my core files.

I will also get my stk500v2 bootloader working on it.


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131