Cactus

PS/2 ports on Arcade MegaWing

Recommended Posts

Hi,

 

I'm trying to use the PS/2 port of the Arcade MegaWing using a Papilio One. Before diving into it headfirst, I thought I'd try some off-the-shelf code from someone who actually knows what he's doing, so I found a very simple PS/2 driver at http://soclab.cn.nctu.edu.tw/course/FPGA102/ps2_ctrl.pdf. The attached zipfile is a Xilinx ISE archive of my version of that code. All it tries to do is set LED3 to high after the first key is pressed. LED1 and LED2 are connected directly to the PS/2 Clock and Data ports.

 

Before I even connect my keyboard (a Microsoft Natural 4000 via a USB-to-PS2 dongle) to the FPGA, LED1 and LED2 are already continuously on. After I connect it, both LEDs stay on, and if I press a key, LED3 doesn't turn on. I should also add that there's a LED on the keyboard itself that shows that the keyboard is definitely at least connected to the power pins.

 

What am I doing wrong?

ps2.zip

Share this post


Link to post
Share on other sites

I should probably also add that of course I don't know if LED1 and LED2 really are continuously on, I haven't filmed it with a 32M fps camera :)

Share this post


Link to post
Share on other sites

What is your goal here. Is it to learn VHDL? If not then this is much easier to do with the ZPUino soft processor. There are easy to use arduino libraries already.

Share this post


Link to post
Share on other sites

My goal is 100% learning VHDL and building stuff from first principles.

 

I've meanwhile found a Papilio-oriented tutorial at http://hamsterworks.co.nz/mediawiki/index.php/Papilio_Plus/PS2_Keyboard, which I tried to port over to the Papilio One by replacing the UCF file with the attached one. However, it also seems to have the same behaviour: pressing keys doesn't seem to result in any change to the LEDs.

keyboard-ucf.zip

Share this post


Link to post
Share on other sites

I have now also tried https://github.com/thelonious/ps2_io/tree/master/keyboard_scan_code again with a slight change that should light up LED<0> on the first successful keyscan (see attached), and that doesn't work either.

 

Does anyone have a full .bit file I can use to just smoke-test the Arcade PS/2 ports? I'm starting to think  the hw or the USB dongle might be at fault here.

keyboard_scan_code.zip

Share this post


Link to post
Share on other sites

I've added this question to Electronics.SE: http://electronics.stackexchange.com/questions/99277/using-the-ps-2-port-of-the-papilio-one-fpga-from-vhdl

 

Does someone have a ready-made .bit file I could upload to a Papilio One + Arcade megawing and smoke-test the PS/2 connectors? Something that flashes the LEDs when keys are pressed on an attached keyboard, etc.?

Share this post


Link to post
Share on other sites

I have now also tried the code from http://ec2-122-248-210-243.ap-southeast-1.compute.amazonaws.com/mediawiki/index.php/Papilio_S6/Keyboard_Joystick, by connecting joy_up directly to one of the LEDs. If I understand correctly, that should result in the LED lighting up as long as I am pushing the left cursor key on the keyboard, right? Still doesn't work.

Share this post


Link to post
Share on other sites

Alex: Thanks! Can you maybe send me a bitfile for testing? I am now at the point where I'd like to make sure the hardware (incl. the usb -> ps2 dongle!) is working before looking at anything else.

Share this post


Link to post
Share on other sites

My understanding is that the USB PS/2  adapter is completely passive - the controller in an "dual interface" keyboard senses what it is connected to and works approprately.

 

However, I wouldn't be surprised if more recent keyboards have completely dropped the ability to use the PS/2 interface... maybe go to a "recycle shop" (aka "where stuff that is too good for the landfill ends up") and see if you can get a true PS/2 keyboard.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now