No, the flip flops encode the direction by giving 01 or 10 depending on direction, but if debouncing were necessary they would probably perform that function to. I am using an encoder with optical sensing and built in sig conditioner giving TTL outputs so no debounce is necessary. = Charles -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of Josh Koffman Sent: 06 September 2009 06:17 To: Microcontroller discussion list - Public. Subject: Re: [PIC] Encoder Oddness On Sat, Sep 5, 2009 at 11:26 PM, Charles wrote: > The solution which eventually worked perfectly was to have the encoder set > either one of a pair of D flip flops (74HC74) depending on direction, this > generated an interrupt (port B on a PIC18F4620), the interrupt routine reads > the state of the flip flops (01 or 10 depending on direction) drives a 3rd > I/O line to reset the 7074 to a 00 state and re-enables interrupts. =A0Th= is > approach worked, did not generate false readings, and can get encoder info > very fast if that is required. The only downside is you need one extra I/O > line to reset the 7074. =A0As an aside port B also reads a 4x4 keypad usi= ng > interrupts, the 7074 outputs are coupled via an RC network to RB7 & RB6. Just so I'm clear, you were using the flip flops to debounce the encoder, not decode its direction, correct? Josh -- = A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. -Douglas Adams -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist