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.

TMS320F280048-Q1: Sync. Chain without using ePWM

Part Number: TMS320F280048-Q1


Hi,

In my board, I use pins below pins as below;

I use ePWM1,2,3,4 as PWM channels. All of them up-down count mode.

ePWM5 and 6 -> SPI | ePWM7-> UART |  ePWM8 as boot pin configuration. Pins are connected to 3.3V with pull-up resistor.

I need additional time-base submodule with double frequnency of my main ePWMs.

I chosed ePWM8 to use that purpose. It is needed to use SYNCPER signal to sync my main ePWM with CMPSS. 

1) Can I properly use ePWM8 in sync. chain while other ePWMs (5,6,7) aren't configured as ePWM in my software? I don't have any configuration lines for ePWM at my software! 

2) I added phase shift as 2 to to others ePWMS2,3,4,8 in order to fully sync them to ePWM1. Does the value 2 enough or do I need to increment it in chain? That means, do I need to write 4 as phase shift to ePWM4-5-6 and do I need to write 6 to ePWM7-8 group?

As I configured below, my ePWM8 isn't sync to ePWM1. I think I need to increase phase shift with a few nanoseconds!

I created sync chain using following codes.

void SYNC_init(void)
{
    SysCtl_setSyncOutputConfig(SYSCTL_SYNC_OUT_SRC_EPWM1SYNCOUT);
    //
    // For EPWM1, the sync input is: SYSCTL_SYNC_IN_SRC_EXTSYNCIN1
    //
    SysCtl_setSyncInputConfig(SYSCTL_SYNC_IN_EPWM4, SYSCTL_SYNC_IN_SRC_EPWM1SYNCOUT);
    SysCtl_setSyncInputConfig(SYSCTL_SYNC_IN_EPWM7, SYSCTL_SYNC_IN_SRC_EPWM1SYNCOUT);

}

    EPWM_setSyncOutPulseMode(EPWM1_BASE, EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO);

    EPWM_enablePhaseShiftLoad(EPWM3_BASE);
    EPWM_setPhaseShift(EPWM3_BASE, 2); // 2 is to sync fully!
    EPWM_setSyncOutPulseMode(EPWM3_BASE, EPWM_SYNC_OUT_PULSE_ON_EPWMxSYNCIN);
    EPWM_setCountModeAfterSync(EPWM3_BASE, EPWM_COUNT_MODE_UP_AFTER_SYNC);

I added 2 ! to all my ePWMs and it works for my eEPWMs that drive power switch.

  • Hi,

    The expert is out of the office because of Holiday. Please expect a reply by Tuesday.

    Thanks.

  • Hi Gokhan,

    1) Can I properly use ePWM8 in sync. chain while other ePWMs (5,6,7) aren't configured as ePWM in my software? I don't have any configuration lines for ePWM at my software! 

    I believe you need to have ePWM7 configured as an EPWM module for the sync chain to work for ePWM8, but I have not tried to use ePWM8 without configuring ePWM7. It looks like you have already tried this and it works for you without configuring ePWM7 as an epwm module. 

    2) I added phase shift as 2 to to others ePWMS2,3,4,8 in order to fully sync them to ePWM1. Does the value 2 enough or do I need to increment it in chain? That means, do I need to write 4 as phase shift to ePWM4-5-6 and do I need to write 6 to ePWM7-8 group?

    You shouldn't need to increment the phase shift value across the EPWM modules. This is what we state in the TRM:

    The value of the phase register is loaded into the counter register when an input synchronization pulse is detected (TBPHS → TBCTR). This operation occurs on the next valid time-base clock (TBCLK) edge. The delay from internal control module to target modules is given by:

    – if ( TBCLK = EPWMCLK): 2 x EPWMCLK

    – if ( TBCLK < EPWMCLK): 1 x TBCLK

    Best Regards,

    Marlyn

  • Hi Marlyn Rosales,

    1) Yes, I tried it. I get worked it after a few trias but it seems a tricky solution. It doesn't work as I expected. I need to be safe side to use this feature. Considering long term usage, is it safe to use controller in this configuration?

    2) OK. I will add "2 x EPWMCLK" to all ePWM channels that are synchronized to ePWM1.

    Thank you in advance.

  • Hi Gokhan,

    1) Yes, I tried it. I get worked it after a few trias but it seems a tricky solution. It doesn't work as I expected. I need to be safe side to use this feature. Considering long term usage, is it safe to use controller in this configuration?

    Yes, I would suggest setting the pins for EPWM7 as an EPWM for long term usage, if this is still possible to change in your design.

    Also, if its not too late to change devices, I would recommend the F28003x device ( https://www.ti.com/product/TMS320F280039C). This part has a flexible EPWM sync chain, you would be able to setup EPWM8 the way you want. It's also very similar to the F28004x device. 

    Best Regards,

    Marlyn

  • Hi Marlyn,

    Thank you for exact answer. Yes, I can switch to other MCU.

    Is it also flexable for F280038CPMRQ1?

    My collegues required samples from this MCU.  

  • Hi Gokhan,

    Yes, all variants of the F28003x device will have the flexible EPWM sync scheme.

    Best Regards,
    Marlyn