How Should I Go About Creating a 5MHz Clock With LPC1769

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

How Should I Go About Creating a 5MHz Clock With LPC1769

1,359件の閲覧回数
aceviker
Contributor I

The title is self explanatory. I have tried it with pwm but couldn't manage to get 5MHz got around 4.8MHz.

Here is the pwm code

#define SAM_CLK_PIN 26
#define SAM_CLK_PORT 3
#define SAM_CLK_PWM_CH 3
#define SAM_CLK_PWM_MATCH 3

Chip_PWM_Init(LPC_PWM1);
Chip_IOCON_PinMuxSet(LPC_IOCON, SAM_CLK_PORT,SAM_CLK_PIN, IOCON_MODE_INACT | IOCON_FUNC3);/* PWM1[2] */
Chip_PWM_PrescaleSet(LPC_PWM1, 0);
Chip_PWM_SetControlMode(LPC_PWM1, SAM_CLK_PWM_CH, PWM_SINGLE_EDGE_CONTROL_MODE, PWM_OUT_ENABLED);
Chip_PWM_SetMatch(LPC_PWM1, 0, 6);
Chip_PWM_SetMatch(LPC_PWM1, SAM_CLK_PWM_CH, 3);
Chip_PWM_Enable(LPC_PWM1);
Chip_PWM_LatchEnable(LPC_PWM1,0,PWM_OUT_ENABLED);
Chip_PWM_LatchEnable(LPC_PWM1,SAM_CLK_PWM_CH,PWM_OUT_ENABLED);

0 件の賞賛
返信
1 返信

1,294件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Alican Çeviker ,

How about the PCLK?

Could you please send your whole project , I will check it on my side.

BR

Alice

0 件の賞賛
返信