LPC4370 About configure Clock of CLKOUT Port ( P1_19 )

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

LPC4370 About configure Clock of CLKOUT Port ( P1_19 )

Jump to solution
1,374 Views
leeyoungjae
Contributor II

I am trying to configure 8MHz Clock of CLKOUT ( Port/Pin : P1_19)

This clock will be used output for external Peri device 

Develop Environment.

- Testing Board : LPC-LINK2

- MCU : LPC4370

- Develop Tools : LPCXpresso (free) and LPCOpen (demo code)

 

Question

1. How can i set up (configure) CLKOUT Clock out of LPC4370 ?

- what is right setup flow ?,

- where is technical doc or sample code to configure CLKOUT of 8MHz clock?

If you have any example code to configure External Clock, Please Let me know

The following figure is for LPC4370 CGU and You can see CLKOUT in red color 

pastedImage_9.png

Labels (4)
1 Solution
986 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello LEE Young Jae,

  

    Here I will tell you the step to configure the CLKOUT in P1_19.

   1. Select the clock source for CLKOUT in CGU BASE_OUT_CLK, take an example, if you select the crystal oscillator.

Chip_Clock_SetBaseClock(CLK_BASE_OUT, CLKIN_CRYSTAL, true, false);

    2. Configure the P1_19 function as CLKOUT in register SFSP[1][19].

pastedImage_1.png

From the user manual, you can get that the CLKOUT is the FUNC4.

So, you can use this code to configure it:

Chip_SCU_PinMuxSet(0x1, 19, (SCU_PINIO_FAST | SCU_MODE_FUNC4));

3. About the 8Mhz, a simple way, you can change your external crystal to 8MHZ, then CLKOUT select the 8Mhz, you can get the 8Mhz in CLKOUT pin(P1_19) directly.

4. About the P1_19 test point position, please refer to this picture:

pastedImage_2.png

5. About the code, I modify it in the lpcopen systick

pastedImage_3.png

Because the external crystal is 12Mhz, then I can get 12Mhz in the P1_19.

You can test it on your side.


Have a great day,
Kerry

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

View solution in original post

2 Replies
987 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello LEE Young Jae,

  

    Here I will tell you the step to configure the CLKOUT in P1_19.

   1. Select the clock source for CLKOUT in CGU BASE_OUT_CLK, take an example, if you select the crystal oscillator.

Chip_Clock_SetBaseClock(CLK_BASE_OUT, CLKIN_CRYSTAL, true, false);

    2. Configure the P1_19 function as CLKOUT in register SFSP[1][19].

pastedImage_1.png

From the user manual, you can get that the CLKOUT is the FUNC4.

So, you can use this code to configure it:

Chip_SCU_PinMuxSet(0x1, 19, (SCU_PINIO_FAST | SCU_MODE_FUNC4));

3. About the 8Mhz, a simple way, you can change your external crystal to 8MHZ, then CLKOUT select the 8Mhz, you can get the 8Mhz in CLKOUT pin(P1_19) directly.

4. About the P1_19 test point position, please refer to this picture:

pastedImage_2.png

5. About the code, I modify it in the lpcopen systick

pastedImage_3.png

Because the external crystal is 12Mhz, then I can get 12Mhz in the P1_19.

You can test it on your side.


Have a great day,
Kerry

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

986 Views
leeyoungjae
Contributor II

Dear Kerry Zhou,

I have tested to make External Clock by your way.

It is very helpful for me.

Thanks 

Have a great day ^^

0 Kudos