Go Down

Topic: Burn new bootloader in Arduino Mega 2560 R3 (Read 10775 times) previous topic - next topic


Because Alkerion is using a 22.1148 MHz clock and MegaCore doesn't have compiled bootloaders for that clock speed.
yes but it is simple to compile it for a new frequency. or not?


Sure it's simple to compile for a new frequency. I already provided instructions for doing that. However, MegaCore doesn't really have any relevance for that project. MegaCore does come with the Optiboot source, so you could get it that way, but MegaCore is a much larger download than just grabbing the contents of the Optiboot repository.


I use my 2560 with customized Optiboot and custom hardware definition, because of different fuse settings and baud rate


Apr 19, 2019, 09:06 pm Last Edit: Apr 19, 2019, 09:14 pm by Alkerion
OK, it works !   ;D

Bootloader uploaded without any issue, and uploaded code without problem.

Will have to do further tests to determine if there is an impact on micros() and millis() or not.

Here is a speed comparison between :

Left: Adafruit Grand Central M4 120Mhz
Center: Arduino Mega 2560 R3 22.11Mhz
Right:  Arduino Mega 2560 R3 stock 16Mhz

The video

That is ridiculous !

BIG Thanks to all of you who helped me to successfully overclock my Mega

I've attached the files for those of you who want to OC their Mega to 22.11Mhz


The crystal used :

The 22.11Mhz crystal

The crystal installed:

(I know it's not a very professional soldering, but it works, so I won't try to improve)


You're welcome. I'm glad to see it's working now. Enjoy!


Here is a speed comparison
Code: [Select]
 sx1 = (int)(cos(angle1) * radius1 + centerx1);
  sx2 = (int)(cos(angle2) * radius2 + centerx2);
  sx3 = (int)(cos(angle3) * radius3 + centerx3);
  sx4 = (int)(cos(angle4) * radius4 + centerx4);
  y1  = (int)(sin(angle1) * radius1 + centery1);
  y2  = (int)(sin(angle2) * radius2 + centery2);
  y3  = (int)(sin(angle3) * radius3 + centery3);
  y4 = (int)(sin(angle4) * radius4 + centery4);

Not exactly the sort of code that is likely to run fast on an 8bit CPU...

OTOH, the program used isn't well-optimized for the SAMD51, either (should use sinf() to better utilize the single precision floating point hardware!), and the code contains a LIMIT of the FPS that it will generate, so it's not clear that the M4 isn't even faster than it looks in that video...


HI !

I'll try with sinf().

Regarding the FPS limit I've disabled it of course.

Go Up