Changing to an Atmega 128

Need some advice? Trying out a new idea? Fancy a beer?
Join us for some general banter and good times.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Changing to an Atmega 128

Post by jhsa »

Ok, warning, no "get an ersky board" type of commentary please..

The more I read it the less I feel like gettin one :mrgreen:

i was just talking to a friend about changing the mega on the stock board with an Atmega 128... That would mean more flash and more eeprom space for models and features..
Please don't take me wrong, specially if you are a developer. It would be a lot more work for you and all of you gave us already some wonderfull firmwares to use..
The reason I'm starting this thread is just so we have an idea how many of us would go down that road.. It's not an easy thing to do.. but they seem to be quite cheap..

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Changing to an Atmega 128

Post by Rob Thomson »

You also have the issue that you need a separate fork of the firmware to make use of the extra flash and epprom.

My gut feeling.. for 99% the soldering job will be too hard.

Oh.. you could 'get a gruvin board' ? :-):-)
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Changing to an Atmega 128

Post by jhsa »

Shall I add it to the top as well?? and I said "type of commentary" :mrgreen: :mrgreen: :mrgreen:
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Changing to an Atmega 128

Post by Rob Thomson »

Lol... you where asking for that by not including it :-)
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Changing to an Atmega 128

Post by jhsa »

well people started already putting megas64 when the original is broken.. why not installing a 128 instead? the work is the same.. At the moment seems to be only a compilation problem, or not?
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Changing to an Atmega 128

Post by Rob Thomson »

I believe there are two core issues.

1. Compilation
2. Potential of bugs

Apart from that - I dont believe there is anything more problematic.

Rob
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Changing to an Atmega 128

Post by jhsa »

bugs? why? as far as I understand they are perfectly compatible, or not? only the 128 has larger flash and eeprom..
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Changing to an Atmega 128

Post by MikeB »

The Atmel instruction set only directly supports 64K flash. To handle 128K some instructions have to be different, so there may be some unexpected bugs. It works fine if you only use the first 64K of flash :mrgreen:
There may be a problem with the EEPROM. I came across something, I think, that said the file system doesn't expand to 4K without changing its structure, I may be wrong though.
Eepe also doesn't understand a 4K EEPROM either. I have tested er9x loaded on my STK500 dev board with a M128 on it, but only ever used it as though it was a M64. Eepe couldn't handle the 4K EEPROM, even though only 2K was used.
As Rob said, to use the extra flash, we would need to build another version of er9x.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Changing to an Atmega 128

Post by jhsa »

so that might be a dead project for er9x then ;) :mrgreen: :mrgreen: Mike is all alone on this er9x project so I'm not going to nag him about this. Actually, i don't intend to nag anyone about this (Can't believe what I'm saying) :D

As this is supposed to be a general topic, what do the open9x guys have to say??

I oppened this topic because I thought it would be an interesting discussion.. A little survey. Don't know if it is the right word nor if it is well written either, but you get the point.. I'm Fortuguese.. :mrgreen:
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Changing to an Atmega 128

Post by MikeB »

If the processor is changed, it might be worth checking out the M2561. I think it is still pin compatible, but has 256K flash and 8k bytes RAM (4k bytes EEPROM).
It also has more internal functions, but is still only 16MHz.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: Changing to an Atmega 128

Post by ReSt »

In case of a broken processor, I would probably do it.
But I don't think that I would do it on a functional radio.

Reinhard
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Changing to an Atmega 128

Post by jhsa »

of course, there's always the risk of damaging it.. the same as the telemetry mod and the hopefully coming rotary encoder mod..

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Changing to an Atmega 128

Post by bertrand35 »

I discussed this topic with Kilrah yesterday who already bought the uP (not me, I fly with a sky9x and keeps my 64A for the open9x tests). So we will have an open9x / ATmega 128 soon.
It will be the same than open9x / stock board, but with the EEPROM and the File System of the gruvin9x board (4k, 30 models, different FAT).
Of course all the open9x options will fit on this board.
Bertrand.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Changing to an Atmega 128

Post by jhsa »

nice..Verrrryy nice.. ;) :mrgreen:
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Changing to an Atmega 128

Post by bertrand35 »

Done, waiting for tests.

Code: Select all

make PCB=STD128
Bertrand.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Changing to an Atmega 128

Post by Kilrah »

Yummy :D
You're too fast, my cpus only shipped yesterday from China! :mrgreen:
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Changing to an Atmega 128

Post by Kilrah »

Code: Select all

make PCB=STD128 TRANSLATIONS=FR EXT=FRSKY HELI=YES TEMPLATES=YES AUTOSWITCH=YES DBLKEYS=YES AUDIO=YES HAPTIC=YES SPLASH=YES GRAPHICS=YES BOLD=YES THR_TRACE=YES PPM_CENTER_ADJUSTABLE=YES PPM_LIMITS_SYMETRICAL=YES PPM_LIMITS_UNIT=PERCENT DECIMALS=YES  FRSKY_HUB=YES WS_HOW_HIGH=YES PXX=YES DSM2=PPM UNITS=METRIC EEPROM_PROGRESS_BAR=YES FLIGHT_PHASES=YES CURVES=YES XCURVES=YES

Size after:
AVR Memory Usage
----------------
Device: atmega128

Program:   79796 bytes (60.9% Full)
(.text + .data + .bootloader)

Data:       3599 bytes (87.9% Full)
(.data + .bss + .noinit)
Cool! And it's with my old 4.5.3 compiler...
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Changing to an Atmega 128

Post by jhsa »

Now you're just teasing... :mrgreen: :mrgreen:
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Changing to an Atmega 128

Post by jhsa »

That means you can have all the features on the radio and still have nearlly half of the memory free..
Hmmm, I have an extra 9x that need to work on.. never changed a CPU before but I learn fast..

Joao

EDIT: Mike's CPU option looks even more atractive though, if compatible of course.. and supported
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
erazz
9x Developer
Posts: 682
Joined: Tue Dec 27, 2011 6:25 pm
Country: -
Location: NJ-USA
Contact:

Re: Changing to an Atmega 128

Post by erazz »

I wouldn't.... (go with the 128 that is)

It's a nice challenge to unsolder and resolder but in the end you will find bugs. The filesystem is built for the 64. It probably can work with the 128 but I don't know what other issues will come with it. Other than that, eepe will not support it. I've been out of it for a while so I don't know about companion.

I guess the real question is what do you want to get out of it?
Z

BEWARE - WE ARE IN THE AIR!!!
What goes up... Should be controlled by a 9X!
User avatar
cre8tiveleo
Posts: 1434
Joined: Tue Dec 27, 2011 6:13 pm
Country: -
Location: Ontario,(GTA North)
Contact:

Re: Changing to an Atmega 128

Post by cre8tiveleo »

*blink* *blink*
User avatar
erazz
9x Developer
Posts: 682
Joined: Tue Dec 27, 2011 6:25 pm
Country: -
Location: NJ-USA
Contact:

Re: Changing to an Atmega 128

Post by erazz »

Yeah yeah... I'm back. Not sure if it's going to do anybody any good though. :)
Z

BEWARE - WE ARE IN THE AIR!!!
What goes up... Should be controlled by a 9X!
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Changing to an Atmega 128

Post by MikeB »

Welcome back erazz. Be nice if eepe could keep up with er9x, I just haven't had the time.

I've only changed er9x a bit (he he, a lot maybe).

I agree, for er9x/eepe I think it best to stick with the '64. Not many will be prepared to change out the processor unless the existing one is broken. There are enough alternative boards already available as well, so a new board with a '128/'2561 on isn't worth trying either.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
cre8tiveleo
Posts: 1434
Joined: Tue Dec 27, 2011 6:13 pm
Country: -
Location: Ontario,(GTA North)
Contact:

Re: Changing to an Atmega 128

Post by cre8tiveleo »

erazz wrote:Yeah yeah... I'm back. Not sure if it's going to do anybody any good though. :)

Sure, just break all your confidentiality docs, and tell us how was China? Whatcha workin on? :geek:

Hope all is well! Now I can change my avatar again.
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: Changing to an Atmega 128

Post by Rob Thomson »

erazz wrote:Yeah yeah... I'm back. Not sure if it's going to do anybody any good though. :)
HELLO STRANGER!!

Sent from my Nexus 7 using Tapatalk 2
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
User avatar
erazz
9x Developer
Posts: 682
Joined: Tue Dec 27, 2011 6:25 pm
Country: -
Location: NJ-USA
Contact:

Re: Changing to an Atmega 128

Post by erazz »

Don't get your hopes up. It's Friday and happy hour beckons, I might actually start writing code again.
Z

BEWARE - WE ARE IN THE AIR!!!
What goes up... Should be controlled by a 9X!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Changing to an Atmega 128

Post by jhsa »

MikeB wrote:Welcome back erazz. Be nice if eepe could keep up with er9x, I just haven't had the time.
:mrgreen: :mrgreen: Mike, you don't waste any time.... or flash, do you?? :mrgreen: :mrgreen:

The man is just back.. :lol:

Welcome back erazz


@Leo You know, I don't know, but I think you might be right.. And my wish is that it is true.. :mrgreen: :mrgreen:
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Changing to an Atmega 128

Post by Kilrah »

Hehe, welcome back!
erazz wrote:The filesystem is built for the 64. It probably can work with the 128 but I don't know what other issues will come with it. Other than that, eepe will not support it. I've been out of it for a while so I don't know about companion.

I guess the real question is what do you want to get out of it?
On er9x/eePe it might not be worth it indeed. But on open9x/c9x it's a lot easier, as the existing code for the gruvin9x board (which has a '2560 with 4k of eeprom) can be reused. You can see that only an hour passed between Bertrand's 2 posts earlier - a bit more will be needed on c9x, but nothing unreasonable.

In my case it would be mostly for the extra model memory, and not having to worry about choosing between the many cool options that are constantly added. If desired we could probably also add a lot of the currently ARM-only features as we have more memory to work with. Replacing the CPU being a $5 + 10min job, I do find it attractive.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Changing to an Atmega 128

Post by Kilrah »

MikeB wrote:If the processor is changed, it might be worth checking out the M2561. I think it is still pin compatible, but has 256K flash and 8k bytes RAM (4k bytes EEPROM).
It also has more internal functions, but is still only 16MHz.
I just had a look. The 2561 would be a candidate indeed in terms of compatibility, however it's 4 times more expensive, at approx $20 vs $5 for a mega64 or mega128. Less interesting IMO, as the additional capabilities would require further development. The mega128 should be a good compromise, it's cheap and removes the most annoying limitations (small model memory and limited flash) with a minimal amount of work.

MikeB wrote:The Atmel instruction set only directly supports 64K flash. To handle 128K some instructions have to be different
Regarding this I had a look, and couldn't find the relevant info. There seems to be no restriction regarding flash.
There is such an issue, but it concerns the I/O memory:
The ATmega128 is a highly complex microcontroller where the number of I/O locations supersedes
the 64 I/O locations reserved in the AVR instruction set. To ensure backward compatibility
with the ATmega103, all I/O locations present in ATmega103 have the same location in
ATmega128. Most additional I/O locations are added in an Extended I/O space starting from $60
to $FF, (i.e., in the ATmega103 internal RAM space). These locations can be reached by using
LD/LDS/LDD and ST/STS/STD instructions only, not by using IN and OUT instructions.
But it's already like this on the mega64.

According to this document by atmel, the only significative difference between the mega64 and mega128 is an ADC feature that is not used in the 9x firmwares:
The start of an ADC conversion in Atmega64 can auto trigger on interrupt sources.
This ADC auto triggering is not implemented in Atmega128.
derFrickler
Posts: 46
Joined: Mon Jan 09, 2012 9:54 am
Country: -

Re: Changing to an Atmega 128

Post by derFrickler »

Yeah, that seems to be easy, so i will wait fro your experiences..

Post Reply

Return to “The Pickled Gnu (The Pub)”