EmbDev.net

Forum: µC & Digital Electronics LPC1768 MCPWM as a normal PWM output


von Miller (Guest)


Rate this post
useful
not useful
I would like to use the MCPWM as a normal PWM output, because the mbed 
pwm is already in use. Can somebody help me what I should configure to 
control p1.19?

I tried already this, but on the scope I get a DC value 0f 2.36V: Power 
up MCPWM LPC_SC->PCONP |= 1<<17;

PCLK = CCLK (100MHz in our case) LPC_SC->PCLKSEL0 |= 1<<30;

Configuring P1.19 = 33 as MC0A LPC_PINCON->PINSEL3 |= (1<<6);

Set the Limit register (MCLIM0-2 is named as MCPER0-2 in CMSIS source 
file) LPC_MCPWM->MCPER0 = 5555;

Start MCPWM channels 0 LPC_MCPWM->MCCON_CLR = 0xffffffff; 
LPC_MCPWM->MCCON_SET = (1<<0);

LPC_MCPWM->MCPW0 = 2777;

My idea is to get a frequency of 180 Hz and a duty cycle of 50%.

Thanks in advance.

: Moved by Moderator
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.