Little Keyboard question. (PS2 or USB, which ever is best)

Well I am still waiting for the transistors for my matrix but I have gone back to another project to make it better.

My other project was a little project which was when you called a number it flicked a relay and turned on my computer and opened all the servers. I needed to use remote connection the other day and I found out that you need a password to be able to do that... (O edit the registry ;) but I love electronics!). So now I was going to create a password e.g. 123 and then get the pick to activate a transistor on a keyboard.

After taking apart my keyboard I found out it uses plastic, this is where I started knowing this may be a little hard to do. SO I have been following the tracks for each number. It has been going well and I have successfully done the first two letters. But when it came to the next key for some reason I am getting really confused because it isn't doing anything! I could just change the password but then, that isn't the point.

I then remembered seeing a section in the manual about interfacing a keyboard with a pic... But here is the question, can I send a signal to the computer with a picaxe?

I haven't seen any circuit diagrams and the keys are o l I b a e s n (mixed up because I use it for many accounts :p) But can I do this? :) Thanks to all!
 

eclectic

Moderator
I'm not sure about your question, to say the least :)
but,
have a look at

Manual 2 p. 131-133

and Manual 3 p.43-46

e
 
Sorry if that sounded confusing. The question is. Can i send an output from a keyboard to a ps2 interface (computer keyboard on a pic) an example type code:

main:
if pin 1 = 1 then goto typekeys


typekeys:
send ("123")
goto main
 

eclectic

Moderator
Sorry if that sounded confusing. The question is. Can i send an output from a keyboard to a ps2 interface (computer keyboard on a pic) an example type code:

main:
if pin 1 = 1 then goto typekeys


typekeys:
send ("123")
goto main
Have you read,
and then tried
ALL of the reference pages in post #2?
e
 

nick12ab

Senior Member
Yes, they were all good, but they tell me how to interface a computer keyboard with a pic. I want to emulate a keyboard with a pic. Thanks
This one:
Manual 3 p.43-46
shows you how to interface the PICAXE with a PC. You could write a program to receive the serial data then press the keys in the same way as the Windows On Screen Keyboard does.

Regarding your original intention, a Google search shows that it's possible on Arduino, however I haven't personally tried converting its PS/2 library for PICAXE use. The problem with Google is that all punctuation and symbols are taken out so you get lots of results on interfacing playstation 2 controllers.

Maybe: http://www.brightsparks.org.nz/the-forum/bb-our-main-discussion-forum-come-in-here/picaxe-and-ps2-keyboard/
Also: http://www.picaxeforum.co.uk/showthread.php?15253-Picaxe-Ps-2-keyboard
Also: http://www.picaxeforum.co.uk/showthread.php?14191-kbout-command
Also: http://forum.allaboutcircuits.com/showthread.php?t=35620
 
Last edited:
I now see why it might be a little difficult...

It is for the login part of windows (when you start it up) I just want it to press 12345678 then enter. :/ I suppose I could see if any friends have an old keyboard. Or I might just for the easier option. SO there is no possible way of emulating a keyboard with a picaxe stand alone? All the other posts say how it would be hard and how it might not keep up but there isn't a defiant answer. Thank you for your time. Much appreciated!
 

BeanieBots

Moderator
I don't think it is possible for a PICAXE to send data that will emulate a keyboard but you could use analogue switches (eg 4066 or similar) to "press" the keys of a real keyboard.
 
:)

I now see why it might be a little difficult...

It is for the login part of windows (when you start it up) I just want it to press 12345678 then enter. :/ I suppose I could see if any friends have an old keyboard. Or I might just for the easier option. SO there is no possible way of emulating a keyboard with a picaxe stand alone? All the other posts say how it would be hard and how it might not keep up but there isn't a defiant answer. Thank you for your time. Much appreciated!
 
OK, have my answer, yea I have been doing that this evening with an 'alright' keyboard. (as santa is coming with a G510 ;)). i will ask around for an old ps2. or even just finish the project there and disable the password :L
 

MPep

Senior Member
The analogue switch system as proposed by BeabieBots is probably the only way to go.
Keep the encoder IC, and use the switches to create your own custom keyboard interface. Then it doesn't matter if you use PS/2 or USB.
The real problem is the fact that keyboards do not use a simple interface type, rather a matrix which is not easy to emulate.

By all means give it a go, you've got the Xmas holidays to come up with a solution :).
 

westaust55

Moderator
Having done some research on the topic of PS/2 comms in the past, I can advise that a native microcontroller such as a PIC can work on the PS/2 bus but due to the speed of interpreted BASIC such as used with the PICAXE chips the BASIC programme cannot work fast enough to communicate on a PS/2 link/bus.
The PS/2 keyboard input is a BASIC command with is using the native PIC machine code to read fast enough.

Have a read here: http://www.picaxeforum.co.uk/showthread.php?13995-Possibility-of-connecting-PS-2-devices-to-PICAXE-(not-keyboards)
and look at some offerings here: http://www.awce.com/pak11.htm and http://www.awce.com/pak6.htm but they are for reading PS/2 devices.
 

hippy

Ex-Staff (retired)
Emulating a PS/2 keyboard would probably be difficult for a PICAXE so the easier option is to strip a keyboard down, use its controller and fake a key press action as has been suggested. If you change the password to "AAAA<enter>" or similar then that minimises the number of keys you have to fake.
 
Top