As noted in Post #2, to get a key to be read by a PS/2 port, you have to send a MAKE and a BREAK scan code.
Looking at your code, I only see 8 data bits, some timing, etc. being sent.
Sayzer gave you good code to work with, but that's only half the battle.
And besides, shiftout should work just fine, as long as you send the right codes (see first line of this post)...
Also, you can shorten that up by quite a bit: (yes, here I go with my colons again!)
Code:device 16f877a input portb.1:input portb.0:input portd.2:stopbit var bit:startbit var bit parity var bit:temp var byte:dattime var byte:clktime var byte tempbit var bit:stopbit=1:startbit=0:parity=0:Temp=$15:DatTime=10 ClkTime=50 main: if portd.2=0 then main output portb.1:output portb.0:tempbit=startbit:gosub sendbit:tempbit=temp.0 gosub sendbit:tempbit=temp.1:gosub sendbit:tempbit=temp.2:gosub sendbit tempbit=temp.3:gosub sendbit:tempbit=temp.4:gosub sendbit:tempbit=temp.5 gosub sendbit:tempbit=temp.6:gosub sendbit:tempbit=temp.7:gosub sendbit tempbit=parity:gosub sendbit:tempbit=stopbit:gosub sendbit INPUT portb.1:INPUT portb.0:goto main sendbit: portb.1=1:pauseus dattime:portb.0=tempbit:pauseus dattime:portb.1=0 pauseus clktime:return END




Bookmarks