I am using a recent version of controlSUITE and CCS version 5.1.0.09000. I am using the controlCARD TMDXCNCDH52C1 with the XDS100v2 emulator.
I am running the example eqep_pos_speed_c28. Instead of attaching the encoder inputs to the PWM output signals, I tie all of the inputs together. So I have GPIO's 20, 21, and 22 tied together -- not 23 because I am not concerned with index pulse. This should make sure that the encoder has no input signal, so I would expect the value to start at zero and stay there. On the m3 I run the setup_m3 project.
I put a breakpoint on line 138 of Example_posspeed.c in the function POSSPEED_Calc to view the position value for the encoder. This is one line below the following:
pos16bval=(unsigned int)EQep1Regs.QPOSCNT; // capture position once per QA/QB period
When I examine the value of pos16bval, I get a value, for example 7522. If I simply run till I hit the breakpoint again, the number increments a small amount, e.g. 7588. If I remove the breakpoint temporarily and let it run, then stop it again, the value increments some amount relative to the amount of time it has run. For example if I run for about five seconds it goes to 10,344.
When I originally ran this example, I had the PWM leads going into the encoder inputs as suggested and I thought I had a working system, since I saw the encoder value incrementing. But now I see that the incrementing value was not related to the signals going into the encoder inputs, rather it was just the passage of time.
Why is EQep1Regs.QPOSCNT changing value with no signal on the encoder input lines? What can I do to make it work correctly.