Brian Harris wrote : > I'm using a 18F452 to read a HCTL 2016 quadrature decoder. > I can read the output bytes anytime before overflow with: > > bcf OE ;enable tristate output > bcf SEL ;for high byte > nop > movf portb,w ;data from HTCL 2016 received on portb > movwf d_hi ;store > bsf SEL ;for low byte > nop > movf portb,w ;data from HTCL 2016 received on portb > movwf d_low ;store > bsf OE ;disable tristate output > Just a tought and might not apply to your actual problem... :-) Is there something in the encoder that makes sure that there isn't a change in high/low byte betwen the two reads ? Much like when reading TMR1H/L regs (for which there is a fix in the PIC hardware). > bcf RST ;to reset counter > nop > nop > bsf RST What happens if the encoded moves between the bcf/bsf ? Does it still "count" internaly in some way ? Jan-Erik. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist