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.

TMS320F2800157-Q1: PWM signal's Duty cycle measurement with eCap module

Part Number: TMS320F2800157-Q1
Other Parts Discussed in Thread: TMS320F2800157

Hello,

There is a requirement to measure the duty count of PWM signal generated by ePWM module by using eCap module. I have seen some of the example for it, which is describing that for measurement external connection should be there.  

1) Is there any possibilities that without any external connection ecap module can measure duty of PWM signal generated by ePWM module?

Thank you.
Regards,

  • Hello Jay,

    The following is Table 15-1. eCAP Input Selection from the device TRM section 15.3 Configuring Device Pins for the eCAP;

    Unfortunately, as you can see, there's no direct ePWM connections. However, I've implemented a workaround before where the selected GPIO XBAR input is selected as the output for the desired signal- i.e. ePWMx output to GPIOy, with GPIOy also configured as the Input XBAR input into the eCAPIf the ePWM is already being used as an output, this shouldn't need any additional connections, I believe.

    Regards,
    Jason Osborn
    Note: Key takeaways from this post are bolded.

  • Hi Jason. Thanks for the response.

    From Your description I am not clearly getting how you have achieved.

    Assume, I want PWM on GPIO 30, hence on GPIO 30 I have provided PWM functionality. Can you elaborate more further what should I do to measure duty with eCap on GPIO30? (If on GPIO30 not possible, pls throw some more light with other any GPIO how to achieve it?)

    P.S. In my application 2 modules are used and for each GPIOs are fixed.

    Regards,

  • Hello Jay,

    The TMS320F2800157 has an additional, highly useful peripheral that I'm referencing- the Input XBAR. Any GPIO can be selected as the input on the Input XBAR, including GPIO30. The eCAP can use any selected Input XBAR as an input. Using this, any GPIO input or output can be measured by the eCAP.

    Therefore, by selecting GPIO30 as Input XBAR 1 (using the Input XBAR register INPUT1SELECT = 30 = 0x1E), then selecting Input XBAR 0 as the input into the eCAP (using the eCAP register ECCTL0[INPUTSEL] = 0x0), GPIO30 can used as the input into the eCAP peripheral.

    The following images (highlighting from me) are from the TMS320F280015x device TRM, linked here.

    Input X-BAR destinations table 10-1

    eCAP Input Selection table 15-1

    Regards,
    Jason Osborn
    Note: Key takeaways from this post are bolded.