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.

TMS320F28P650SK: Linking XLOAD register

Part Number: TMS320F28P650SK
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE

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

  • Hi,

    I tried the XLOAD on F28P65 Launchpad by just programming SHDW1 set to set of values and having active registers to different set of values.

    For example I have CMP active values - 0,500,1000,.. at initialization running EPWM_EX15 from c2000ware. I enabled shdw1 as active shdw pointer in loadonce mode using sysconfig. Note here I changed XLINKXLOAD as 0 since 0 is for linking to EPWM1.

    Now here when I write to EPWM1 XLOAD it should XLINK and write to EPWM2 and load SHDW1 set to active which tells me that XLINKXLOAD is working.

    Image Before writing STARTLD to EPWM1 :

    Image after write : 

    EPWM1 XCMP register after writing STARTLD of EPWM1

    EPWM2 XCMP register after writing STARTLD of EPWM1

    The active registers of EPWM2 now also match SHDW1 set, so I can conclude that its working okay.

    Thanks.

  • Hello Prarthan,

    Thank you for the additional testing and confirmation.

    I believe I found the root of the issue:

    The implementation of the EPWM_setupEPWMLinks driverlib function has a bug.

    When calling:

    EPWM_setupEPWMLinks(EPWM2_BASE, EPWM_LINK_WITH_EPWM_1, EPWM_LINK_XLOAD);

    The register address is computed to 

    EPWM2_BASE + EPWM_O_XLINKXLOAD = 0x00003200 + 0x000E = 0x0000320E

    when it really should be

    EPWM2_BASE + 
    EPWM_O_XCMPEPWM_O_XLINKXLOAD = 0x00003200 + 0x0100 + 0x000E = 0x0000330E

    Thank you, and kind regards,

    Beat

  • Hi Beat,

    Yes for XLINKXLOAD the base addr offset needs to addded, I will bring this to our software teams attention. Meanwhile you can create your own driverlib function and proceed further.

    Thanks