Hi
I m trying a very simple example, to get the CLKOUT to work on a LPC844.
I am using the below SDK
I make a project and use the code below to output the MAINCLK to PIO0_24:
SWM0->PINASSIGN_DATA[11] &= ~(0xFF<<8);
SWM0->PINASSIGN_DATA[11] |= (24<<8);
SYSCON->CLKOUTSEL = 1;
SYSCON->CLKOUTDIV = 1;
But nothing happens on the pin. I am missing something?
Br
Thomas
Solved! Go to Solution.
Hi,
Thank you for feedback.
First of all.....it works now
The missing part was the activation of the SWM: SYSCON->SYSAHBCLKCTRL0|=1<<7;
But I had thought about it and looking in the manual:
It states that it is enabled from reboot or am I missing something?
Br
Thomas
Hi, Thomas,
It is good new that it works well. Regarding the SWM bit which is set in default after reset based on the Table 147. System clock control 0 register, maybe it is documentation error, the bit SWM is cleared in default after reset.
BR
XiangJun Rong
Hi
Maybe there is no error after all.
When I look in the user manual, then I don't think table 147 is the right table you refer too. I refer to table 146 (SYSAHBCLKCTRL0).
But continuing to table 148 (PRESETCTRL0) (maybe also the one you meant instead of table 147), then I can see that SWM is reset by default, but this can be changed in this register.
So I guess that SYSAHBCLKCTRL0 can be changed on the fly in the code and PRESETCTRL0 is a startup thing when it boots.
Br
Thomas