Pages: 1 2 [3] 4   Go Down
Author Topic: Bootloader compatibility  ATmega 1280 and 1284P  (Read 6141 times)
0 Members and 1 Guest are viewing this topic.
Dresden / Germany
Offline Offline
Sr. Member
****
Karma: 3
Posts: 451
Entwicklungsklaus
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: June 21, 2010, 10:57:37 am by ChrisS » Logged

Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

Dresden / Germany
Offline Offline
Sr. Member
****
Karma: 3
Posts: 451
Entwicklungsklaus
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

any efforts till now?

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

Greetings ChrisS
Logged

Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

Michigan, US
Offline Offline
Full Member
***
Karma: 3
Posts: 148
Go Huskies
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: June 30, 2010, 06:07:15 pm by mdmetzle » Logged

USA
Offline Offline
Full Member
***
Karma: 2
Posts: 213
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Mark
Logged

Michigan, US
Offline Offline
Full Member
***
Karma: 3
Posts: 148
Go Huskies
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Michigan, US
Offline Offline
Full Member
***
Karma: 3
Posts: 148
Go Huskies
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-wink
Logged

Dresden / Germany
Offline Offline
Sr. Member
****
Karma: 3
Posts: 451
Entwicklungsklaus
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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... smiley  got some problems to get it work like you...


So please, post the complete answer here to help us ... and me smiley-wink

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


Logged

Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

Michigan, US
Offline Offline
Full Member
***
Karma: 3
Posts: 148
Go Huskies
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

http://www.mediafire.com/file/e1gjqnm5yqg/Sanguino1284p.zip

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.
Logged

Dresden / Germany
Offline Offline
Sr. Member
****
Karma: 3
Posts: 451
Entwicklungsklaus
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Sturmfabrik - mediale Dienstleistungen
www.sturmfabrik.de

Michigan, US
Offline Offline
Full Member
***
Karma: 3
Posts: 148
Go Huskies
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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:
##############################################################

atmega1284.name=Sanguino W/ ATmega1284p

atmega1284.upload.protocol=stk500
atmega1284.upload.maximum_size=131072
atmega1284.upload.speed=56700

atmega1284.bootloader.low_fuses=0xFF
atmega1284.bootloader.high_fuses=0xDC
atmega1284.bootloader.extended_fuses=0xFD
atmega1284.bootloader.path=atmega
atmega1284.bootloader.file=ATmegaBOOT_168_atmega1284p.hex
atmega1284.bootloader.unlock_bits=0x3F
atmega1284.bootloader.lock_bits=0x0F

atmega1284.build.mcu=atmega1284p
atmega1284.build.f_cpu=16000000L
atmega1284.build.core=arduino
Logged

NZ
Offline Offline
Sr. Member
****
Karma: 0
Posts: 390
Turtle in a hard shell
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

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
James
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8458
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Michigan, US
Offline Offline
Full Member
***
Karma: 3
Posts: 148
Go Huskies
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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__
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Thanks!

-Glen
« Last Edit: September 16, 2010, 10:09:12 am by glena » Logged

USA
Offline Offline
Full Member
***
Karma: 2
Posts: 213
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

http://www.arduino-avr.com

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.

Mark
« Last Edit: September 16, 2010, 10:30:40 am by msproul » Logged

Pages: 1 2 [3] 4   Go Up
Jump to: