> So, THANKS FOR COMMENTING YOUR CODE! You're quite welcome. Unfortunately I did some additional testing at home,= =20 and it turned out that there WAS a bug in my code. It turns out that the=20 PS/2 keyboard sends a "start" bit, which my code did not remove. I therefor= e=20 recommend either adding code to check this start bit (better way), or=20 increasing the number of bits in a keyboard byte to 9:=20 > getKeyboard > > ; movlw 0x08 ; Eight bits to a keyboard byte -> WRONG! >=20 movlw 0x09 ; Nine bits to a keyboard byte (start bit + 8 bits) > movwf t2 ; Store > > KeyboardNextBit > > btfsc PORTB,0 ; Wait for clock line to change > > goto $-1 > > bsf STATUS,C ; Assume a 1 > > btfss PORTA,6 ; Check the data bit > > bcf STATUS,C ; It wasn't 1, so 0 > > rrf Keyboard,f ; Move the carry into the keyboard > > btfss PORTB,0 ; Wait for the clock line to change > > goto $-1 > > decfsz t2,f ; Get the next bit > > goto KeyboardNextBit > > btfsc PORTB,0 ; Ignore the parity bit > > goto $-1 > > btfss PORTB,0 ; Make sure clock becomes high > > goto $-1 > > return >=20 > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist