Hello,
We are using NXP LPC11C24 microcontroller on our project. We need PWM output for motor control.We have written the following code to try the PWM output.
LPC_TMR16B0->TCR = 0; LPC_SYSCON->SYSAHBCLKCTRL |= (1<<7); LPC_TMR16B0->EMR = (1<<EMC3)|(1<<EMC2)|(1<<EMC1)|(1<<EMC0)|(1<<3)|(MATCH0); LPC_IOCON->PIO0_8 &= ~0x07; LPC_IOCON->PIO0_8 |= 0x02; LPC_TMR16B0->PWMC = (1<<3)|(MATCH0); LPC_TMR16B0->MR3 = period; LPC_TMR16B0->MR0 = period/8; LPC_TMR16B0->MCR = 1<<10; NVIC_EnableIRQ(TIMER_16_0_IRQn); LPC_TMR16B0->TCR = 1; LPC_SYSCON->SYSAHBCLKCTRL |= (1<<6); while (1) { }
When we compiled this code in Keil. Pwm output doesn't have. But when we compiled in LPCXpresso PWM outputs has. We want to use Keil, but how can we compile this code in Keil correctly?
Thank you.