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
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ATmega2561 support in openTx

Post by jhsa »

ha ha, I know the feeling :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
Animal60
Posts: 21
Joined: Mon Aug 26, 2013 9:31 am
Country: -

Re: ATmega2561 support in openTx

Post by Animal60 »

I know this is a bit late; was this problem ever resolved.
I have had the same problem and have found a work around.
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 are referring to the reboot problem when using the trims, then yes..
The fix is to solder some 1K resistors in line with the horizontal trims circuit.. Please see here.

http://openrcforums.com/forum/viewtopic ... =30#p52593

You can start reading a bit before that post to have a better understanding of the problem ;)

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
Animal60
Posts: 21
Joined: Mon Aug 26, 2013 9:31 am
Country: -

Re: ATmega2561 support in openTx

Post by Animal60 »

jhsa wrote:If you are referring to the reboot problem when using the trims, then yes..
The fix is to solder some 1K resistors in line with the horizontal trims circuit.. Please see here.

http://openrcforums.com/forum/viewtopic ... =30#p52593

You can start reading a bit before that post to have a better understanding of the problem ;)

João
jhsa thank you for replying to my question. I have been reading and following this forum for quite some time.
I have a number of 9x radios 1 with g9x and 2 others i have upgraded from M64 to M128.
The g9x board is very good i have the SD card option witch allows telemetry logging and model memory to be saved.
Knowing the extra a M2560 allows i was thinking of an upgrade to a M2561 on 1 of my standard board.

I was wondering how much progress has been made on the code conversion?
Will this be available as one of the options in companion compile options?

I am a new user to this forum and looking forward to the future.
mmilan
Posts: 171
Joined: Fri Mar 23, 2012 12:16 am
Country: United States
Location: Holly, Mi

Re: ATmega2561 support in openTx

Post by mmilan »

Animal60,
As you have been successful converting two of your 9x radios to the M128, I wonder if you could do a step by step (maybe with pictures) of a M2561 conversion. And/or a written step by step for the M128 conversion. Right now the information is scattered about these forums. It is a bit confusing for an amateur solderer with an elementary understanding of electronics. A wiki would be nice!! I am sure that I am not alone in wanting to keep my 4 9xs by upgrading instead of just buying a Taranis. The fun is in the challenge anyway!

Thanks
Mike

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 software is still being tested for the m2561, so its not quite ready for release.

The process of replacing the MCU with the m2561 is simple but not easy! You can cut the pins on the old chip (not recommended), use a product named ChipQuik or a hot air rework station to remove the original chip. The m2561 can be installed by soldering each pin, drag soldering or using soldering paste & a rework station. Use LOTS of flux if you are soldering. Test for shorts between adjoining pins and clean up with soldering wick. There are several YouTube videos that I also followed when I did my first MCU swop!
User avatar
Animal60
Posts: 21
Joined: Mon Aug 26, 2013 9:31 am
Country: -

Re: ATmega2561 support in openTx

Post by Animal60 »

mmilan wrote:Animal60,
As you have been successful converting two of your 9x radios to the M128, I wonder if you could do a step by step (maybe with pictures) of a M2561 conversion. And/or a written step by step for the M128 conversion. Right now the information is scattered about these forums. It is a bit confusing for an amateur solderer with an elementary understanding of electronics. A wiki would be nice!! I am sure that I am not alone in wanting to keep my 4 9xs by upgrading instead of just buying a Taranis. The fun is in the challenge anyway!

Thanks
Mike
Hi Mike,
I am probably not the best person to ask on SMD chip replacement, I have tried using solder wick, and applying large amounts of solder to all pins then heating while lifting with out a great deal of success.

The best method is to use hot gas and flux paste. being a cheep skate i reused a gas soldering iron with the soldering tip removed as a hot air source; also a good soldering iron. I used a temperature controlled Weller iron with a small chisel tip. You will need a flux pen, de-soldering wick and non corrosive flux paste. I used a product called (CHIP QUIK SMD removal paste).

You will have to remove the board from radio to perform the replacement (be very careful when removing the display from the board, the latch holding the ribbon will break easily).
after removing, set the board up on a flat area to perform the rework.

apply flux paste around all pins (chip quik paste) heat pins with hot gas, if using gas soldering iron be very careful not to burn the board. with tip removed gas soldering iron barrel the blue part of the flame is contained in the barrel. As heat is applied the flux will bubble and the chip will come free, then just remove the chip.
Before attempting this you should practice on an old junk board of some type! (old computer boards are usually a good source of SMD chips to remove)
There are lots of good youtube vids on SMD rework with hot air.

After removal apply flux to the pads and remove solder from pads with solder wick (do not be to rough as tracks are very thin and excessive heat with soldering iron can lift tracks)
when working on SMD devices flux is always needed liquid flux of some kind.

Clean the area with alcohol wipes if available or spray some isopropyl alcohol onto the area and clean. After cleaning apply flux to pads with flux pen.
i placed a small amount of soldering paste to each pad before placing the new chip on the board. When placing new chip be shore to get pin 1 in the correct position (bottom left corner of board ribbon connector being the top.) heat and solder corner pins first before soldering the other pins I used a soldering iron but you could also use hot air.

Clean up with flux and de-soldering wick if needed.

You will need an Avrusb programer to program the chip it can be done with the board out of the radio, the programer will supply power to the chip. I used the:
http://www.hobbyking.com/hobbyking/stor ... ssors.html
there are many threads on this forum telling how to program this board.

I use Companion9x to program the boards ( With a new chip the fuses must be set first to suit the chip before programing opentx onto the chip)

After programing; the board can be refitted to the radio.

I do not have any pictures of the process to offer at this stage.

This is probably not the correct thread to describe this process.
hope this is of some help
Animal60....
mmilan
Posts: 171
Joined: Fri Mar 23, 2012 12:16 am
Country: United States
Location: Holly, Mi

Re: ATmega2561 support in openTx

Post by mmilan »

Thank you very much! You make the process very clear now. With the fuses, do you need to change the fuses back to original or leave the changes intact after flashing the new firmware?
And thanks for your time. I will practice first and do the M128 first. I do have quick chip kit on hand and some old pc pcbs to "destroy".

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

Re: ATmega2561 support in openTx

Post by jhsa »

You set the fuses before you flash the firmware. then you never touch them again.. If you have to, then is a bad sign. It means you are in trouble :D
the first time you connect to the chip to change the fuses you normally have to slow the programmer down by adding -b100 to the extra arguments on the burn menu in companion..

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
Animal60
Posts: 21
Joined: Mon Aug 26, 2013 9:31 am
Country: -

Re: ATmega2561 support in openTx

Post by Animal60 »

mmilan wrote:Thank you very much! You make the process very clear now. With the fuses, do you need to change the fuses back to original or leave the changes intact after flashing the new firmware?
And thanks for your time. I will practice first and do the M128 first. I do have quick chip kit on hand and some old pc pcbs to "destroy".

Mike
Mike First you have to understand fuses; Fuses are programmable links inside the MCU used to configure the MCU. they setup weather to use internal clock or external clock, memory range, starting address point of MPU when first switched on ect.
Fuses must be programed first and usually one time only when a new chip is installed. companion has a section to set the fuses for the MPU.
If you were running windows and wonted to program them from the command window the command for a M128 would be:
avrdude -c usbasp -p m128 -u -B 100 -U lfuse:w:0x0E:m -U hfuse:w:0x89:m -U efuse:w:0xFF:m

After setting the fuses the openTx can be programmed.

Usually to test if programmer is working properly "read the fuse setting first" after doing so and providing all went well, you can go ahead and set the fuses for the MPU.
Avrdude should report as follows
=================================================================================
Started AVRDUDE
C:/Program Files (x86)/companion9x/avrdude.exe -c usbasp -p m128 -P usb -U lfuse:r:-:i -U hfuse:r:-:i -U efuse:r:-:i
=================================================================================

avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
:010000000EF1
:00000001FF
:010000008976
:00000001FF
:01000000FF00
:00000001FF
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e9702
avrdude.exe: reading lfuse memory:

Reading | ################################################## | 100% 0.00s

avrdude.exe: writing output file "<stdout>"
avrdude.exe: reading hfuse memory:

Reading | ################################################## | 100% 0.00s

avrdude.exe: writing output file "<stdout>"
avrdude.exe: reading efuse memory:

Reading | ################################################## | 100% 0.02s

avrdude.exe: writing output file "<stdout>"

avrdude.exe done. Thank you.


=================================================================================
AVRDUDE done - SUCCESSFUL
=================================================================================
=================================================================================
FUSES: Low=0e High=89 Ext=ff
=================================================================================

Hope this helps
Animal60.
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ATmega2561 support in openTx

Post by jhsa »

avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
As far as I know, if avrdude gives you this error you might not be able to slow down the programmer and program the fuses..

Please someone correct me if I'm wrong.

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
Animal60
Posts: 21
Joined: Mon Aug 26, 2013 9:31 am
Country: -

Re: ATmega2561 support in openTx

Post by Animal60 »

jhsa wrote:
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
As far as I know, if avrdude gives you this error you might not be able to slow down the programmer and program the fuses..

Please someone correct me if I'm wrong.

João
jhsa yes i agree with the sck message, but i have not found any problem with the usbasp at all.
i have used it to program ESC's, KK2 and other devices.
As i stated perform a reed function first.
Animal60
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ATmega2561 support in openTx

Post by jhsa »

yes of course, read first always before writing something..
I just mentioned as it is what normally happens with the SCK error ;)
But there are people here with much more knowledge than me that can explain that better.
I can only say that I did 2 chip replacements on both my radios and they are both working. The first one was a PITA though.. wouldn't program :(

João

P.S. - getting ready for replacing the m128's with m2561's :)
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
Animal60
Posts: 21
Joined: Mon Aug 26, 2013 9:31 am
Country: -

Re: ATmega2561 support in openTx

Post by Animal60 »

jhsa wrote:yes of course, read first always before writing something..
I just mentioned as it is what normally happens with the SCK error ;)
But there are people here with much more knowledge than me that can explain that better.
I can only say that I did 2 chip replacements on both my radios and they are both working. The first one was a PITA though.. wouldn't program :(

João

P.S. - getting ready for replacing the m128's with m2561's :)
Yes you are quite write SCK error usually indicates a problem slowing down the clock rate, I use the usbasp from hobbyking, I believe it may be a known issue with this programmer, It seams to work correctly.

It is good to see the M2651 is working, GRUVIN has a lot of experience with this chip he used it in his first board revision V3.2 apparently there is a issue with with the timer implmentations on this chip.
he mentioned he found bugs with 256x series of chips, but I assume these issues have been overcome.

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

Re: ATmega2561 support in openTx

Post by jhsa »

I still have to replace the 128 with the 2561..
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
mmilan
Posts: 171
Joined: Fri Mar 23, 2012 12:16 am
Country: United States
Location: Holly, Mi

Re: ATmega2561 support in openTx

Post by mmilan »

Thank you Animal60 for the tutorial on fuses. I did not understand them before. Now this is making perfect sense. Again thanks for all the time. I am sure that I am not the only one that you have helped.
Mike
User avatar
Animal60
Posts: 21
Joined: Mon Aug 26, 2013 9:31 am
Country: -

Re: ATmega2561 support in openTx

Post by Animal60 »

jhsa wrote:I still have to replace the 128 with the 2561..
jhsa thank you for your interest in my post. I do appreciate all advice given and i hope i was not to short with you.

Horizontal trimmer issue. I have been corresponding with GRUVIN about this issue "It appears he may have found the problem" A dam design issue.
If you follow the thread:
viewtopic.php?f=95&t=3594&p=59146#p59138
you will find a great deal of information on M256x MPU and the trimmer problem

Have a look
Tom.
User avatar
LTMNO
Posts: 1049
Joined: Fri Nov 30, 2012 9:31 pm
Country: Canada
Location: Toronto, Canada

Re: ATmega2561 support in openTx

Post by LTMNO »

ReSt wrote: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
That goes double for me. ;-) I just haven't had the chance yet to install it.
Custom 9x with M64/Telemetry Mod
User avatar
LTMNO
Posts: 1049
Joined: Fri Nov 30, 2012 9:31 pm
Country: Canada
Location: Toronto, Canada

Re: ATmega2561 support in openTx

Post by LTMNO »

mbanzi wrote:m2561 main board is ready to go back in the transmitter! I still have to do the 1K resistor mod on the horizontal trims & build another voice interface for it. Not planning to do the rotary encoder for this one, which is a good thing as I just noticed I have 3.3v going to the encoder connector :oops: .

Image
wow... very nice breakouts... details, details...
is it like your very own SmartieParts Board?
Custom 9x with M64/Telemetry Mod
User avatar
Animal60
Posts: 21
Joined: Mon Aug 26, 2013 9:31 am
Country: -

Re: ATmega2561 support in openTx

Post by Animal60 »

LTMNO wrote:
ReSt wrote: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
That goes double for me. ;-) I just haven't had the chance yet to install it.
I am thinking of giving the M2561 a try, It has a lot more memory, the G9X board supporting a USB interface GRUVIN has managed to get a boot loader to work.
Just plug in a mini USB and download software updates No USPASP required to update :D :D
G9X runs a 2560 100 pin chip same memory as the M2561, It may be possible to configure the M2561 to perform a USB function.
But definitely worth fitting. :P
Tom
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ATmega2561 support in openTx

Post by jhsa »

Well, there is this USB implementation for AVR chips..

http://www.obdev.at/products/vusb/index.html

I think the problem would be finding non used pins that could be used.. Maybe the devs could comment on it.. ;)

I've built some V-USB projects and they work great..

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
mbanzi
Posts: 223
Joined: Thu May 24, 2012 5:53 am
Country: -
Location: San Diego, CA

Re: ATmega2561 support in openTx

Post by mbanzi »

LTMNO wrote:wow... very nice breakouts... details, details...
is it like your very own SmartieParts Board?
Thanks! Not quite a SmartieParts board - just something to satisfy my obsessive nature when it comes to organized wiring ;)
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 »

To save me looking, do you know if this USB implementation requires the two USB data signals to be on the same port?
My guess is that they do need to be.

The 2561 has an extra I/O pin (pin 1) on port G.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
LTMNO
Posts: 1049
Joined: Fri Nov 30, 2012 9:31 pm
Country: Canada
Location: Toronto, Canada

Re: ATmega2561 support in openTx

Post by LTMNO »

mbanzi wrote:
LTMNO wrote:wow... very nice breakouts... details, details...
is it like your very own SmartieParts Board?
Thanks! Not quite a SmartieParts board - just something to satisfy my obsessive nature when it comes to organized wiring ;)
Hello mbanzi, yes, i completely understand hence my interests... you know, its always better to print out more than one board.. so how many do you have left if you have 4-5 TX's. ;-0

Thanks,
Custom 9x with M64/Telemetry Mod
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: ATmega2561 support in openTx

Post by jhsa »

MikeB wrote:To save me looking, do you know if this USB implementation requires the two USB data signals to be on the same port?
My guess is that they do need to be.

The 2561 has an extra I/O pin (pin 1) on port G.

Mike.
Ok, Normally V-USB needs 2 pins. One for D+ and the other for D-
But I came across with this piece of text:
USB lines D+ and D- MUST be wired to the same I/O port. We recommend that D+
triggers the interrupt (best achieved by using INT0 for D+), but it is also
possible to trigger the interrupt from D-. If D- is used, interrupts are also
triggered by SOF packets. D- requires a pullup of 1.5k to +3.5V (and the device
must be powered at 3.5V) to identify as low-speed USB device. A pullup of
1M SHOULD be connected from D+ to +3.5V to prevent interference when no USB
master is connected. We use D+ as interrupt source and not D- because it
does not trigger on keep-alive and RESET states.
From this site:

http://code.rancidbacon.com/ProjectLogArduinoUSB

So, I don't know what that really mean. would it be possible to use only one pin? I hope you find something on that page that answers your question.
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 USB operation MUST have 2 pins. Clearly they MUST also be on the same port, and one of them MUST be capable of generating an interrupt.
That is difficult given the existing connections on the board. This could involve some quite messy mods. Only some of the pins can generate interrupts.

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 »

In other words, it's a no go then.. :(
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
Animal60
Posts: 21
Joined: Mon Aug 26, 2013 9:31 am
Country: -

Re: ATmega2561 support in openTx

Post by Animal60 »

MikeB wrote:The USB operation MUST have 2 pins. Clearly they MUST also be on the same port, and one of them MUST be capable of generating an interrupt.
That is difficult given the existing connections on the board. This could involve some quite messy mods. Only some of the pins can generate interrupts.

Mike.
Hi Mike,
it may be possible to use port "E" to perform USB function. It may be possible to use pin4 (ElelDR_SW) and pin6 (Gear_SW) pins.
Under normal start-up the switches hold these pins LOW, But during radio switch on if these 2 pins were detected as HI the boot loader could be started.
The boot loader would configure configure port "E" to perform a USB function and after download/upload is finished radio could be switched off, switches returned to normal position and radio restarted. The 2 x 0.1uf caps may need to be removed. Although they do not seam to make a difference to SD_MOSI and SD_MISO.

USB_D+ to pin 6 and USB_D- to Pin4. These are the same pins used in GRUVIN's boot loader.
usb.jpg
Usb_Int.jpg
We do not have to power the radio from USB port.

Tom
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 »

Just an update on testing: I've been using my m2561 modified 9x a lot indoors with a V939 quad - worked flawlessly so far. I did a basic telemetry test bound to a FrSky receiver with a voltage sensor attached which worked fine. Next step is to take a foamie to the field to test with a FrSky DJT module.

At this point I have backlight, haptic, telemetry & Gruvin's horizontal trim mods done. Haven't had any reboots since doing the analog/digital ground fix on the horizontal trims.

I have a voice interface completed, but managed to send all the tiny internal parts of my microSD socket flying everywhere when I was reassembling it :x Waiting for new ones to be delivered, at which point I'll bug Bertrand for a new build with voice included.
User avatar
mhotar
Posts: 198
Joined: Wed May 16, 2012 9:57 pm
Country: -
Location: Jemnice, Vysocina

Re: ATmega2561 support in openTx

Post by mhotar »

Sounds good.
I use my 2561 as my main radio on the field again. Had no problem so far.
I do have all components to made voice board, but had no time to do it yet. I think it is last untested feature.

Post Reply

Return to “openTx”