Hi, I wrote the following code to get a PWM signal on my PF0 pin. I created this function and call it in my main function, however its not doing anything, the LED is not turning on and the oscilloscope i have shows that there is no pulse there can someone please help me out:
void configurePWM(void) { // // Enable the GPIO Peripheral used by PWM (PF0, and eventually PF1) // SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); // // Enable PWM0 // SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM0); // //Dividing the clock for PWM use - Will use one for now // SysCtlPWMClockSet(SYSCTL_PWMDIV_1); // //Unlocking the pins // HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY; HWREG(GPIO_PORTF_BASE + GPIO_O_CR) = 0x01; // // Configure GPIO pin for PWM // GPIOPinConfigure(GPIO_PF0_M0PWM0); GPIOPinTypePWM(GPIO_PORTF_BASE, GPIO_PIN_0); // // Cofigure PWM // PWMGenConfigure(PWM_GEN_0_OFFSET, PWM_GEN_0, PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC); // //Setting PWM Period // PWMGenPeriodSet(PWM_GEN_0_OFFSET, PWM_GEN_0, 99); // 99+1 clock ticks per period just to test on // //Setting duty cycle // PWMPulseWidthSet(PWM_GEN_0_OFFSET, PWM_OUT_0 , 49); //49+1 clock ticks per period just to test on // // Enable PWM // PWMGenEnable(PWM_GEN_0_OFFSET, PWM_OUT_0); PWMOutputState(PWM_GEN_0_OFFSET, PWM_OUT_0_BIT, true); }