AnsweredAssumed Answered

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

Question asked by Alican Çeviker on Jun 14, 2019
Latest reply on Jun 18, 2019 by Alice_Yang

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);

Outcomes