LPC4357 CLKOUT

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

LPC4357 CLKOUT

Jump to solution
986 Views
skysky
Contributor III

LPC4357 clock out pin(CLKOUT) is unable to output the CLK.(i can not check a wave on pin P1_19)

i configure such as follow:

LPC_SCU->SFSP1_19 = (1 << 5) | 4;
LPC_CGU->BASE_OUT_CLK = (1 << 11) | (0 << 24);

So,Is there a lack of configuration?

Labels (1)
0 Kudos
1 Solution
706 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Sky,

In the LPCOpen library demo, you can use the following code to set up the clock via the CLK0 pin.

Chip_SCU_ClockPinMuxSet(0,(SCU_MODE_FUNC1|SCU_MODE_INACT));
/* Setup base clock for CLKOUT */
Chip_Clock_SetBaseClock(CLK_BASE_OUT, CLKIN_CRYSTAL, false, false);‍‍‍

LPCOpen library:

LPCOpen Software for LPC43XX|NXP 
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

4 Replies
707 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Sky,

In the LPCOpen library demo, you can use the following code to set up the clock via the CLK0 pin.

Chip_SCU_ClockPinMuxSet(0,(SCU_MODE_FUNC1|SCU_MODE_INACT));
/* Setup base clock for CLKOUT */
Chip_Clock_SetBaseClock(CLK_BASE_OUT, CLKIN_CRYSTAL, false, false);‍‍‍

LPCOpen library:

LPCOpen Software for LPC43XX|NXP 
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

706 Views
skysky
Contributor III

hi jeremyzhou:

now i have another problem about extern singal frequence measure.

Because the singal(Sin Wave/Pwm) frequence is too big(about 70+MHz),i think about using

the timer in MOTORCONPWM peripheral。

and i use the way of External event counting (Counter mode),the pin MCI0 is used to input the Signal to be measured。

then set a match value in counter mode,then play the role of frequency division,(100 prescaler-Check the MOTORCONPWM's output pin MCOA0)。

In order to test whether this method is effective,i use CLK0(IDVE clock)clock connect to MCI0。

So,i find a error:

1.CLK0 be set to 2MHZ,the MIC counter is correct,the MCOA0 output 20KHZ

2.CLK0 be set to 4MHZ,the MIC counter is corrent,the MCOA0 output 40KHZ

3.CLK0 be set to 8MHZ,the MIC counter is error,the MCOA0 output also about 40KHZ 

So ,my question is the counter frequence of MCPWM's counter mode is 8MHZ?

refer to the other peripheral ie.TIMER capture mode,check a external singal's rising edge need 2 PCLK,the max frequence is bigger than 8MHZ.

 

my code such follow:

LPC_CCU1->CLK_APB1_MOTOCONPWM_CFG = 0x7;

LPC_RGU->RESET_CTRL1 = 1 << 6; //MOTOCONPWM_RST
while(!(LPC_RGU->RESET_ACTIVE_STATUS1 & (1 << 6)));

LPC_SCU->SFSP8_2 = ((1 << 4) | (1<<6) | (1<<7) | 3);//   MIC0
LPC_SCU->SFSP9_3 = 1;      //MCOA0
LPC_SCU->SFSP9_4 = 1;   //MCOB0

LPC_MCPWM->CON_CLR = 0xffffffff;
LPC_MCPWM->CNTCON_SET = (1 << 29) | 1; //channel0 counter / rising

LPC_MCPWM->LIM0 = 100;      //100 prescaler
LPC_MCPWM->MAT0 = 50;

thank you very much

0 Kudos
706 Views
jeremyzhou
NXP Employee
NXP Employee

Hi sky,

I'd highly recommend you to crate a new thread for the another question, and sharing the link of the thread.

Thanks for your understanding and cooperation.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
706 Views
skysky
Contributor III

thank you your advise

i am sorry to trouble you

0 Kudos