I'm new to this forum, so please be kind and forgive my errors.
My current project is the evaluation of the LPC54102 processor. Until now, there were no serious problems, but:
I want to use the internal PLL (that seems different to other PLLs in LPC MCUs) and first configured it via LPCOpen and the libpower. That worked.
But I also was instructed to get the device working without any other libraries, which results in a ban of libpower.a.
So I recreated the whole project, that now uses makefiles and a custom startupcode/linkerscript, and rewrote the basic functions.
Now comes the PLL setup: I read the User Manual of the chip carefully and programmed the SYSCON-registers related to the PLL. The PLL sets also the lock-bit, which (for me) indicates, that its working.
The code of pll.c, which contains every relevant function, is attached.
My current program uses this code:
LPC_SYSCON->PDRUNCFGSET = SYSCON_PDRUNCFG_PD_SYS_PLL;
LPC_SYSCON->SYSPLLCLKSEL = SYSCON_PLLCLKSRC_IRC;
LPC_SYSCON->PDRUNCFGCLR = SYSCON_PDRUNCFG_PD_SYS_PLL;
while(!pll_is_locked()) ; /* wait for lock */
LPC_SYSCON->MAINCLKSELB = SYSCON_MAIN_B_CLKSRC_SYSPLLOUT;
This code seems to work and sets the PLL registers to (as far as I can judge it) proper values.
But as soon as I switch the main clock to the PLL output the Debugger jumps to random addresses (e.g. 0xFFFFFEF00) and the execution of the application does not go on.
I compared the register values and they match (except the two registers AHBMATPRIO and ASYNCAPHCTRL that are not set, because the program does not reach the writes to them) as far as the memory view let me see. But I know that this view does not show everything (e.g. CPSTAT register). Maybe there is a register that is missing to be set in my code.
How do I set up the PLL properly without using libpower?
I would be also interested in an user/reference manual to libpower.a.
Any help is welcome.
Original Attachment has been moved to: pll.c.zip