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

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

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

453 Views
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 Kudos
1 Reply

388 Views
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 Kudos