LPC844 clock out

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,961件の閲覧回数
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 解決策
1,950件の閲覧回数
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 返答(返信)
1,940件の閲覧回数
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 件の賞賛
返信
1,933件の閲覧回数
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 件の賞賛
返信
1,929件の閲覧回数
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 件の賞賛
返信
1,951件の閲覧回数
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 件の賞賛
返信