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

Author: Miller (Guest)
Posted on:

Rate this post
0 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->MCPW0 = 2777;

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

Thanks in advance.

: Moved by Moderator


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.