does anyone know how to get the adruino due operating at the maximum 84MHz core clock frequency?
I am programming in the atmel studio IDE 6. I created a very simple test application that is running on a PLLA of 192MHz which is divided by 8 to get 24MHz core clock. But if I select the /4 prescaler for the master clock nothing works anymore.
#include <asf.h>
int main (void)
{
/* Insert system clock initialization code here (sysclk_init()). */
pmc_enable_pllack(47,10,1); //192MHz
pmc_switch_mck_to_pllack(PMC_MCKR_PRES_CLK_8);// core clock 24MHz
The Arduino environment doesn't let you change clock frequency, not without a lot of hoops to jump through. It runs at 84MHz always. Have a look at the code that the Arduino IDE generates for main() and you might find a clue.
MorganS:
The Arduino environment doesn't let you change clock frequency, not without a lot of hoops to jump through. It runs at 84MHz always. Have a look at the code that the Arduino IDE generates for main() and you might find a clue.
Thanks for you reply, but I am not using the arduino IDE and I can change the clock speed as you can see in the code I posted. However I can't get it to operate at 84MHz (or something above 24MHz).
I finally found the reason why it didn't work above 24MHz.
I found another topic about "overclocking" the due where the user configured the flash wait register.
Digging through the datasheet I found the table specifying the flash wait configuration vs. core speed.
I had to increase this to 4 to get the due to work at 84MHz.
#include <asf.h>
int main (void)
{
/* Insert system clock initialization code here (sysclk_init()). */
pmc_enable_pllack(41,10,1); //168MHz