I see this code lines in system_LPC13xx.c for clock update:
LPC_SYSCON->SYSPLLCLKUEN = 0x01; /* Update Clock Source */ LPC_SYSCON->SYSPLLCLKUEN = 0x00; /* Toggle Update Register */ LPC_SYSCON->SYSPLLCLKUEN = 0x01; while (!(LPC_SYSCON->SYSPLLCLKUEN & 0x01)); /* Wait Until Updated */
but it seems that lines 1 and 4 in above code is useless because in datasheet UM10375.pdf we see:
In order for the update to take effect, first write a zero to the SYSPLLUEN register and then write a one to SYSPLLUEN.
why we first one in code? why we check ENA bit going low?there is not note about this in datasheet.(line4)
------------- In line 352 ( system_LPC13xx.c ) we have:
if (LPC_SYSCON->SYSPLLCTRL & 0x180) {
but in SYSPLLCTRL register bit 0~6 are used and others are reserved,why in above bits 8 and 7 are used in if statement?
Hello zaal zaalack,
Thank you for pointing out.
system_LPC13xx.c was coded according a preliminary version of the user manual. You are right, the lines you have mentioned can be omitted. We will change the the system file according the current documentation.
Best Regards, Martin
BUG in keil ---> for LPC1313 in debug mode with ulink2 : BOD window does not work ( do not show BODCTRL register data)