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.

TMS320F280041: The method to test frequency

Part Number: TMS320F280041
Other Parts Discussed in Thread: TMS320F28069

Hi,

I'm using TMS320F280041 to design a motor driver of PMSM.

I want to test the frequency(0-1500Hz) that is square wave input from exterior, in the case of no interrupt.

There are some question,

1. If eCAP module could only record time? Is there the method to record the number of pulses?

2. If eQEP module could use to test the frequency? If i can only use eQEPxA(don't configure the pin of EQEPxB、EQEPx_index、EQEPx_Strobe)? If the eQEP module must be both A and B two channel input.

3. If there is other module or method which could test the frequency? I want to achieve it under the premise of no interrupt and execution cycle above 500us.

Please help to give some advice.

Thanks,

Walsh

  • The question is the same with TMS320F28069 also if F28069 could achieve the goal.

    Thanks,
    Walsh
  • Hi Walsh,

    Time stamp captured by eCAP can be used to compute frequency. You can configure eCAP to capture Rising/Falling edge, and then substract the two values to compute Pulse width. You can do this by polling for Capture flag if you do not want to use interrupt. Also you can write the SW to count number of times flags were generated due to Rising/Falling edge events to compute number of pulses.

    On thing to keep in mind eCAP counter is 32bit so make sure it does not overflow in case your frequency is really slow.

    Regards,
    Nirav
  • Hi Nirav,

    Actually, i wonder a method, such as capture module of some MCU, which has a counter register to record the pulse count. So that I could read the number of pulses in a long period, may be every 1 second.

    Is there similar method to achive like this?

    Thanks,
    Toawrong
  • Hi Nirav:

    Thanks for your repley. I have a further question below with Toawrong.

    I wonder a method, such as capture module of some MCU, which has a counter register to record the pulse count. So that I could read the number of pulses in a long period, may be every 1 second.

    Is there similar method to achive like this?

    Thanks,
    Walsh
  • Hi Walsh,

    Yes, you can use eQEP module to count number of pulses using UP count mode. You can only connect the clock input the eQEPA. For more information you can refer Technical Reference Manual.

    www.ti.com/.../sprui33

    Regards,
    Nirav
  • Hi Nirav:

    The counter direction signal need hard-wired and QEPB can't be used for other purpose. In other words, both frequency signal and direction signal need be occupied . It can't be achieved that only use a port.

    Thanks,

    Walsh

  • Hi Walsh,

    Yes, there is no other option, you will need to use 2 ports, since any change in direction on QEPB will corrupt your frequency/pulse measurements.

    Regards,
    Nirav