Use CLK2 for diagnosis

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Use CLK2 for diagnosis

ソリューションへジャンプ
234件の閲覧回数
pranavkolte
Contributor I

Hello

I am using LPC1823 controller for my project. I want to validate the system frequency is set correctly or not, for that reason  I need to set the CLK2 as CLKOUT so that the frequency is visible on osciloscope. Can you guide me with go can I set CLK2 as CLKOUT so that I can see the system frequency on it.

0 件の賞賛
1 解決策
150件の閲覧回数
HangZhang
NXP Employee
NXP Employee

Hi

@pranavkolte 

1. Abort "how to configure the CLK2 pin"

HangZhang_0-1717411352039.pngHangZhang_1-1717411360971.png

You can config clock2 pin through Chip_SCU_ClockPinMux function.

2. About "set the clock frequency to 1MHz"

HangZhang_2-1717411491277.png

You can config clock through blow functions

Chip_Clock_SetDivider();

Chip_Clock_SetBaseClock();

Chip_Clock_EnableBaseClock();

Or you can download and refer to LPC 18XX examples.

LPCOpen Software for LPC18XX | NXP Semiconductors

Hope this will help you.

BR

Hang

元の投稿で解決策を見る

4 返答(返信)
215件の閲覧回数
HangZhang
NXP Employee
NXP Employee

Hi @pranavkolte 

You need to configure the Clock Output (CLKOUT) feature correctly. Below are the steps you can follow to achieve this:
1. **Configure the Clock Output Pin:**
Ensure that the CLKOUT function is configured on the appropriate pin (typically this is a specific pin that can be multiplexed to CLKOUT). .
2. **Set the CLKOUT Configuration Register:**
Use the appropriate registers to set the clock source for CLKOUT. 
Step-by-Step Guide
1. **Enable the Clock Output Pin:**
Configure the pin function using the IOCON register. 
2. **Configure the CLKOUT Source:**
Select the clock source and divider for the CLKOUT. This involves writing to the CLKOUTCFG register. The CLKOUTCFG register controls the clock source and the divider for the CLKOUT pin.

3. **Enable the Clock Output Function:**
Ensure that the clock output function is enabled. 

Hope this will help you.

BR

Hang

0 件の賞賛
211件の閲覧回数
pranavkolte
Contributor I

Hello @HangZhang 

Thank you for the guidance, I tried it and able to see the frequency now. Can please let me know about how can I set the clock frequency to 1MHz and how to configure the CLK2 to see 1 MHz or send me any example code to do so.

0 件の賞賛
151件の閲覧回数
HangZhang
NXP Employee
NXP Employee

Hi

@pranavkolte 

1. Abort "how to configure the CLK2 pin"

HangZhang_0-1717411352039.pngHangZhang_1-1717411360971.png

You can config clock2 pin through Chip_SCU_ClockPinMux function.

2. About "set the clock frequency to 1MHz"

HangZhang_2-1717411491277.png

You can config clock through blow functions

Chip_Clock_SetDivider();

Chip_Clock_SetBaseClock();

Chip_Clock_EnableBaseClock();

Or you can download and refer to LPC 18XX examples.

LPCOpen Software for LPC18XX | NXP Semiconductors

Hope this will help you.

BR

Hang

118件の閲覧回数
pranavkolte
Contributor I

Hello @HangZhang 

Can you please help or guide me with how can I use tinyusb with my project but I do not want to use the board files . I just want the device should be displayed in device manager, till now what ever I have done it shows this in device manager.

DeviceDescriptorRequestFailed.png.

It will be helpful if you can share a code or project of that.

0 件の賞賛