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.

PWM pins as Input Captures

I am looking for a microcontroller to control 12 DC motors at once. I have been looking into the delfino TMS330F28377D. I know that it has 24 ePWMs so I can use 12 of them as PWM outputs for enable signals, but I am wondering about using the other 12 as input captures. There are 6 eCAP that are capture modules, but I need 12 so I am wondering if it is possible to use ePWM pins that don't dual as eCAPs as input captures?

  • Hi Amy,

    Amy Wohlschlegel said:
    There are 6 eCAP that are capture modules, but I need 12 so I am wondering if it is possible to use ePWM pins that don't dual as eCAPs as input captures?

    As you correctly mentioned F28377D has 6 eCAP modules but you'll not be able to use ePWM modules as eCAP and hence capturing won't be possible through ePWM pins.

    BTW you can check this app note: http://www.ti.com/lit/an/spraah1/spraah1.pdf

    Regards,

    Gautam

  • Hi Amy,

    Depending on exactly what you wish to do, you may be able to utilize some of the trip zones or XINT provisions.

    For example, the trip zones can force interrupts which may be what you need. 

    In many cases, such as when we connect up hall effect sensors to our device, we may be able to read these inputs with GPIOs configured as inputs and poll them in the ISR.

    As Gautam mentions the QEP may be another option to consider.


    Thank you,
    Brett

  • Brett, 

     

    Can you explain a little more about trip zones or point me in the direction of something that could help me use them for captures? 

    Thanks, 

    Amy

  • Amy,

    The TZs won't really help you capture timings of waveforms but it can be used to generate an interrupt on an edge (similar to XINT).

    If you're looking for something to crisply capture the timings of a square wave waveform, the eCAP is the best option (followed by the QEP).

    If you give some details on what you're trying to capture, we may have more ideas.


    Thank you,
    Brett

  • I am trying to capture encoder signals from DC motors. They are quadrature encoders, so there are two encoder signals per motor and there are 12 motors.

  • Amy Wohlschlegel said:
    I am trying to capture encoder signals from DC motors. They are quadrature encoders, so there are two encoder signals per motor and there are 12 motors.

    There are only 3 eQEP modules. I'm not sure whether 6 eCAP modules would be helpful in this case.

    Regards,

    Gautam

  • Hi Amy,

    So it seems you have 12 incremental encoders that you need to interface.

    For incremental (quadrature) encoders, the C2000's preferred interface the QEP peripheral as Gautam suggests.  It automatically does the hard work for you.  Also, as mentioned, the F28377D only has 3 of them.  This means that it sounds like you'll still need a way to interface 9 more encoders.

    This will likely prove a bit challenging using one C2000 device.

    However, one thing that may help you is if you know that the motors will only turn in one direction.  In this case, and I'm just thinking out loud here, you may be able to externally AND the encoder's A & B output and then feed them into a CAP, TZ or something else that can force an interrupt.  Then inside the interrupt you'd increment a counter.

    The problem you'd have with the above is cost of some AND gates (which may not be too big of a deal) and dealing with all the interrupts while still running your control code (may be a big deal but with 2 cores and 2 CLA might be resolvable).  Other similar workaround strategies may also be possible.

    Another option may be to see if you can use a few less incremental encoders and still do you task. Perhaps in some places a proximity sensor could instead be used to position your motor.


    Thank you,
    Brett