Go Down

Topic: Overclocking the Arduino DUE (Read 5185 times) previous topic - next topic

janost

Thought I try some DUE overclocking just for the fun of it :)
So I tried some different PLL MUL/DIV settings.

It seem that 120MHz is max what the SAM3X8E Cortex M3 chip will run.
This is not because of the flash read speed but because of the internal SRAM and that has no waitstate setting.

So at 114MHz it runs stable with the original 4FWS setting (20MHz AHB bus-speed).

That is 136% overclocking without any problems.

Code: [Select]

#define SYS_BOARD_PLLAR (CKGR_PLLAR_ONE | CKGR_PLLAR_MULA(18UL) | CKGR_PLLAR_PLLACOUNT(0x3fUL) | CKGR_PLLAR_DIVA(1UL))
#define SYS_BOARD_MCKR ( PMC_MCKR_PRES_CLK_2 | PMC_MCKR_CSS_PLLA_CLK)
       
/* Set FWS according to SYS_BOARD_MCKR configuration */
EFC0->EEFC_FMR = EEFC_FMR_FWS(4); //4 waitstate flash access
EFC1->EEFC_FMR = EEFC_FMR_FWS(4);

/* Initialize PLLA to 114MHz */
PMC->CKGR_PLLAR = SYS_BOARD_PLLAR;
while (!(PMC->PMC_SR & PMC_SR_LOCKA)) {}

PMC->PMC_MCKR = SYS_BOARD_MCKR;
while (!(PMC->PMC_SR & PMC_SR_MCKRDY)) {}

prismatics

Thanks for sharing this valuable information. It's interesting to see that you can reduce power consumption down to 20% by lowering the processor clock speed to some MHz. This can be very interesting for low power battery-operated devices as you can recover the full processor speed in some microseconds... Additionally, disabling all unused peripherals can lead to even lower power consumption and greater battery life without losing any functionality.

janvier123

can this be used on a UNO too  or is it not possible ?

robtillaart

No not the same as UNO and DUE are completely different processors.

That said, there have been many overclocked UNO's  google is your friend)

Saving power with an UNO is well described here - http://www.gammon.com.au/forum/?id=11497 
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

youthreewire

I want to set my Due to 96 Mhz (I hope it will be still programmable from the arduino environment after I set it to 96Mhz). How do I set it to 96Mhz using the PLL?Please let me know

Digitalis

#5
Jun 30, 2015, 04:04 am Last Edit: Jun 30, 2015, 04:09 am by Digitalis
Awesome find! Didn't know it was overclockable to that degree -- or overclockable in the first place!
If the Due can be so easily overclocked, what about the Zero?
Also, can it be programmed when overclocked?

Isaac96

The UART is probably going to be off if you overclock. So is the USB.
Do not PM me for help. I will delete immediately.
CONNECT THE GROUNDS!

After Tuesday, even the calendar goes W T F

HermannSW

#7
Jan 09, 2016, 04:46 pm Last Edit: Jan 09, 2016, 04:56 pm by HermannSW
Quote
I want to set my Due to 96 Mhz (I hope it will be still programmable from the arduino environment after I set it to 96Mhz). How do I set it to 96Mhz using the PLL?
Use this (change from 18UL for 114MHz to 15UL for 96MHz, 84MHz is 13UL or 0x0dUL (as in system_sam3xa.c):
Code: [Select]
void setup() {
#define SYS_BOARD_PLLAR (CKGR_PLLAR_ONE | CKGR_PLLAR_MULA(15UL) | CKGR_PLLAR_PLLACOUNT(0x3fUL) | CKGR_PLLAR_DIVA(1UL))
#define SYS_BOARD_MCKR ( PMC_MCKR_PRES_CLK_2 | PMC_MCKR_CSS_PLLA_CLK)
       
/* Set FWS according to SYS_BOARD_MCKR configuration */
EFC0->EEFC_FMR = EEFC_FMR_FWS(4); //4 waitstate flash access
EFC1->EEFC_FMR = EEFC_FMR_FWS(4);

/* Initialize PLLA to (15+1)*6=96MHz */
PMC->CKGR_PLLAR = SYS_BOARD_PLLAR;
while (!(PMC->PMC_SR & PMC_SR_LOCKA)) {}

PMC->PMC_MCKR = SYS_BOARD_MCKR;
while (!(PMC->PMC_SR & PMC_SR_MCKRDY)) {} 
 
// your other setup code goes here
}


MULA settings is specified here [factor is (MULA+1)]:
http://www.atmel.com/images/atmel-11057-32-bit-cortex-m3-microcontroller-sam3x-sam3a_datasheet.pdf#page=549

I did measure 20 blinks of Blink example with stop watch in 34.98s.
20 blinks take 40s normally, and 35==40*84/96

Btw, Graham showed in this posting how to fix Serial communication when running on 114MHz.
https://forum.arduino.cc/index.php?topic=462107.msg3236016#msg3236016
http://stamm-wilbrandt.de/en/Raspberry_camera.html

vamsee227

#8
Oct 12, 2018, 07:55 am Last Edit: Oct 12, 2018, 08:02 am by vamsee227
Is it possible for the Overclocked clock to be made available to PWM and timer peripherals to run them at 100MHz?

ard_newbie


What PWM frequency and duty cycle would you need ?

FYI, with PMC_PCKx registers, you can output square signales up to 240 MHz ( see page 529, Sam3x datasheet).

Go Up