TM4C1290NCZAD: Outputs of a timer in PWM mode are not synchronized

Part Number: TM4C1290NCZAD

Tool/software:

Hi,

I've configured Timer1 of the TM4C1290NCZAD as a split pair where both timer A and timer B are set to PWM. One of them has a period of 60000 loaded in the ILR while the other has 30000, so the factor is exactly two. Duty cycle is set to 50% but it can be anything really, the problem still persists. I enable both timers at the same time. When I check the outputs on the scope I see them drifting. If I set period of timer B to 29999 it starts drifting in the opposite direction with approximately the same speed. If the period of both timers is the same then there is no problem.

What is the reason that the PWM outputs of the same timer are not synced and is there a workaround?

  • Hi,

      You can use the TimerSynchroize() API to synchronize the two timers. 

    13.3.5 Synchronizing GP Timer Blocks
    The GPTM Synchronizer Control (GPTMSYNC) register in the GPTM0 block can be used to
    synchronize selected timers to begin counting at the same time. Setting a bit in the GPTMSYNC
    register causes the associated timer to perform the actions of a timeout event. An interrupt is not
    generated when the timers are synchronized. If a timer is being used in concatenated mode, only
    the bit for Timer A must be set in the GPTMSYNC register.
    Note: All timers must use the same clock source for this feature to work correctly.

  • Unfortunatelly even after calling TimerSynchronize(TIMER0_BASE, TIMER_1A_SYNC | TIMER_1B_SYNC) there was no difference. The reason is not that the outputs are out of phase, which would be corrected by TimerSynchronize() if I understand it correctly, rather the phases of the outputs are drifting. I'll try to attach the video.

  • Hi,

      Can you send me your code?