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.

TMS320F28388D: What's the difference between eqep ex1 and eqep ex5?

Part Number: TMS320F28388D

As the title, can somebody tell me what's the difference between eqep ex1 and eqep ex5.

I am trying to measure the direction of the motor, but after implementing the function that

reads the direction from eqep ex5, it doesn't work. Am I missing something?

  • Hi Hao-Yu,

    The primary difference between ex1 and ex5 is that ex1 was written for fixed point devices and uses Math libraries to convert to floating point devices. Ex4 and 5 are written directly for floating point devices, which the F28388D device is, so the algorithms are much more straightforward. There are also differences in the interrupt structure. 

    I don't recall if the examples directly make the call to get direction from eQEP, but that can be gotten from the EQEP_getDirection  function. What values are you seeing when this function is called? It should return either 1 if moving forward or -1 if moving backward.

    Regards,

    Peter

  • Yeah, I am using the EQEP_getDirection function in ex1, but it only returns 1, whether the motor turn CW or CCW. So I am curious mabye there is something that I've missed (I only added the function in ex1, nothing is changed), so that the function wouldn't perform corrctly. 

  • Hi Hao-Yu,

    This is strange. The getDirection function does not require any external algorithm, it gets the direction from the internal state machine within the eQEP peripheral. As long as the proper signals are wired into the eQEP peripheral, it should work. Can you double check to make sure that channels A, B and the index (if present) are properly wired to the device and that the proper GPIOs are used? 

    Also, you are viewing this value through the debug menu? Can you make sure that "continuous refresh mode" is enabled so that you are getting the updated values throughout program execution.

    Regards,

    Peter