Connecting ps/2 keyboard to 3.3 volt fpga - Page 1
Forum section: electronics / projects

author: rubenvann
author_rank: Newbie
timestamp: August 02, 2016, 04:31:29 pm
content: I have a 3.3V FPGA, and I want to connect a PS/2 port to the GPIO. However, the keyboard needs 5.0 volt and 0.50 mA.I tried hooking it up to the GPIO directly, but the keyboard doesn't do anything (it works when I use a PS/2 to USB adapter to connect it to a PC). I might have the pins configured incorrectly, but I don't think I have. (However, the pinout of the PS/2 thing doesn't allow me to hook it up to the VCC and GND pins on the GPIO, so instead I do ps2_vcc_pin <= '1'; ps2_gnd_pin <= '1'; in my VHDL code, which some sources say is fine but I still want to mention it)As a test, I destroyed an old mobile phone charger which outputs 5.0V and tried attaching it to the ground and vcc pins on the ps/2. I figured that at least numlock should light up, but it didn't. I don't understand why, as this are, as far as I understand, the only pins that are inputs for the keyboard (or can the unconnected pins make some difference?).What is the easiest way to use the keyboard with my FPGA? There are some answers online, but they mainly suggest using a voltage divider while I can't figure out where the vcc and gnd should come from. I assumed they should be just 5 volt if 3.3 is not enough, but this doesn't seem to work.

author: MosherIV
author_rank: Super Contributor
timestamp: August 02, 2016, 04:37:32 pm
content: QuoteNormally the numlock lights up because the PC has told it to via a PS2 command.QuotePS2 is 5V, so you are going to have to provide a 5V supply to the keyboard.The signals can be put through a logic level converter between the keyboard and your 3.3V FPGA.

author: Someone
author_rank: Super Contributor
timestamp: August 03, 2016, 12:08:01 am
content: Be careful about the input specifications but the easiest solution would be digilents example:https://reference.digilentinc.com/_media/basys2:basys2_sch.pdf

author: macgeorge
author_rank: Newbie
timestamp: August 03, 2016, 08:34:06 am
content: Although the PS/2 protocol requires 5V, I have used two PS/2 keyboards of different manufacturers powered by 3.3V of my Terasic DE0 nano SoC board and they worked fine (in order to avoid the mandatory input protection when using 5V peripherals). I don't remember the first keyboard's model, the second one was a Logitech Internet 350 keyboard.As MosherIV suggested, the keyboard LEDs light using a PS/2 command, however I have noticed that the LEDs on my keyboards switch on momentarily when the keyboard is powered on by 3.3V (similar to when the computer boots).

author: stj
author_rank: Super Contributor
timestamp: August 05, 2016, 02:13:18 pm
content: open the keyboard and see what wires it uses.early ps2 keyboards&mice had an external reset signal - newer ones left it out of the design.

author: stj
author_rank: Super Contributor
timestamp: August 05, 2016, 05:51:33 pm
content: the shell is connected to braid in the cable for shielding - it's GND / 0vother than that, you should have VCC, clock and data.and maybe reset - on old stuff.most modern keyboard and mouse controllers are duel protocol and can also "speak" USB btw.

author: edavid
author_rank: Super Contributor
timestamp: August 05, 2016, 07:35:43 pm
content: Quote from: rubenvann on August 02, 2016, 04:31:29 pmNote, 0.50mA is not correct. A PS/2 keyboard can draw up to 275mA. Although a modern one will use less current, don't try to power it from a port pin.

author: stj
author_rank: Super Contributor
timestamp: August 06, 2016, 12:18:06 am
content: that should have been obvious, the 3 led's will need 5-20ma each

author: Kilrah
author_rank: Unknown
timestamp: August 06, 2016, 09:00:41 am
content: The fact that any device that needs power needs to get power from an appropriate power rail is obvious enough not to usually be specifically mentioned?

author: Kilrah
author_rank: Unknown
timestamp: August 06, 2016, 04:37:36 pm
content: Quote from: rubenvann on August 06, 2016, 09:26:33 amYeah but that would be in the range of 0.1V less with a significant load... you definitely got a dud.

author: Kilrah
author_rank: Unknown
timestamp: August 07, 2016, 04:26:38 pm
content: These old things were typically unregulated, the charge controller was in the phone. Yes the rating is misleading. Use something with an USB output, that's pretty sure of being 5V... but still check it just in case.