Hello dear friends,
I need your please. I am new on arm. I am currently work on a embedded project. In this project using LPC1114 microchip and drv8821 drive a stepper motor, Thus I need the timer pwm square signal nearly 100 Hz. I have been reading user manual lpc1114 and i wrote a code but it failed. My code is below please analyze my code and help me. I am really stuck in this project. My abmotor step is data sheet and my project schematic pin 27 (pin 0_8)
//Set up 16 bit timer for PWM operation
LPC_IOCON->PIO0_8 = (LPC_IOCON->PIO0_8 & ~(
//set up pin for PWM use (sec 7.4.23)
LPC_SYSCON->SYSAHBCLKCTRL |= (
//enable clock signal to 16 bit timer0 (sec 3.5.14)
//set prescaler max value, not used here (sec 18.7.4)
//set for reset on counter match (sec 18.7.6)
//set pin 27 to 1 on match (sec 18.7.10)
//set to timer mode (sec 18.7.11)
//set channel zero to PWM mode (sec 18.7.12)
LPC_TMR16B0->MR1 = ???????
//set value for period (sec 18.7.7)
LPC_TMR16B0->MR0 = ??????
//set value for duty cycle (sec 18.7.7)
//enable and reset counter (sec 18.7.2)
LPC_TMR16B0->TCR &= ~(
//clear reset bit (sec 18.7.2)
When I write this code , I see only dc 2,68V in pin 27 from oscilloscope screen. But i need a square signal 100Hz in this pin. Please help me. At the least i dont know what value assign instead of question marks(MR1 and MR0) in my code for adjust the signal to 100Hz frequency.