LPC844 clock out

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC844 clock out

Jump to solution
928 Views
tyassin1
Contributor II

Hi 

I m trying a very simple example, to get the CLKOUT to work on a LPC844.

I am using the below SDK

tyassin1_0-1615104138515.png

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

 

 

Labels (1)
0 Kudos
1 Solution
917 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Thomas,

How about using the code like:

SYSCON->SYSAHBCLKCTRL0|=1<<7; //or //SYSCON->SYSAHBCLKCTRL[0]|=1<<7;

SWM0->PINASSIGN_DATA[11] &= ~(0xFF<<8);
SWM0->PINASSIGN_DATA[11] |= (24<<8);
SYSCON->CLKOUTSEL = 1;
SYS...

Hope it can help you

BR

XiangJun Rong

View solution in original post

0 Kudos
4 Replies
907 Views
tyassin1
Contributor II

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:

tyassin1_0-1615221435546.png

It states that it is enabled from reboot or am I missing something?

Br

Thomas

0 Kudos
900 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

0 Kudos
896 Views
tyassin1
Contributor II

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

0 Kudos
918 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Thomas,

How about using the code like:

SYSCON->SYSAHBCLKCTRL0|=1<<7; //or //SYSCON->SYSAHBCLKCTRL[0]|=1<<7;

SWM0->PINASSIGN_DATA[11] &= ~(0xFF<<8);
SWM0->PINASSIGN_DATA[11] |= (24<<8);
SYSCON->CLKOUTSEL = 1;
SYS...

Hope it can help you

BR

XiangJun Rong

0 Kudos