ATmega2561 support in openTx

openTx has introduced a range of new features, ideas and bling. It is fast becoming the firmware of choice for many users. openTx will run on ALL current hardware platforms, including the gruvin9x and sky9x boards. Work has already started to support the new FrSky X9D radio!
User avatar
mbanzi
Posts: 223
Joined: Thu May 24, 2012 5:53 am
Country: -
Location: San Diego, CA

ATmega2561 support in openTx

Post by mbanzi »

Look what I got today! :D

Image

Based on a few recent discussions, I managed to get my hands on one of the ATmega2561-16AU MCUs with 256kB Flash, 4kB EEPROM, 8kB SRAM

Bertrand, you mentioned it shouldn't take a lot of work to add support, as the chip is a pin and functionality compatible sub family. I did notice the migration document mentions that some registers names are different & some bits are in different registers and/or locations. Does that create problems? There are a few more porting considerations mentioned in the doc as well.

Migration between ATmega128 and ATmega1281/ATmega2561

I have a brand new Turnigy 9x waiting for a brain transplant, so I'm willing to be the guinea pig on this!

User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: ATmega2561 support in openTx

Post by Kilrah »

The 2561's already supported for the Gruvin board. That version however can't be used as is, as all the connections are different on there, so it wil be like another new hardware platform.

I must say I'd tend to advise against creating yet another at this point, seeing the mess it has been lately with trying to keep up on supporting the different eeprom versions. The radio side is not a problem, it's mostly about managing to keep all conversions up to date in C9X.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ATmega2561 support in openTx

Post by jhsa »

I think it was the 2560 and not the 2561 we were talking about?
And why not? if it works I will get a couple.. if it is to make the 9X more powerfull on par with other more powerful platforms, I'm in.. This what I call hacking. :D

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
MikeB
9x Developer
Posts: 17993
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ATmega2561 support in openTx

Post by MikeB »

The 2560 is a 100-pin device, I believe this is used on the Gruvin board.
The 2561 is the 64-pin version, this is what will fit the stock board instead of the Mega64.

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: ATmega2561 support in openTx

Post by jhsa »

ahh ok.. thanks Mike.. And, do you think it can be done?
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: 17993
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ATmega2561 support in openTx

Post by MikeB »

It's a bit more involved than going from the '64 to the '128. It is possible however.

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: ATmega2561 support in openTx

Post by jhsa »

new challenge? ;)
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: 17993
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ATmega2561 support in openTx

Post by MikeB »

Not so much a challenge, more organisation. Each different hardware version means more testing and the need for a test unit. For example, I have 3 9Xs, but don't have enough variants to test everything (why I asked about testing the 128 code).

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: ATmega2561 support in openTx

Post by Kilrah »

jhsa wrote:new challenge? ;)
Don't forget that any new tempting challenge is driving developers away from further working on some existing, and sometimes unfinished things ;)
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ATmega2561 support in openTx

Post by jhsa »

if you're referring to the voice module for example, hhmmmm, true.. :) :D
But this would put the 9x on par with the faster boards I guess.. at least for a while..
I would like to read other people's opinions/comments too, not just me and Mbanzi ;)

João

EDIT: I'm quite happy what I have now.. telemetry, lot's of models if necessary, ENCODER, voice, telemetry..
But the RAM is quite limiting on the m128 also.. And the 1261 has the double??
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
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: ATmega2561 support in openTx

Post by Flaps 30 »

As much as I like the idea of replacing the CPU again. I do feel that now maybe the time to take a breather and consolidate what we have, as (IMO) there does seem to be a fair number of bugs and errors creeping in on Opentx and Companion which does seem to be related to the major developments and changes that have happened.

The idea of an all in one add on board for the M64 sounds great.. I would buy one and change out my M128 back to the M64 if needs be to use it, if it ever sees the light of day.
User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: ATmega2561 support in openTx

Post by Kilrah »

I agree.
The M128 already allows for a lot. You can have all options in, and have twice the amount of model storage (which was a bit tight for many on 64). You don't even need to mod your radio to use one, as if you get a 9XR now it comes with one. What you don't have is the higher number of flight phases, custom switches and custom functions. BUT, do you really need them so badly, and more importantly NOW?

We've had a number of requests and suggestions that people brought in "just because they might be useful one day". These need to be turned down unfortunately. If there's a real need, now, then yes.

I had an intersting read the other day reminding about a very good thing in software development - Never include a feature just because you can.

Everytime you implement something you need:
- Maybe hardware to test it on (like in this case)
- A bit of time to implement the feature (usually that's the quickest)
- More time to test it
- Even more time to debug it
- Yet more time to support it in the long run.

So ask yourself if it's really worth that the developers buy/make themselves one or more 1281/2561 radio(s), spend a week of work or so adding support for another processor in openTx, another week adding support for it in C9X and testing everything, then spend multiple days or weeks in the future just to make sure it keeps working correctly over time and feature additions, upgrades normally from one version to another etc... for something you maybe don't need now, and that a year from now by the time you'd need it you'll have bought a new radio, or that "it would be cool" to use now, but which is not THAT important.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ATmega2561 support in openTx

Post by jhsa »

yeah, forget about the other atmega then. just make sure that you will support HORUS. That is the radio I would buy to replace my 9x's :D :P
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: ATmega2561 support in openTx

Post by bertrand35 »

Sorry guys I don't consider 2561 as a feature, but as a new platform for running the existing features. The first hex is sent to mbanzi for beta testing :)
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ATmega2561 support in openTx

Post by jhsa »

:o :shock: ??'
Bertrand, you're tha man, you know that?? ;) :P :mrgreen:


EDIT: Wait a second, did you already send him a Hexfor the 2561?? But, what hardware changes are needed? :shock:
Hmmm, I think I'm lost now.. :P
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: ATmega2561 support in openTx

Post by bertrand35 »

Right, I sent it to mbanzi, let's wait for the first tests before going further...
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ATmega2561 support in openTx

Post by jhsa »

Mbanzi, could you please post the link where you bought yours from?
Thanks
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
mbanzi
Posts: 223
Joined: Thu May 24, 2012 5:53 am
Country: -
Location: San Diego, CA

Re: ATmega2561 support in openTx

Post by mbanzi »

The ones I have now are samples from Atmel. There were pretty good prices on the chip from AliExpress too. João, you mean you are thinking about doing a MCU transplant again?? ;)
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ATmega2561 support in openTx

Post by jhsa »

hhmmm, in the name of science?? is it a valid argument?? :D
I guess you are doing it too? again? ;)
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
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: ATmega2561 support in openTx

Post by Flaps 30 »

I have to ask the question as to what this chip would buy us and if it really is worth spending time on.. It is fairly cheap at £12 odd in the UK.
User avatar
mbanzi
Posts: 223
Joined: Thu May 24, 2012 5:53 am
Country: -
Location: San Diego, CA

Re: ATmega2561 support in openTx

Post by mbanzi »

Well I have a spare 9x just sitting there, may as well donate it to science. :)
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: ATmega2561 support in openTx

Post by bertrand35 »

In your place I would wait for first mbanzi tests ... I only added the 6th flight mode now (compared to the ATmega128).
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ATmega2561 support in openTx

Post by jhsa »

Ok, I will wait for the tests.. I only have1 opentx tx at the moment.. so if I do it, maybe better we know it works first..
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
mbanzi
Posts: 223
Joined: Thu May 24, 2012 5:53 am
Country: -
Location: San Diego, CA

Re: ATmega2561 support in openTx

Post by mbanzi »

Finally got the m2561 installed today, and the good news is so far it works perfectly!!! :D Bertrand, thanks for the hex file that you compiled for me! I have been flying my V929 quad around in the house with no problems at all. The transmitter is a brand new Turnigy with no mods except for the m2561. I will start adding the other mods one by one when I have time to continue the testing. Model screen shows 3,528 free!

Image

I didn't want to solder in the programmer connections until I knew the m2561 worked perfectly, so I rigged a little connector board with a few pogo pins I had lying around from an old dive computer project. Not pretty but it works well:

Image
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: ATmega2561 support in openTx

Post by bertrand35 »

Good to hear! Next steps will be AUDIO and VOICE then!
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: ATmega2561 support in openTx

Post by ReSt »

Does that mean, if someone is going to replace the cpu, he should take the 2561 instead of the m128 ?

I already have ordered two M128 ond got the QuickChip the last days.


Reinhard
bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: ATmega2561 support in openTx

Post by bertrand35 »

128 is not bad, but 2561 will be better :)
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: ATmega2561 support in openTx

Post by ReSt »

Thanks.

So I'll probably go with the 128

Reinhard
User avatar
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: ATmega2561 support in openTx

Post by Flaps 30 »

Just wondering what the thoughts are on this for the future.

I do realise that development work on the Taranis has taken precedent over most things for now.
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: ATmega2561 support in openTx

Post by ReSt »

[ot]
Received the M128 yesterday and immediately started to modify one, up to that unmodified radio.

Happy about that it went so easy with the QuickChip, ... until ... , João, guess what ??
I discovered that I had soldered it in by 90 degree rotated :roll:

Unsoldered it again (using the same QuickChip material that I had used the first time) and now placed the chip correctly. Most important thing that I found with unsoldering and also with resoldering is, DO USE FLUX.

That QuickChip that I ordered had 5 sticks of about 16 cm long, 1.17 mm thick, and I needed half a stick to remove the m64.

The next step was to set the fuses, where I used my selfmade parallel port programmer and PonyProg2000. And used it also to flash the 128 firmware.

Everything is working now, having 2280 bytes eeprom free with 9 models loaded.
[/ot]

Reinhard

Post Reply

Return to “openTx”