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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

451 次查看
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 回复

386 次查看
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 项奖励