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);
Hello Alican Çeviker ,
How about the PCLK?
Could you please send your whole project , I will check it on my side.
BR
Alice