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: Capture PWM signals from an external source

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

Hello,

We need to capture 7 PWM signals from an external source independently. Essentially, we want to measure the period of a continuous signal generated by an external device and 2 PWM output signals generated by this microcontroller, Total 9 signals (7 in capture mode, 2 in pwm output mode).

Could you please confirm if the TMS320F2800157-Q1 microcontroller is capable of this task? If not, please suggest how we can achieve this with this microcontroller. Any ideas would be appreciated.

  • Hello Mastik,

    Yes that is possible using the eCAP module capture mode on device 

    You can route the external pwm signal on GPIO and then route it to eCAP module using Inputxbar

    Can also refer to c2000ware example 2 

    Thanks!

  • After going through the code we have observed that there are 3 ECAP instances possible and each can select one GPIO as input from listed GPIO inputs. So how can we detect 7 distinct asynchronous pulses real time & continuously?

  • Hello Mastik,

    Yes we have 3 eCAP instances on F280015x device so you can only use three input signals of choice.
    I am not sure of any work around to that, will tag eCAP expert to comment on that.

    Thanks,
    Prarthan

  • Hello Prarthan,

    As I have asked in starting, need to capture 7 PWM signal simultaneouly or parallely from an external source independently.

    Please let me know with this controller is possible to do this task or suggest me some other controller.

    Please tag to appropriate eCAP expert.

    Thanks

    Mastik

  • Hi Mastik,

    One work around that may be possible is to configure the eCAP in one shot mode. Initiate a capture. Then change the input to the eCAP to source from another signal and re arm the capture. That way if you need to capture 7 PWM signals you can do so in a round robin fashion.

    Are you constantly needing to capture the 7 PWM signals at all times?

    If so, we have other MCU's with more eCAP modules such as our TMS320F28P65X device that contains 7 eCAPs that you can use.

    Best,

    Ryan Ma

  • Hi, 

    Can you provide complete details of the work around you mentioned above - 

    1. configure the eCAP in one shot mode, Initiate a capture

    2. Then change the input to the eCAP to source from another signal

    3. re arm the capture

    The work around is little tricky, as all these inputs are asynchronous. But we can try giving certain time slot to each input by diecting it to eCAP for capturing. 

  • Hi Mastik,

    Try out a few of our examples that capture a single PWM waveform using eCAP. Once you understand this example, and where the input is coming from you could have an ISR that can change which input source the eCAP is monitoring. I would set up the eCAP to be in one shot mode so that a reArm is necessary to start a capture of the signal again when you're ready to capture after switching the input to eCAP to be from another input. If it was in continuous mode, it will not work trying to switch the input and then clear the captured events.

    Best,

    Ryan Ma