Cactus Posted February 8, 2014 Report Share Posted February 8, 2014 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 Link to comment Share on other sites More sharing options...
Cactus Posted February 8, 2014 Author Report Share Posted February 8, 2014 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 Link to comment Share on other sites More sharing options...
Jack Gassett Posted February 8, 2014 Report Share Posted February 8, 2014 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. Link to comment Share on other sites More sharing options...
Cactus Posted February 9, 2014 Author Report Share Posted February 9, 2014 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 Link to comment Share on other sites More sharing options...
Cactus Posted February 9, 2014 Author Report Share Posted February 9, 2014 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 Link to comment Share on other sites More sharing options...
Cactus Posted February 12, 2014 Author Report Share Posted February 12, 2014 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.? Link to comment Share on other sites More sharing options...
alex Posted February 12, 2014 Report Share Posted February 12, 2014 I use this in all my projects http://sweet.ua.pt/~a16360/Pages/PS2Controller.htmIt's a bidirectional controller, meaning that for example when you press caps lock is sends acommand back to the keyboard to light up the led for caps lock. Works well for me. Link to comment Share on other sites More sharing options...
Cactus Posted February 12, 2014 Author Report Share Posted February 12, 2014 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. Link to comment Share on other sites More sharing options...
Cactus Posted February 12, 2014 Author Report Share Posted February 12, 2014 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. Link to comment Share on other sites More sharing options...
hamster Posted February 12, 2014 Report Share Posted February 12, 2014 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. Link to comment Share on other sites More sharing options...
hamster Posted February 12, 2014 Report Share Posted February 12, 2014 Found a reference - http://en.wikipedia.org/wiki/PS/2_port#Conversion_between_PS.2F2_and_USB Link to comment Share on other sites More sharing options...
Cactus Posted February 13, 2014 Author Report Share Posted February 13, 2014 I'll try getting a true PS/2 keyboard and will report back. Link to comment Share on other sites More sharing options...
Cactus Posted February 15, 2014 Author Report Share Posted February 15, 2014 Thank you everyone for your help -- the solution was indeed to get a proper PS/2 keyboard. Now all the test configurations work as expected. Link to comment Share on other sites More sharing options...
hamster Posted February 15, 2014 Report Share Posted February 15, 2014 Great news! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.