Re: HEDS5540 optical encoder
Thank You Richard for helping me. The your corrected code works, the routine counts up and down when I turn the encoder shaft cw or ccw, but if i mark the shaft starting position and turn on the MCU the reading is zero thats OK and when i slowly turn for example half turn and go back to marked position the encoder reading is not zero but less or more than zero. I think the routine not count correctly the encoder pulses, maybe the encoder send incorrect signals, I dont know
.
I tried my setup again more carefully and verified it works ok, several back and forth motions always returns to the zero mark as zero in either direction, so the question is does rbc_int on your chip react to every edge generated by the encoder the same as ioc_int on a 16f1825 / perhaps not
Warning I'm not a teacher
Bookmarks