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

All design tool related questions: compiler, assembler, linker. Embedded programming questions: assembler, C code.

Moderator: nferre

adfelippe
Posts: 2
Joined: Tue Sep 20, 2016 1:59 pm

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

Tue Sep 20, 2016 2:07 pm

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?

Return to “Development Tools”

Who is online

Users browsing this forum: No registered users and 3 guests