Re: decoding quadrature encoders
Just had to make one other change that I hoped you could explain to me. Once I made the change to check the STATUS instead of _enc_tmp,7 bit, my counting was all backwards.
By changing the direction test from "btfsc _enc_old,7" to "btfss _enc_old,7", the issue was resolved. So basically the bit value for _enc_old,7 is set rather than clear on cw.
Direction is a matter of interpretation.
changing the direction test from "btfsc _enc_old,7" to "btfss _enc_old,7 OR
changing the direction test from "btfsc _enc_old,6" to "btfsc _enc_old,6 OR
swaping the "A","B" connections ,will all cause the "direction " to reverse
I notice you are still incorrectly not saving the mcu context upon isr entry
Warning I'm not a teacher
Bookmarks