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.

TMS570LS1227: Having problems with the eQEP period register

Part Number: TMS570LS1227
Other Parts Discussed in Thread: HALCOGEN

I have the eQEP running in quadrature-clock mode for a motor controller application. The Position Counter and Direction Decoder are working well, but I am having difficulty getting sensible values from the QUPRD register for speed calculation purposes.

I am polling the capture overflow flag (COEF) and I can see overflows occurring which I think is causing the problem, so I am fairly sure that it is due to how I've initialized the capture registers but I'm not sure why.

In HALCoGen, there is an example called "example_eqepEdgeCapture", is there also an example of what the register setup should be?

My current setup is:

- VCLK4 is set at 90MHz.

- The typical frequency of the encoder is 50Hz.

TIA

  • 50Hz should be fine. The maximum input frequency is VCLK4/2=45MHz.

    is the eQEP configured using HALCOgen GUI? The HALCOGen has an example: example_eqepEdgeCapture

  • Hi QJ Wang, thanks for the reply.

    Yes that is the example I have used (see below). However the values in the QCPRD are not right which  is why I think it is the initialization of the eQEP registers that is causing this. Ideally if the eQEPinit routine or the actual HALCoGen file was available that would help.

    if((eqepREG1->QEPSTS & 0x80U) !=0U)

               {

                     /* Elapsed time between unit position events */

                     deltaT = eqepREG1->QCPRD

                     /* Calculate Velocity from deltaT and the value of the unit position. */

                     velocity = (float)(UNIT_POSITION_X/deltaT);

                     /* Clear the Status flag. */

                     eqepREG1->QEPSTS |= 0x80U;

               }