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.

TMS320F280049C: ePWM monitoring using eCAP

Part Number: TMS320F280049C
Other Parts Discussed in Thread: DRV8353, , C2000WARE, SYSCONFIG

Hello,

I am working on a motor control application on a custom board using a TMS320F280049C and a DRV8353 Gate driver.

I am trying to follow the Functional Safety Manual to implement a monitoring function of the ePWM outputs by an input capture peripheral. The Functional Safety Manual suggests that the connection between the ePWM output and the eCAP can be done externally in the board or internally using XBAR. I want to opt for the XBAR approach, as I don't want any hardware modification at this stage.

I require some guidance on:

  • how to connect the ePWM and the ECAP using the XBAR. 
  • how to perform the monitoring itself. Given that each ePWM module has two outputs (EPWMxA and EPWMxB), I am unsure what measurements I should do using the ECAP.

Thank you in advance for your help.

  • Hello Martin,

    You can refer to the existing eCAP examples within C2000Ware on how to measure signals with the peripheral and how to configure an ISR (C2000Ware_5_02_00_00\driverlib\f28004x\examples\ecap). ePWMxA and ePWMxB are just separate pins from my understanding, but I will let another expert elaborate on this and your question about XBAR.

  • Hi Martin,

    Are you using SysConfig? If so, I can send  you an example .syscfg file that demonstrates the usage of XBARs to connect EPWM to ECAP. Regardless of whether you're using SysConfig, you should perform the following:

    Configure two INPUTXBAR modules to read the EPWM outputs.

    Configure two ECAP instances to select these INPUTXBARs instances as their inputs. (Refer to the ECAP Input Selection table in the TRM)

    Let me know if you have additional questions.

    Thank you,

    Luke

  • Hi Luke, 

    We are based on C2000Ware 3.01.00, so we aren't using SysConfig.

    I am trying to run ecap_ex2_capture_pwm example, but I don't see anything happening. Interrupts don't seem to happen. Is there any suggestions you could make?

    I added expressions but all the variables remain to 0 and put breakpoints in ecap1ISR and cannot get it to hit them.

  • Hi Martin,

    I believe you should only get an interrupt when an edge comes from the EPWM. Since you have not connected ECAP to EPWM, you will not receive any interrupts.

    To connect via xbars, you should modify the ECAP input selection to be inputxbar instead of GPIO16, and then configure that inputxbar to read GPIO16. Let me know if you need help writing the code to do this.

    Thank you,

    Luke

  • >> Since you have not connected ECAP to EPWM, you will not receive any interrupts.

    I have tried modifying the code to route GPIO5 to XBAR input7 instead of GPIO16 (XBAR_setInputPin(XBAR_INPUT7, 5) but I still don't get the interrupts. Is there anything else I should do?

  • Update: I have managed to hook the ECAP and the EPWM via XBAR on my application (the example still doesn't work, but that's fine, as I am interested in my own application). There was some issue with interrupts not being serviced on my application.

    Do you have any suggestions on how to do the monitoring itself? The Functional Safety Manual is very vague regarding what checks to do. 

    Thank you in advance

    Martin

  • Hi Martin,

    My expertise is in XBARs, but I will reassign this thread to our ECAP expert, they will get back to you shortly.

    Thank you,

    Luke

  • Hi Martin,

    There was some issue with interrupts not being serviced on my application.

    The interrupt issue is resolved now correct?

    What suggestions are you looking for with monitoring the signal? In the functional safety manual are you trying to adhere to a specific safety requirement?