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.

TMS320F28379D: CPU1 Timer0, EPWM timer synchronisation

Part Number: TMS320F28379D


1. How to synchronise Timer0 and EPWM ?

2. If I have two interrupts at same time say Timer0 and EPWM2, As per priority EPWM2 should be finished first. If timers of both the interrupts start at different time during cpu initialization, then synchronization between interrupt will be missing. Am I correct? 

  • Hi Ganeshapandi,

    Please refer to "Calculating PWM Period and Frequency" of the Technical Reference Manual to set your desired PWM frequency based on the configuration you are planning. Once you have this information you'll be able to configure your timer as well. However, synchronizing the two may pose many challenges. Something you could try to keep them in sync is reloading Timer 0 every time your TBCTR is equal to 0 or PRD but I suspect this will not be 100% synchronized. Why are you trying to sync the two? There might be other alternatives we can brainstorm.

    If you get two interrupts at the same time, specifically Timer0 and EPWM2, then Timer 0 will have higher priority not EPWM2. Please refer to the "Pie Channel Mapping" section of the Technical Reference Manual (TRM): "When multiple interrupts are pending, the lowest-numbered channel in the lowest-numbered group is serviced first". Timer0 is in group 1 and EPWM2 is in group 3. 

    Ganeshapandi K said:
    If timers of both the interrupts start at different time during cpu initialization, then synchronization between interrupt will be missing. Am I correct? 

    Yes, if they start at different times then they will not be synchronized at the beginning. However, you can always try to resync them later using the method I described above. 

    Best Regards,

    Marlyn