LPC1768 MCPWM as a normal PWM output

Guest #3354940
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.

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.