At 02:03 PM 02/09/2011, you wrote: >I am not sure if this warrants EE or PIC subject tags, but here goes... > >I am building a hobby gadget around an 18F2321, it is running on >INTOSC+PLL for a 32MHz clock. My main UI element is a quadrature encoded >knob from BI Technologies (data sheet here >http://www.bitechnologies.com/pdfs/en11.pdf). From the datasheet there >appear to be 2 mechanical switches that connect to the common pin to >provide the output. I have grounded the common pin, and the two outputs >are connected directly to the RB0 and RB1 on the PIC. The weak pull ups >are turned on. > >My original idea was to use INT0 as a movement indicator then read PORTB.1 >(a TTL input) to determine direction. While this very accurately >determined rotation, the direction of rotation was very flaky with either >direction providing equally random results. > >My guess at this point are that the switches are bouncing... > >I did some googling to try and determine what I could do to help clean up >the signal. Most everything I have read shows a capacitor in parallel with >the switch, but without an actual value associated (I tried ~15nF without >any success). I have also read that a schmitt trigger will help, so I >switched to using INT1 with a mechanism to use INTEDG1 to store the pin >state, this wasn't much help either. > >I am at a loss to what to try next, and hoping that the smart folks on >this list have some better ideas... > >Anthony Forget using interrupts. Poll it at a few hundred Hz. >Best regards, Spehro Pefhany --"it's the network..." "The Journey is the rewar= d" speff@interlog.com Info for manufacturers: http://www.trexon.co= m Embedded software/hardware/analog Info for designers: http://www.speff.co= m --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .