I have a development board with a 3.3V device, that does not provide any 5V pins. I want to interface this over a PS/2 interface.
This is annoying, since PS/2 officially requires 5V. However, I read many reports of people who were able to interface with keyboards over 3.3V PS/2. Unfortunately I am not one of them; Of my 7 keyboards, there are only two that will even work over PS/2 with 5V.
So, I am considering my options. I think they are
1. Try to find a keyboard with supports 3.3V PS/2. However, I can't find any information on this.
2. Somehow get 5V from somewhere
a) The development board has a 5V trace. However, I'd rather not solder on my devboard.
b) Make a PCB that has a step-up converter. However, this seems overkill for a keyboard.
My questions;
I) Are there any keyboards (and while we're at it, maybe mouses as well?) that are known to work over 3.3V PS/2?
II) Did I miss any options to make my device talk to a keyboard?
3.3V device with PS/2 interface
- Muirium
- µ
- Location: Edinburgh, Scotland
- Main keyboard: HHKB Type-S with Bluetooth by Hasu
- Main mouse: Apple Magic Mouse
- Favorite switch: Gotta Try 'Em All
- DT Pro Member: µ
Thanks for itemising your questions. Here's what I know:
1. There are some, I gather. Perhaps even most? I recall discussing this (with Soarer or Hasu?) long ago, when considering something related. I have not looked into this, though. Should be easy enough to test, if you have a Pro Micro handy to breadboard up a PS/2 to USB converter.
2. Somewhere like a 5 volt battery. Or perhaps…
a. Ah, you have a 5 volt output you can tap?
b. If you're really uneasy about soldering directly to your devboard, then this could be a nice safe way to go.
I. I don't know of such a list. I would, however, consider testing a few. 3.3v shouldn't harm any PS/2 keyboard.
II. What is your device, anyway?
1. There are some, I gather. Perhaps even most? I recall discussing this (with Soarer or Hasu?) long ago, when considering something related. I have not looked into this, though. Should be easy enough to test, if you have a Pro Micro handy to breadboard up a PS/2 to USB converter.
2. Somewhere like a 5 volt battery. Or perhaps…
a. Ah, you have a 5 volt output you can tap?
b. If you're really uneasy about soldering directly to your devboard, then this could be a nice safe way to go.
I. I don't know of such a list. I would, however, consider testing a few. 3.3v shouldn't harm any PS/2 keyboard.
II. What is your device, anyway?
-
- Location: Netherlands
- DT Pro Member: -
> Thanks for itemising your questions.
Same to you
I. I don't know of such a list. I would, however, consider testing a few. 3.3v shouldn't harm any PS/2 keyboard.
I have tested a few! I have an old IBM Spacesaver II and a cheap Trust one -- both work over PS/2 with 5v, but not with 3.3 volt. It seems that mostly the cheap/old keyboards have PS/2 support, for some reason.
I am considering buying some cheap keyboards to see if they work, but it feels a bit like a waste of money. I have no idea what the chances are that I get lucky.
II. What is your device, anyway?
It's a Spartan-6 on a Mimas v2 development board.
Same to you
I. I don't know of such a list. I would, however, consider testing a few. 3.3v shouldn't harm any PS/2 keyboard.
I have tested a few! I have an old IBM Spacesaver II and a cheap Trust one -- both work over PS/2 with 5v, but not with 3.3 volt. It seems that mostly the cheap/old keyboards have PS/2 support, for some reason.
I am considering buying some cheap keyboards to see if they work, but it feels a bit like a waste of money. I have no idea what the chances are that I get lucky.
II. What is your device, anyway?
It's a Spartan-6 on a Mimas v2 development board.
-
- Location: Stockholm, Sweden
- DT Pro Member: 0011
Ah, so you want to interface the PS/2 port from the FPGA?
From a quick search, I learned that the board has a PIC24 MCU connected to a USB port for programming the device from a PC and that (at least some) PIC24 are capable of being a USB host. But getting it running as one would be easier said than done. Is the MCU on this board even programmable, and would you not risk overwriting the capability of programming the FPGA from it?
From a quick search, I learned that the board has a PIC24 MCU connected to a USB port for programming the device from a PC and that (at least some) PIC24 are capable of being a USB host. But getting it running as one would be easier said than done. Is the MCU on this board even programmable, and would you not risk overwriting the capability of programming the FPGA from it?
-
- Location: Netherlands
- DT Pro Member: -
I don't know if it *can* be done, but I'm pretty sure the MCU is not intended to be re-programmed on this board. My understanding is that it plays a role when you program the FPGA over USB (and potentially also in the initialization sequence on startup, but I'm not sure about this). It's not like one of those boards where you have a processor and an FPGA on the same board and you can use the FPGA to enhance the processing in one way or another, the devboard is purely for development on the FPGA.
-
- Location: Norfolk, United Kingdom
- Main keyboard: Microsoft Comfort Curve 2000
- Main mouse: Logitech cordless
- Favorite switch: Buckling Spring
- DT Pro Member: -
If you're powering your board through the barrel connector, one option is to use a splitter to tap +5v at that point. I presume you're using a PS/2 PMOD or suchlike, which I further presume you'd have to modify.
If you do go down that route, be aware that if the keyboard you're using has pullup resistors and you're feeding it a 5v VCC, then the CLK and Data pins could end up above the maximum safe input voltage for your FPGA, so you should probably diode clamp them [1]. (assuming your PMOD doesn't already do this.)
There are certainly PS/2 keyboards that will work at 3.3v - but as you say there isn't any kind of definitive list. As a general rule the newer the keyboard the more likely it is to work at reduced voltage, but the less likely it is to support PS/2 at all. (Interesting data point: as recently as two years ago you could buy a brand new keyboard from WASDKeys with PS/2 support - by requesting V2.5 firmware. [2])
Another option might be to get the FPGA talking USB directly - there's some source on github for doing just that [3] - and while I haven't tried it myself, I know of people who have used it successfully.
[1] The user manual for the old DE1 dev board might be a useful reference - see page 42 of the Getting Started User Manual at https://www.terasic.com.tw/cgi-bin/page ... 3&PartNo=4
[2] https://espenskogblog.wordpress.com/202 ... iga-style/
[3] https://github.com/TheSonders/USBKeyboard
If you do go down that route, be aware that if the keyboard you're using has pullup resistors and you're feeding it a 5v VCC, then the CLK and Data pins could end up above the maximum safe input voltage for your FPGA, so you should probably diode clamp them [1]. (assuming your PMOD doesn't already do this.)
There are certainly PS/2 keyboards that will work at 3.3v - but as you say there isn't any kind of definitive list. As a general rule the newer the keyboard the more likely it is to work at reduced voltage, but the less likely it is to support PS/2 at all. (Interesting data point: as recently as two years ago you could buy a brand new keyboard from WASDKeys with PS/2 support - by requesting V2.5 firmware. [2])
Another option might be to get the FPGA talking USB directly - there's some source on github for doing just that [3] - and while I haven't tried it myself, I know of people who have used it successfully.
[1] The user manual for the old DE1 dev board might be a useful reference - see page 42 of the Getting Started User Manual at https://www.terasic.com.tw/cgi-bin/page ... 3&PartNo=4
[2] https://espenskogblog.wordpress.com/202 ... iga-style/
[3] https://github.com/TheSonders/USBKeyboard
- DMA
- Location: Seattle, US
- Main keyboard: T420
- Main mouse: Trackpoint
- Favorite switch: beamspring
- DT Pro Member: NaN
- Contact:
Yeah, you have +5V on the mimas v2 board, you can use that to power the keyboard.
And since both clock and data are driven by the keyboard, you can just make resistive dividers to limit the voltage - like, "[keyboard pin] - [10k] [FPGA pin] - [15k] - GND" - this will give you +3V on the FPGA pin (however, if your keyboard does _not_ have pullup resistors, things just won't work (but won't fry your dev board either). If there are no pullup resistors in the keyboard - connect FPGA pins directly to PS/2 clock and data, and the other end of 10k resistor to +5V).
And since both clock and data are driven by the keyboard, you can just make resistive dividers to limit the voltage - like, "[keyboard pin] - [10k] [FPGA pin] - [15k] - GND" - this will give you +3V on the FPGA pin (however, if your keyboard does _not_ have pullup resistors, things just won't work (but won't fry your dev board either). If there are no pullup resistors in the keyboard - connect FPGA pins directly to PS/2 clock and data, and the other end of 10k resistor to +5V).
-
- Location: Netherlands
- DT Pro Member: -
Small update: I've bought 5 cheap keyboards. I hoped at least one of them would support PS/2 when powered by 3.3V. However, all of them support PS/2 at 5V, but none of them support it when I power them at 3.3V...
I will need to find another solution.
I will need to find another solution.
-
- Location: Netherlands
- DT Pro Member: -
After my initial disappointment, I thought about my options.
Speaking USB would be the proper solution, also since it would open the gate to communicating to many other devices. However, I am not a hardware engineer and haven't programmed USB devices before. I have the impression that USB is complex enough that going this way would delay my project indefinitely.
For now I am going to remove the jumper and use jumper cables to hook it up to a breadboard with a PS/2 connector. This is not ideal since I want to port the design to other development boards and not all of them have a 5V available. So I consider this a development/testing setup.
Meanwhile I figured we probably have a bunch of old/spare keyboards at work. I will try feeding a bunch of them 3.3V and see if any of them work.
Speaking USB would be the proper solution, also since it would open the gate to communicating to many other devices. However, I am not a hardware engineer and haven't programmed USB devices before. I have the impression that USB is complex enough that going this way would delay my project indefinitely.
For now I am going to remove the jumper and use jumper cables to hook it up to a breadboard with a PS/2 connector. This is not ideal since I want to port the design to other development boards and not all of them have a 5V available. So I consider this a development/testing setup.
Meanwhile I figured we probably have a bunch of old/spare keyboards at work. I will try feeding a bunch of them 3.3V and see if any of them work.