On 6/11/2013 11:13 AM, Manu Abraham wrote: > On Tue, Jun 11, 2013 at 8:18 PM, Carl Denk wrote: >> Takes 2 toTango, what about the CPU hardware side? :) >> > Replaced with a new 18F4550 reprogrammed it. Behaviour is exactly the sam= e; > Increments/decrements are in the order of 4. > > I have a Pickit2 connected to PGC/PGD. Thought that could be interfering. > Disconnected the ICSP header and tried again. No change. Same behaviour. > > > Regards, > > Manu Since the enc_tab[] only contains -1,0,+1, the only explanation I can=20 think of would be that you are actually getting 4x the number of=20 interrupts that you think you are. Have you tried setting breakpoints=20 in the interrupt or print_error_code() func to step through the code? =20 Also, what happens when the count goes over 9 or less than 0? You only=20 have 10 digits to print 16 possible values, and count is unsigned. Joe W --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .