LPC844 clock out

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LPC844 clock out

跳至解决方案
951 次查看
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

 

 

标签 (1)
0 项奖励
1 解答
940 次查看
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 项奖励
4 回复数
930 次查看
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 项奖励
923 次查看
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 项奖励
919 次查看
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 项奖励
941 次查看
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 项奖励