geekhack
geekhack Community => Keyboards => Topic started by: ironman31 on Thu, 31 March 2011, 15:21:52
-
I'm working on a project for my Digital Logic class and we are using a ps/2 keyboard as an input device. Anyone have any noteworthy things to look out for while I'm designing the driver? Any past experiences that could help me out?
-
PS/2 is too easy (and obsolete so why bother learning it?).
Do a USB NKRO one.
It's only part of the project. The rest of it has mario jumping around on a screen and custom music playing in the background.
-
Maria?
-
Maria looks Asian. Luigiana had shrooms.
-
What platform? Microcontroller, FPGA, vacuum tubes?
-
Fpga
-
It's not so much a driver, as a state machine. PS/2 protocol is pretty simple but time based. At idle, control/data line is held high, the keyboard sends data by pulling it down in a specific sequence. You just have to decode the down pulses.
You can do with with a state machine as logic w/ clock, or you can use a softcore processor and decode via software state machine. I recommend software on a microcontroller / softcore processor, since a pure hardware-only logic state machine would be crazy for the amount of different things coming from a keyboard.
-
This could be considered cheating, but if you want to see how IBM supported the PS/2 keyboard protocol the disassembly at http://halicery.com/8042/8042_1503033_TXT.htm may be of interest. From 03AE to 03D2, for example, is the bit that reads in a scancode.
-
since a pure hardware-only logic state machine would be crazy for the amount of different things coming from a keyboard.
this is what we have to do. We are coding it in VHDL. Turns out another kid in my group is taking over on this part. Now I just have to figure out Direct Digital Synthesis and make a song up.
-
Huh...I have a FPGA project due too... :S (judging from your location I guess we aren't in the same school...)
However, our teacher gave us some sample PS/2 code to work with.
-
Huh...I have a FPGA project due too... :S (judging from your location I guess we aren't in the same school...)
However, our teacher gave us some sample PS/2 code to work with.
I think ours might do the same later on. He did for every other device and told us to figure out the ps/2 ourselves, but I have a feeling most of the kids in the class won't be able to. He's been a pretty bad teacher the whole semester. :/
-
[video=youtube;DPcHaFWhJJ8]http://www.youtube.com/watch?v=DPcHaFWhJJ8[/video]
This is the final project I was working on. I did all the audio to it, and the other group members did the video portion. This was all done using VHDL in Quartus II. (Might have to turn up the volume to hear the music)