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?
BUG in keil ---> for LPC1313 in debug mode with ulink2 : BOD window does not work ( do not show BODCTRL register data)