This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LM4F232H5QD: problem with build in PWM.

Hello, i'm trying to run four Pwm signals, two from generator1 (PH0 and PH1), another two form generator2 (PH2 and PH3). 

First two signals are generated properly, but another two not. I was trying everything. I would be very grateful if you could help me.   



SysCtlPWMClockSet(SYSCTL_PWMDIV_1);

SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM);

 SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);

 GPIOPinConfigure(GPIO_PH0_M0PWM0);
GPIOPinConfigure(GPIO_PH1_M0PWM1);
GPIOPinConfigure(GPIO_PH2_M0PWM2);
GPIOPinConfigure(GPIO_PH3_M0PWM3);

  GPIOPinTypePWM(GPIO_PORTH_BASE, GPIO_PIN_0);
GPIOPinTypePWM(GPIO_PORTH_BASE, GPIO_PIN_1);
GPIOPinTypePWM(GPIO_PORTH_BASE, GPIO_PIN_2);
GPIOPinTypePWM(GPIO_PORTH_BASE, GPIO_PIN_3);

//
// konfigurujemy PWMa
//
PWMGenConfigure(PWM_BASE, PWM_GEN_0, PWM_GEN_MODE_UP_DOWN |
PWM_GEN_MODE_NO_SYNC);
PWMGenConfigure(PWM_BASE, PWM_GEN_1, PWM_GEN_MODE_UP_DOWN |
PWM_GEN_MODE_NO_SYNC);

  PWMGenPeriodSet(PWM_BASE, PWM_GEN_0, 50000/10);
PWMGenPeriodSet(PWM_BASE, PWM_GEN_1, 50000/10);

  PWMPulseWidthSet(PWM_BASE, PWM_OUT_0, PWMGenPeriodGet(PWM_BASE, PWM_OUT_0)/ 4);
 PWMPulseWidthSet(PWM_BASE, PWM_OUT_2, PWMGenPeriodGet(PWM_BASE, PWM_OUT_2)/ 4);

PWMDeadBandEnable(PWM_BASE, PWM_GEN_0, 160, 160);
PWMDeadBandEnable(PWM_BASE, PWM_GEN_1, 160, 160);
 

PWMOutputState(PWM_BASE, PWM_OUT_0_BIT | PWM_OUT_1_BIT, true);
PWMOutputState(PWM_BASE, PWM_OUT_2_BIT | PWM_OUT_3_BIT, true);


PWMGenEnable(PWM_BASE, PWM_GEN_0);
PWMGenEnable(PWM_BASE, PWM_GEN_1);