Kelly Kohls wrote: >>I don't need speed in this particular application, as each bit is >>held for 1ms, but I'd be interested in a quicker method for future > > reference > > How about this... Hi Jinx/Kelly, Unrolled manchester encoding, also untested. ;--------------------------------------- ;Manchester encoding ; Input: W ; Output: manch_hi:manch_lo ; Cycles: 20 cycles ; by: Regulus Berdin (untested) manch_encode: movwf temp ;save to temp movlw B'01010101' ;assume all bits are 0 movwf manch_lo movwf manch_hi movlw B'00000011' ;setup invert mask btfsc temp,0 ;test bit 0 xorwf manch_lo,f ; invert code if 1 btfsc temp,4 ;test bit 4 xorwf manch_hi,f ; invert code if 1 movlw B'00001100' ;same as above, repeated 3 times btfsc temp,1 xorwf manch_lo,f btfsc temp,5 xorwf manch_hi,f movlw B'00110000' btfsc temp,2 xorwf manch_lo,f btfsc temp,6 xorwf manch_hi,f movlw B'11000000' btfsc temp,3 xorwf manch_lo,f btfsc temp,7 xorwf manch_hi,f return regards, Reggie http://www.microelektronics.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist