This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

system_LPC13xx.c problem

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?

Parents
  • 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

Reply
  • 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

Children