Hello everyone :)
I’m using QEI peripheral on ek-tm4c123gxl and TivaWare v2.1.3.156.
Overview of problem:
When following the API instructions to calculate velocity, the result is double of what is expected.
Detailed problem description:
The API documentation entry for QEIVelocityGet() states that, “The value returned is the number of pulses detected in the specified time period.” This function returns the contents of register QEISPEED. The datasheet description for QEISPEED register (page 1321) similarly states that it contains “the number of velocity pulses counted in the previous velocity timer period.”
But the “Functional Description” of QEI (section 21.3 on page 1308) of the datasheet states that “The edge count from the previous time period is available to the controller via the QEI Velocity (QEISPEED) register. . . . As soon as the current time period is complete, the total number of edges counted in that period is made available in the QEISPEED register”.
So when I divide by number of edges per revolution instead of pulses, the answer matches my calculations from the oscilloscope readings. 1 pulse = 2 edges.
Or maybe I’m missing something else entirely?
Thanks for your feedback.
