Page 1 of 1

How to change PMC Master Clock Register in SAM-BA applets

Posted: Tue Sep 20, 2016 2:07 pm
by adfelippe
Hi everyone,

I've tried to change MDIV in PMC Master Clock Register in order to get a slower DDR clock when I run SAM-BA for my customized SAM9G15 board. I recompiled the applets, but clock is still at 133MHz. I'd like to slow it down to 100MHz, setting PCK_DIV4 to MDIV. Code changes below, in lowlevelinit.c:

Code: Select all

static void bypass_LowLevelInit (uint32_t extClk)
{
...

/* DDR clock = Processor Clock / MDIV / PLLADIV = 800MHz / 3 / 2 = 133MHz */
//mdiv = USER_MDIV(3);
/* DDR clock = Processor Clock / MDIV / PLLADIV = 800MHz / 4 / 2 = 100MHz */
mdiv = USER_MDIV(2);

...
Is there anything else I'm missing?