Page 2 of 2

Re: Changing to an Atmega 128

Posted: Wed Sep 05, 2012 6:43 pm
by MikeB
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.

Re: Changing to an Atmega 128

Posted: Wed Sep 05, 2012 7:41 pm
by bertrand35
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.
The compiler should take care of it (as it does on the 2560 from gruvin9x for all PSTR), no?
Bertrand.

Re: Changing to an Atmega 128

Posted: Wed Sep 05, 2012 7:45 pm
by MikeB
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.

Re: Changing to an Atmega 128

Posted: Wed Sep 05, 2012 7:55 pm
by bertrand35
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.

Re: Changing to an Atmega 128

Posted: Wed Sep 12, 2012 12:16 pm
by gohsthb
It has been awhile. Any updates on if the '128 is working on not?
-Gohst

Re: Changing to an Atmega 128

Posted: Wed Sep 12, 2012 12:33 pm
by Kilrah
I just received mine this morning. Will try to give news later.

Re: Changing to an Atmega 128

Posted: Wed Sep 12, 2012 12:36 pm
by jhsa
fixe.. (means cool in Fortuguese) :mrgreen:

Re: Changing to an Atmega 128

Posted: Wed Sep 12, 2012 1:08 pm
by derFrickler
mine are still on the way...

Re: Changing to an Atmega 128

Posted: Mon Sep 24, 2012 12:01 pm
by jhsa

Re: Changing to an Atmega 128

Posted: Mon Sep 24, 2012 12:42 pm
by bertrand35
In your place I would wait for Kilrah's first problems solved!
Bertrand.

Re: Changing to an Atmega 128

Posted: Mon Sep 24, 2012 1:02 pm
by jhsa
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..

Re: Changing to an Atmega 128

Posted: Mon Oct 15, 2012 4:18 pm
by Kilrah
Image

Image

Image

Image

:)

Re: Changing to an Atmega 128

Posted: Mon Oct 15, 2012 4:43 pm
by MikeB
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.

Re: Changing to an Atmega 128

Posted: Mon Oct 15, 2012 5:11 pm
by Rob Thomson
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.
I am sure I have an old main board somewhere if you want it for dev work?

Re: Changing to an Atmega 128

Posted: Mon Oct 15, 2012 5:29 pm
by MikeB
It's more having the case and sticks than having a board, thanks.

Mike.

Re: Changing to an Atmega 128

Posted: Mon Oct 15, 2012 5:37 pm
by Rob Thomson
If you don't mind what it looks like... I can probably gather you the bits :)

Will check tomorrow.

Re: Changing to an Atmega 128

Posted: Mon Oct 15, 2012 8:19 pm
by bertrand35
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.

Re: Changing to an Atmega 128

Posted: Mon Oct 15, 2012 8:45 pm
by jhsa
yeah, with the 128 it rocks then..

Re: Changing to an Atmega 128

Posted: Fri May 17, 2013 5:35 am
by tedbmoss
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.

Re: Changing to an Atmega 128

Posted: Fri May 17, 2013 6:59 am
by Kilrah
You need to set the fuses with companion9x's relevant menu option.

Sent via mobile

Re: Changing to an Atmega 128

Posted: Sat May 18, 2013 11:06 pm
by tedbmoss
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).

Re: Changing to an Atmega 128

Posted: Sat May 18, 2013 11:30 pm
by jhsa
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

Re: Changing to an Atmega 128

Posted: Sat May 18, 2013 11:37 pm
by Flaps 30
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. :cry:

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

Posted: Sun May 19, 2013 1:14 am
by tedbmoss
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)

Re: Changing to an Atmega 128

Posted: Sun May 19, 2013 1:23 am
by jhsa
Yeah, that's not a good idea ;) :mrgreen:

Re: Changing to an Atmega 128

Posted: Mon Jun 10, 2013 9:04 pm
by MikeB
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.