Changing to an Atmega 128
- MikeB
- 9x Developer
- Posts: 18000
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Changing to an Atmega 128
Reading program memory can be a problem. The LPM instruction uses R31 and R30 to provide a 16 bit flash address. To acces all 128K of the M128, you need to use the RAMPZ register for the extra bit of the address and use the ELPM instruction.
I think there is also a problem in that the RAMPZ register is no incremented if you use ELPM with Z+ and Z wraps past 0xFFFF.
Mike.
I think there is also a problem in that the RAMPZ register is no incremented if you use ELPM with Z+ and Z wraps past 0xFFFF.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
-
- 9x Developer
- Posts: 2764
- Joined: Fri Dec 30, 2011 11:11 pm
- Country: -
Re: Changing to an Atmega 128
The compiler should take care of it (as it does on the 2560 from gruvin9x for all PSTR), no?MikeB wrote:Reading program memory can be a problem. The LPM instruction uses R31 and R30 to provide a 16 bit flash address. To acces all 128K of the M128, you need to use the RAMPZ register for the extra bit of the address and use the ELPM instruction.
I think there is also a problem in that the RAMPZ register is no incremented if you use ELPM with Z+ and Z wraps past 0xFFFF.
Mike.
Bertrand.
- MikeB
- 9x Developer
- Posts: 18000
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Changing to an Atmega 128
Yes it should. I was responding to an earlier question on compatibility. Using ELPM may take more execution cycles to set up the RAMPZ register. With any luck, the compiler will put all the program memory data in the first 64K anyway.
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
-
- 9x Developer
- Posts: 2764
- Joined: Fri Dec 30, 2011 11:11 pm
- Country: -
Re: Changing to an Atmega 128
Perfect then! I will check the lss file. I have compiled with -O2 instead of -Os optimization mode (as I do for gruvin9x / sky9x boards). It will save some execution cycles. I didn't test -O3 for now.
Bertrand.
Bertrand.
Re: Changing to an Atmega 128
It has been awhile. Any updates on if the '128 is working on not?
-Gohst
-Gohst
Re: Changing to an Atmega 128
I just received mine this morning. Will try to give news later.
Re: Changing to an Atmega 128
fixe.. (means cool in Fortuguese)
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
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
-
- Posts: 46
- Joined: Mon Jan 09, 2012 9:54 am
- Country: -
Re: Changing to an Atmega 128
mine are still on the way...
Re: Changing to an Atmega 128
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
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
-
- 9x Developer
- Posts: 2764
- Joined: Fri Dec 30, 2011 11:11 pm
- Country: -
Re: Changing to an Atmega 128
In your place I would wait for Kilrah's first problems solved!
Bertrand.
Bertrand.
Re: Changing to an Atmega 128
Thanks Bertrand, well, I've odered them just in case.. were not too expensive.. If not will use them in other projects.. just wanted to know if they were the right ones..
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
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
- MikeB
- 9x Developer
- Posts: 18000
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Changing to an Atmega 128
Very nice, I expect some people would like to know how you removed the Mega64, if they want to do it themselves.
The problem I have is how many different Txs do I need to be able to test all the different possible hardware versions?
Mike.
The problem I have is how many different Txs do I need to be able to test all the different possible hardware versions?
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- 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
I am sure I have an old main board somewhere if you want it for dev work?MikeB wrote:Very nice, I expect some people would like to know how you removed the Mega64, if they want to do it themselves.
The problem I have is how many different Txs do I need to be able to test all the different possible hardware versions?
Mike.
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!
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
- MikeB
- 9x Developer
- Posts: 18000
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Changing to an Atmega 128
It's more having the case and sticks than having a board, thanks.
Mike.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!
- 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
If you don't mind what it looks like... I can probably gather you the bits
Will check tomorrow.
Will check tomorrow.
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!
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!
-
- 9x Developer
- Posts: 2764
- Joined: Fri Dec 30, 2011 11:11 pm
- Country: -
Re: Changing to an Atmega 128
My wife will not like either the 4th 9x at home
So open9x seems to run and use the whole EEPROM? I see 3593 octets libres
Bertrand.
So open9x seems to run and use the whole EEPROM? I see 3593 octets libres
Bertrand.
Re: Changing to an Atmega 128
yeah, with the 128 it rocks 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
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
Re: Changing to an Atmega 128
Has anyone run across this problem?
I changed to an atmega128a and I can read and write flash and eeprom but the board has no output and osc seems to be stopped, the board worked before mod. There is no PPM. no sound and no screen output but the scope does show some output on ppm about 40 millivolts, I don't know what it should be though.
I changed to an atmega128a and I can read and write flash and eeprom but the board has no output and osc seems to be stopped, the board worked before mod. There is no PPM. no sound and no screen output but the scope does show some output on ppm about 40 millivolts, I don't know what it should be though.
Re: Changing to an Atmega 128
You need to set the fuses with companion9x's relevant menu option.
Sent via mobile
Sent via mobile
Re: Changing to an Atmega 128
Thanks for the fast reply, I am slower than you are. I tried using the companion 9x and it is confusing at first, it sets the fuses to 3f 81 ff and the osc takes off running about 1.2v pp on scope, but no other change seems to have taken place. There is still no output from the cpu, no sound, no screen, and no ppm. So since the fuse setting fixed the osc what is next to trouble shoot the problem?
Interestingly, the stock atmega64 reads half of the peak voltage on the osc (.6v pp).
Interestingly, the stock atmega64 reads half of the peak voltage on the osc (.6v pp).
Re: Changing to an Atmega 128
check that you don't have any shorts between pins or even components around the atmega.. once I found a short on mine after I replaced the original atmega with the 128. A little bit of solder was shorting both sides of an SMD capacitor.. good that I inspected it with a magnifier and a multimeter before powering the board, or it could have been a headache
Also check that all the pins are soldered in place. It's probably a good idea to reflow the solder...
João
Also check that all the pins are soldered in place. It's probably a good idea to reflow the solder...
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
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
Re: Changing to an Atmega 128
I agree with João. I suspect that the problem will be something like a pin that isn't soldered to the pad or a short..
As for what the fuses should be set for on the M128. To be honest it was a long time ago and I cannot find out what I did to make it all work.
Most of the M128 stuff is here ----> http://openrcforums.com/forum/viewtopic ... hilit=m128 You will find the fuse information there at the post shown here --> http://openrcforums.com/forum/viewtopic ... 545#p36367
As for what the fuses should be set for on the M128. To be honest it was a long time ago and I cannot find out what I did to make it all work.
Most of the M128 stuff is here ----> http://openrcforums.com/forum/viewtopic ... hilit=m128 You will find the fuse information there at the post shown here --> http://openrcforums.com/forum/viewtopic ... 545#p36367
Re: Changing to an Atmega 128
Yeha! I read your advice and got the first one to work, there was nothing wrong with the board, it was the grounds I left off the avr connector.
The second one works also, I had to reprogram it, it also had a bad connection to pin 12 (exit sw) which showed up after I reprogrammed the cpu. Thanks to all that helped, including all the people on the forum.
Yeah, I had trouble with programmers, but it was mostly not having the right connections, I had to use a new HobbyKing USBASP with the stk error to get the programming to work the first time, the unit that I reprogrammed to get rid of the stk error worked with the 64 but not with the 128 until I set the fuses with the unmodified USBASP first. I did not change any parameters to slow the programmer down, it just worked with companion9x.
(jhsa in comment below means leaving the ground wires off the connector to pins 4-6-8-10)
The second one works also, I had to reprogram it, it also had a bad connection to pin 12 (exit sw) which showed up after I reprogrammed the cpu. Thanks to all that helped, including all the people on the forum.
Yeah, I had trouble with programmers, but it was mostly not having the right connections, I had to use a new HobbyKing USBASP with the stk error to get the programming to work the first time, the unit that I reprogrammed to get rid of the stk error worked with the 64 but not with the 128 until I set the fuses with the unmodified USBASP first. I did not change any parameters to slow the programmer down, it just worked with companion9x.
(jhsa in comment below means leaving the ground wires off the connector to pins 4-6-8-10)
Last edited by tedbmoss on Sun May 19, 2013 6:27 am, edited 3 times in total.
Re: Changing to an Atmega 128
Yeah, that's not a good idea
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
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
- MikeB
- 9x Developer
- Posts: 18000
- Joined: Tue Dec 27, 2011 1:24 pm
- Country: -
- Location: Poole, Dorset, UK
Re: Changing to an Atmega 128
After changing to a Mega128, a number of people have reported reboots happeniong when using the horizontal trims.
See http://openrcforums.com/forum/viewtopic.php?f=95&t=3594 for a solution to this problem.
Mike.
See http://openrcforums.com/forum/viewtopic.php?f=95&t=3594 for a solution to this problem.
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
The difficult we do immediately,
The impossible takes a little longer!