geekhack

geekhack Community => Keyboards => Topic started by: ironman31 on Thu, 31 March 2011, 15:21:52

Title: ps/2 driver for school project
Post 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?
Title: ps/2 driver for school project
Post by: ironman31 on Thu, 31 March 2011, 17:23:51
Quote from: ripster;322194
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.
Title: ps/2 driver for school project
Post by: woody on Thu, 31 March 2011, 17:37:12
Maria?
Title: ps/2 driver for school project
Post by: woody on Thu, 31 March 2011, 17:40:49
Maria looks Asian. Luigiana had shrooms.
Title: ps/2 driver for school project
Post by: kps on Fri, 01 April 2011, 09:24:28
What platform? Microcontroller, FPGA, vacuum tubes?
Title: ps/2 driver for school project
Post by: ironman31 on Fri, 01 April 2011, 14:47:58
Fpga
Title: ps/2 driver for school project
Post by: DrunkenDonut on Sat, 02 April 2011, 13:35:26
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.
Title: ps/2 driver for school project
Post by: JohnElliott on Sat, 02 April 2011, 14:49:40
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.
Title: ps/2 driver for school project
Post by: ironman31 on Sat, 02 April 2011, 16:33:16
Quote from: DrunkenDonut;323389
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.
Title: ps/2 driver for school project
Post by: cornsoup on Sun, 03 April 2011, 05:21:32
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.
Title: ps/2 driver for school project
Post by: ironman31 on Sun, 03 April 2011, 09:24:34
Quote from: cornsoup;323654
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. :/
Title: ps/2 driver for school project
Post by: ironman31 on Thu, 21 April 2011, 15:55:48
[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)