How can I turn a Keyboard's buttons into switches? (Embedded Sys)

  • Thread starter Thread starter Bizantium
  • Start date Start date
  • Tags Tags
    Switches
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 5K views
Bizantium
Messages
2
Reaction score
0
I'm working on a project in my job, but being only a student in CE and Comp. Sci. I'm limited in knowledge.

I'm looking for a way to communicate with an arcade game, with a standard PS/2 Keyboard. Eliminating the standard joystick and buttons and using a keyboard instead. What would be the best and efficient way into tapping into PS/2 data and clock signals and get them to act as a switch? Where " W " key is UP, S is down, etc etc.

Basically I'm looking for the complete opposite of a Keyboard Encoder, which I imagine would be a Decoder. I've seen some Atmel chips that will do the job but I'm just not sure if there's another more easier way? As of now, what I do is rip the keyboard open and rewire it. This method is time consuming and I know there's something like a Decoder where the ASCII signals can be tapped into with much ease, and I can reprogram them to have them act as switches..

Any insight?
 
Physics news on Phys.org
Yeah the interface is mainly what I'm looking for in this case. I know each key has their own code, and the keyboards vary with their signals and it all gets interpreted by the computer ( our home PC ). But when It comes to embedded systems I can see that things get more complex.

If I am not mistaking each keyboard would have to be programmed differently in this sense if I were to make each key act as a switch. An IBM keyboard would give it's signals from key A, and a Logitech Keyboard ( both PS/2 ) would give off it's own unique signal for letter A?

Or if there's anybody here that can confirm to me logically or by experience that an MCU can can read these signals without having to actually #define them and layout the entire matrix? If so, can a simple If() statement be used to ground a specific unique port for different characters?
 
Bizantium said:
An IBM keyboard would give it's signals from key A, and a Logitech Keyboard ( both PS/2 ) would give off it's own unique signal for letter A?
All PC keyboards use the same scancodes, although some have have more keys and more scan codes than other keyboards. The scancodes for w a s d would be the same for any PC keyboard. Link from the wiki article about interfacing with a PC keyboard:

http://www.beyondlogic.org/keyboard/keybrd.htm
 
Last edited: