TMS320F28P650SK: Linking XLOAD register

Part Number: TMS320F28P650SK

Hello TI Experts,
 
I am having some troubles cross-linking EPWM XLOAD registers on a F28P65x.
 
I do have working code for F29H85x devices. There, I configure the cross-linking with
 
SysCtl_enableEPWMXLINK(
SYSCTL_EPWM1_XLINK | SYSCTL_EPWM2_XLINK | SYSCTL_EPWM3_XLINK | SYSCTL_EPWM4_XLINK | SYSCTL_EPWM5_XLINK |SYSCTL_EPWM6_XLINK);
 
And then call 
 
EPWM_enableXLoad(EPWM1XLINK_BASE);
 
to simultaneously set the STARTLD bit for all EPWM units.
 
This works great.

On the F28P65x devices, I attempted to cross-link as follows:
 
EPWM_setupEPWMLinks(EPWM2_BASE,  EPWM_LINK_WITH_EPWM_1, EPWM_LINK_XLOAD);
EPWM_setupEPWMLinks(EPWM3_BASE,  EPWM_LINK_WITH_EPWM_1, EPWM_LINK_XLOAD);
EPWM_setupEPWMLinks(EPWM4_BASE,  EPWM_LINK_WITH_EPWM_1, EPWM_LINK_XLOAD);
EPWM_setupEPWMLinks(EPWM5_BASE,  EPWM_LINK_WITH_EPWM_1, EPWM_LINK_XLOAD);
EPWM_setupEPWMLinks(EPWM6_BASE,  EPWM_LINK_WITH_EPWM_1, EPWM_LINK_XLOAD);
 
Expecting that the following would set the STARTLD bit for all EPWM units:

EPWM_enableXLoad(EPWM1_BASE);
 
However, this only sets the STARTLD bit for EPWM1.
 
One the other hand,
 
EPWM_enableXLoad(EPWM1_BASE);
EPWM_enableXLoad(EPWM2_BASE);
EPWM_enableXLoad(EPWM3_BASE);
EPWM_enableXLoad(EPWM4_BASE);
EPWM_enableXLoad(EPWM5_BASE);
 
will set STARTLD on all EPWM units, just not synchronously, which is required in my application.
 
Therefore, I would like to ask if my approach is fundamentally correct, and if there are any special considerations that I should be aware of. For example, is it critical at which point in the EPWM initializiation the EPWM_setupEPWMLinks call is made?

Thank you in advance.
Beat Arnet

  • Hi,

    EPWMXLINK feature is bit different in these two devices.

    Refer to below XLINKXLOAD register description below from TRM, so if epwm1 is linked to epwm2 in epwm2 XLINKXLOAD register then write to XLOAD register in epwm1 should result in epwm2 register write.

    Can you confirm the register configurations are correct after initialization before epwm1 xload register is written ?

    Thanks

  • Hello Prarthan!

    Thanks for you response.

    Yes, as per the code snippet above, and pasted here again, I do think that I am correctly linking XLOAD of EPWM2-6 to EPWM1.

    EPWM_setupEPWMLinks(EPWM2_BASE,  EPWM_LINK_WITH_EPWM_1, EPWM_LINK_XLOAD);
    EPWM_setupEPWMLinks(EPWM3_BASE,  EPWM_LINK_WITH_EPWM_1, EPWM_LINK_XLOAD);
    EPWM_setupEPWMLinks(EPWM4_BASE,  EPWM_LINK_WITH_EPWM_1, EPWM_LINK_XLOAD);
    EPWM_setupEPWMLinks(EPWM5_BASE,  EPWM_LINK_WITH_EPWM_1, EPWM_LINK_XLOAD);
    EPWM_setupEPWMLinks(EPWM6_BASE,  EPWM_LINK_WITH_EPWM_1, EPWM_LINK_XLOAD);

    This initialization does happen before the first write to XLOAD of EPWM1 occurs.

    Are there other nuances or particularities that I should be aware of? Or could you share a working example?

    Thanks again,

    Beat