Hello All,
I managed to get QEI working on my TivaC board, for now using energia. It does work, but I have some questions:
I am configuring velocity capture with the following statement:
QEIVelocityConfigure(QEI0_BASE, QEI_VELDIV_1, 80000000 / 1632 * 60);
80000000 is the cpu clocks per second
1632 is my gearbox * encoder_ppr
60 is 60 seconds per minute to read rpm.
I also have a RPM measurement device so I can measure the RPM from outside. The above configuration does work and generate the correct results.
However if I use QEI_VELDIV_2 or higher, from what I understand reading documentation we would need to reduce the period (80000000 / 1632 * 60) by two by dividing it into 2.
But this will lead the velocity reading to be 1/4 of real value. Similar if we use the QEI_VELDIV_4 counter.
To get correct results, we would need to multiply the period by the value of veldiv.
Why is that? Would not we need to divide it by veldiv?
Best regards,
C.