Jųan
- 20th December 2007, 12:14
Greetings chaps,
Yes I have read previous threads on this subject, yes I have tried numerous codes. However, Im really missing something coz the code below only seems to work on laptops. As far as I can see, there aint any difference between PC and laptop PS2. I am using a PIC16F876A @ 20MHZ and 10k pullups connected to SCL SDA lines to PS2. Ultiblade has been kind enough to share his code with me, however, only seems to work on a laptop. Gaaah, this is really bugging me. If anyone can provide some pointers, would be much appreciated.
Ive tried sending the packet in different ways, as suggested by
http://www.picbasic.co.uk/forum/showthread.php?t=7071&highlight=keyboard+question
http://www.picbasic.co.uk/forum/showthread.php?t=81
I have spent waaay too many days on this project without success, now I would really like somebody to give me a bit of a steer. Many thanks in advance.
Regards
Juan (what am I doing wrong ??)
------------------------------------------------------------
@ DEVICE HS_OSC,LVP_OFF,BOD_OFF,WDT_OFF 'Sets fuse values on PIC
INCLUDE "modedefs.bas"
DEFINE SHIFT_PAUSEUS 50
DEFINE OSC 20
ADCON1 = 7
CMCON = 7
char var word
breakcode var word
clkout1 var portc.3
dataout1 var portc.4
a_key con %00001110001 '$1C = 'a'
h_key con %00011001111 '
space_key con %00010100101
esc_key con %00111011001
F3_key con %00000010001
redLed var portb.4
relay1 var portb.5
breakcode = %01111000011 '$F0
'a_key con %10001110000 ' $1C = 'a' reverse order
'breakcode = %11000011110 '$F0 reverse order
char = a_key
high relay1
high redled
miniLoop:
high clkout1
high dataout1
high redled
pause 500
shiftout dataout1,clkout1,4,[char\11]
pauseus 100
shiftout dataout1,clkout1,4,[breakcode\11,char\11]
' pauseus 100
' shiftout dataout1,clkout1,5,[char\11]
low redled
pause 500
goto miniloop
--------------------------------------------------------------------------------
Yes I have read previous threads on this subject, yes I have tried numerous codes. However, Im really missing something coz the code below only seems to work on laptops. As far as I can see, there aint any difference between PC and laptop PS2. I am using a PIC16F876A @ 20MHZ and 10k pullups connected to SCL SDA lines to PS2. Ultiblade has been kind enough to share his code with me, however, only seems to work on a laptop. Gaaah, this is really bugging me. If anyone can provide some pointers, would be much appreciated.
Ive tried sending the packet in different ways, as suggested by
http://www.picbasic.co.uk/forum/showthread.php?t=7071&highlight=keyboard+question
http://www.picbasic.co.uk/forum/showthread.php?t=81
I have spent waaay too many days on this project without success, now I would really like somebody to give me a bit of a steer. Many thanks in advance.
Regards
Juan (what am I doing wrong ??)
------------------------------------------------------------
@ DEVICE HS_OSC,LVP_OFF,BOD_OFF,WDT_OFF 'Sets fuse values on PIC
INCLUDE "modedefs.bas"
DEFINE SHIFT_PAUSEUS 50
DEFINE OSC 20
ADCON1 = 7
CMCON = 7
char var word
breakcode var word
clkout1 var portc.3
dataout1 var portc.4
a_key con %00001110001 '$1C = 'a'
h_key con %00011001111 '
space_key con %00010100101
esc_key con %00111011001
F3_key con %00000010001
redLed var portb.4
relay1 var portb.5
breakcode = %01111000011 '$F0
'a_key con %10001110000 ' $1C = 'a' reverse order
'breakcode = %11000011110 '$F0 reverse order
char = a_key
high relay1
high redled
miniLoop:
high clkout1
high dataout1
high redled
pause 500
shiftout dataout1,clkout1,4,[char\11]
pauseus 100
shiftout dataout1,clkout1,4,[breakcode\11,char\11]
' pauseus 100
' shiftout dataout1,clkout1,5,[char\11]
low redled
pause 500
goto miniloop
--------------------------------------------------------------------------------