Welcome! Log In Create A New Profile

Advanced

Overclock/reclock atmega 2560?

Posted by DjDemonD 
Overclock/reclock atmega 2560?
July 18, 2016 04:19AM
So I'm reading about plenty of arduino users changing the crystal on their 2560s for 20Mhz and having no issues with the board running at the higher speed. As I understand it there is an issue flashing to it at 20Mhz, so it seems having the crystal switchable for programming makes sense.

Now I know people might say just go 32bit and I am, that's not the point this is about can it be done for 3d printing,if it's just a few $ and easy to get 25% more speed out of a mega this is surely worth trying? The issue with deltas stuttering as they are on the limit of the atmega would surely be far better with that little bit of headroom that this creates.

Anyone have any experience of trying this?

Edited 2 time(s). Last edit at 07/18/2016 04:21AM by DjDemonD.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
VDX
Re: Overclock/reclock atmega 2560?
July 18, 2016 04:24AM
... I think, the cheapish Arduinos are not safe/stable enough for overclocking - best would be the 32Bit route ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Overclock/reclock atmega 2560?
July 18, 2016 06:59AM
Thanks for your reply. I appreciate this but they're cheap and I've got 2 or 3 lying around. I will put a heatsink on it. I am told a lot of the atmega chips are rated for 20mhz and that clocking them at 16mhz is a legacy from older boards, so its not the processor that struggles, they apparently don't even get that hot or need higher voltage, its the USB chip and EEPROM that might be a problem (or might not). There are many reports of 20Mhz being quite stable, some people even claim 32Mhz is possible but more problematic obviously.

I've ordered some 20Mhz crystals and I'm quite willing to maybe try it then test it with a sketch to just run the processor at full capacity and error check to see if there are any failures. If I can find a sketch (I'm not a programmer) that tests eeprom and USB as well then all the better.

Its again that situation we encounter on a daily basis, we/I know that a £99 duet wifi is a better choice, I've got one on order, but I've got a £10 mega 2560 and will have a £1 - 20Mhz crystal by mid week. At the worst I kill an old arduino, at best I give my delta the ability to run faster without stuttering, the LCD menu to be more responsive and all for the addition of a heatsink and swapping a crystal when I want to flash a firmware.

What I am interested to know is if anyone is currently running a printer from an "optimised" mega in this way. If it absolutely cannot be done and does not work, then I'll save myself the time.

Edited 1 time(s). Last edit at 07/18/2016 07:07AM by DjDemonD.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Overclock/reclock atmega 2560?
July 18, 2016 07:17AM
NB if you do change the crystal, you will need to recompile your firmware. The baud rates are based on the crystal frequency, Luckily its easy to updated the boards.txt file with a new frequency, recompile and upload and your done.

Normally its says

mega.build.f_cpu=16000000L change this to
mega.build.f_cpu=20000000L

This is also why boot loaders don’t work, the default one is designed for 16mhz
Re: Overclock/reclock atmega 2560?
July 23, 2016 12:25PM
So flashed a spare arduino with blink then changed the crystal for 20Mhz one. Works fine. Changed the boards.Txt for 20Mhz. However usb stops working. Am told baud rates need adjusting as they are multiples of the clock frequency. More experimenting to do.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Overclock/reclock atmega 2560?
July 23, 2016 08:27PM
should work... Ive done this on SL boards with 1284p's But I haven’t tried it on 2560's


see [wormfood.net] for baud rate calculations

The only baud that’s out of spec on 20mhz is 230.4K but its out of spec on the 16mhz also
Re: Overclock/reclock atmega 2560?
July 24, 2016 05:27AM
Yeah this makes me wonder why the usb stops working. I'm still using 16mhz bootloader maybe this is the reason, or maybe the usb chip just can't work at this clock frequency. So looks like if I was using sd card only to print, I could burn the firmware with 16Mhz crystal then switch to 20Mhz.

Need to see if I can get/compile a 20Mhz bootloader.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Overclock/reclock atmega 2560?
July 24, 2016 06:38AM
umm a few misconceptions here

The usb chip is a completely separate chips with a separate crystal (a atmega16u2 with its own 16mhz crystal) it just converts from usb to serial

The mega2560 only knows about serial, the boot loader also only knows about serial

Anything the boot loader sets can be changed with the main program.

So basically upgrading the crystal shouldn’t change anything on the usb to serial side

I'm wondering if you changed the wrong crystal, the large tin can crystal is for the usb to serial converter

The mega2560 crystal is normally a tiny resonator (depends on your particular board of course)

Edited 1 time(s). Last edit at 07/24/2016 06:50AM by Dust.
Re: Overclock/reclock atmega 2560?
July 24, 2016 02:47PM
I think you are right. Resoldered the large crystal and everything is back to normal. Hmm. I think I have identified the smaller one you refer to and it will be a lot more of a challenge to desolder and replace.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Overclock/reclock atmega 2560?
October 10, 2017 03:12PM
Resurrection time!

DjDemonD,

Did you ever successfully complete this mod? I've got a spare mega board and was already planning on swapping out the crystal. Just need them to show up in the mail. I've opted for a 22.1184Mhz crystal though.
Re: Overclock/reclock atmega 2560?
October 10, 2017 03:53PM
No I didn't get it to work, I got a rearm and then moved on to duet controllers. But keen to hear if you do make it work.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Overclock/reclock atmega 2560?
October 10, 2017 09:30PM
Just a reminder


Sorry, only registered users may post in this forum.

Click here to login