Content originally posted in LPCWare by phuockal on Fri Aug 14 01:16:06 MST 2015Dear friends, experts,I am using LPC4078 and I want to output PWM frequency 1Khz at P3.25I am using lpc_pwm library, as attached.my code to setup PWM is:void main (){ //pwmPWM_TIMERCFG_Type configParameter; PWM_ConfigStructInit(PWM_MODE_TIMER, &configParameter);PWM_Init(PWM_1, PWM_MODE_TIMER, &configParameter);//config port P3.25 as PWM1[2]PINSEL_ConfigPin(3,25,2);//config pwm as single edge operationPWM_ChannelConfig(PWM_1, 2, PWM_CHANNEL_SINGLE_EDGE);//config matchPWM_MATCHCFG_Type matchConfig;matchConfig.IntOnMatch = DISABLE;matchConfig.MatchChannel = 2;matchConfig.ResetOnMatch = ENABLE;//changematchConfig.StopOnMatch = DISABLE;PWM_ConfigMatch(PWM_1, &matchConfig);//set duty cycle //PWM_MatchUpdate(PWM_1, 0, 1000, PWM_MATCH_UPDATE_NEXT_RST);PWM_MatchUpdate(PWM_1, 2, 10, PWM_MATCH_UPDATE_NEXT_RST);//start PWMPWM_Cmd(PWM_1, ENABLE); //PWM_CounterCmd(PWM_1, ENABLE);//reset counter //PWM_ResetCounter(PWM_1);//enable pwm outputPWM_ChannelCmd(PWM_1, 2, ENABLE); while(1) { }}I measured the output but it is always 3.3V. there are no pulse.Any body can share me any example code of using PWM.I always appreciate your help Original Attachment has been moved to: lpc_pwm.c.zip
Original Attachment has been moved to: lpc_pwm.h.zip