I am trying to synchronize two PWM signals so that the rising edge matches up. For some reason Gen2, Out5 seems to be about 150 ns late. I tried reading the processor manual about the PWM modules, but the information on synchronization is not making any sense to me about which and when to set the right SYNC bits. I tried many different settings combinations. What am I doing wrong?
GPIOPinConfigure(GPIO_PK4_M0PWM6); GPIOPinConfigure(GPIO_PG1_M0PWM5); GPIOPinTypePWM(GPIO_PORTK_BASE, GPIO_PIN_4); GPIOPinTypePWM(GPIO_PORTG_BASE, GPIO_PIN_1); SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM0); PWMGenConfigure(PWM0_BASE, PWM_GEN_3, PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC); PWMGenConfigure(PWM0_BASE, PWM_GEN_2, PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC); PWMGenPeriodSet(PWM0_BASE, PWM_GEN_3, (BOARD_CLOCK / TIM5_FREQ) - 1); PWMPulseWidthSet(PWM0_BASE, PWM_OUT_6, TIM5B_10US); PWMGenPeriodSet(PWM0_BASE, PWM_GEN_2, (BOARD_CLOCK / TIM5_FREQ) - 1); PWMPulseWidthSet(PWM0_BASE, PWM_OUT_5, TIM5B_10US); PWMGenEnable(PWM0_BASE, PWM_GEN_3); PWMGenEnable(PWM0_BASE, PWM_GEN_2); PWMOutputState(PWM0_BASE, PWM_OUT_6_BIT | PWM_OUT_5_BIT, true); PWMSyncTimeBase(PWM0_BASE, PWM_OUT_5_BIT | PWM_OUT_6_BIT); PWMSyncUpdate(PWM0_BASE, PWM_OUT_5_BIT | PWM_OUT_6_BIT);