| ??? 12/31/03 06:14 Read: times |
#61650 - RE: Quadrature encoder Responding to: ???'s previous message |
From your comment on clock on A it looks like you either didn't understand my idea or didn't read it at all.
What if I just remove -all- high-freq oscillations? Put a low-pass filter based on a monostable multivibrator on the line? If I don't expect more than 4000 signals a second, why should I prepare my software to intercept 1000000? Can't I just decide (in hardware) that if I receive two or more signals from the same source within less than 20 µs then I should treat them as one, and as long as the delay between signals doesn't increase, I shouldn't generate another read pulse? Now at worst I will get one invalid transition. Note sanity check on transitions is very simple. If A'=previous A; B'=previous B With: ACC.0=A ACC.1=B ACC.2=A' ACC.3=B' ACC.4..7=0 PSW.1=1 means invalid, =0 means valid. Now with valid transition (i.e. the encoder moved through the edge and stopped generating noise) I get A xor B' = direction. With invalid transition (the encoder just moved back from the edge onto the same area it was before) I abandon the interrupt without changing anything. Clock on any edge of A or B. |



