During the afternoon I decided to play a bit with my FPGA development board. It has a PS/2 connector and I tried to make a PS/2 controller (using VHDL) that is able to receive PS/2 packets. I have no electrical engineering background, so what I did might just be plain wrong. But I had fun and the design seems simple and clean to me. Feedback is of course welcome!
For now, I just interfaced with a keyboard. My PS/2 controller waits for the start bit, then starts reading the bits (and calculates the parity in parallel). It uses the clock generated by the keyboard to do this. When the byte is received and the parity is correct, a signal is sent to inform another process that the data is available. This process runs using a 27Mhz oscillator and waits for the data to settle before it makes it available.
Of course it is not finished yet. It can’t send commands to the keyboard yet, in order to do this I first have to learn a bit more about tri-states. I haven’t tried connecting a mouse yet. I will do this too and figure out how this works in detail. When everything works, I will make my VHDL code available. Can someone suggest a good license for VHDL code? I will use the GPLv3, unless someone can suggest something that is more appropriate for hardware. Of course I can already show you the schematic of what I currently have:
This development board also has VGA output (I implemented something for this already), DRAM, SD interface, RS232, USB, sound, buttons, a 7 segment display (got it working, this one requires scanning) and it has TV output! So it can be used to develop multimedia stuff like MPEG-2, MP3, MJPEG or so. It would be neat to write a decoder or encoder some day. But my idea is to create my own gameboy some day. Although I can not promise I will actually come to this.