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.

TMS320F280025C: DRIVERLIB example project or code snippet to implement XLINK feature

Part Number: TMS320F280025C

 280025 Technical Reference Manual has description of XLINK feature below:

 

 

17.4.5 Simultaneous Writes to TBPRD and CMPx Registers Between ePWM Modules

For variable frequency applications, there is a need for simultaneous writes of TBPRD and CMPx registers

between ePWM modules. This prevents situations where a CTR = 0 or CTR = PRD pulse forces a shadow to

active load of these registers before all registers are updated between ePWM modules (resulting in some

registers being loaded from new shadow values while others are loaded from old shadow values). To support

this, an ePWM register linking scheme for TBPRD:TBPRDHR, CMPA:CMPAHR, CMPB:CMPBHR, CMPC, and

CMPD registers between PWM modules has been added.

For a particular ePWM module # A , user code writes B+1, to the linked register bit-field in EPWMXLINK. B is

the ePWM module # being linked to (that is, writes to the ePWM module B TBPRD:TBPRDHR,

CMPA:CMPAHR, CMPB:CMPBHR, or CMPC will simultaneously be written to corresponding register in ePWM

module A). For instance if ePWM3 EPWMXLINK register is configured so that CMPA:CMPAHR are linked to

ePWM1, then a write to CMPA:CMPAHR in ePWM 1 will simultaneously write the same value to

CMPA:CMPAHR in ePWM3. If ePWM4 also has its CMPA:CMPAHR registers linked to ePWM1, then a write to

ePWM 1 will write the same value to the CMPA:CMPAHR registers in both ePWM3 and ePWM4.

The register description for EPWMXLINK clearly explains the linked register bit-field values for corresponding

ePWM. An example of using the EPWMXLINK is linking ePWM2 CMPA with CMPA of ePWM1. In this case, a

write to CMPA of ePWM1 will also change the CMPA value for ePWM2.

  1. Could you point me to DRIVERLIB example project implementing this XLINK feature to write simultaneously to CMPA of 2 ePWM modules?
  2. If there is no such example project, some code snippet of implementing  XLINK feature is also very helpful

Thanks!

  • Hello Quentin,

    Section 2.3.1 of this document, 'Leverage New Type ePWM Features for Multiple Phase Control', references an example application. While that solution itself appears to have been deprecated, the code snippets in the document do provide an example of the XLINK functionality!

    Regards,
    Jason Osborn

  • Thanks a lot, Jason!

    Is there a way to  Simultaneously reset VCAPCTL registers (for example, use EPWM_startValleyCapture() ) Between ePWM Modules? Is there any example project or code snippet?

  • Hello Quentin,

    Unfortunately, I do not believe that feature exists.

    I believe there is a workaround. The VCAPCTL registers of each ePWM can be configured such that the valley sequence of each is always started by the same event (for example-- VCAPCTL[TRIGSEL] = 111 (triggered by DCBEVT2), and then that event can be configured to be triggered by a user condition so that it can always be triggered at the same time.

    That workaround is a bit complicated, though, and I do not have any example code available for that implementation.

    Regards,
    Jason Osborn