Using a USB keyboard

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
Post Reply
User avatar
Dave
Posts: 8
Joined: 27 Mar 2020, 19:11

Using a USB keyboard

Post by Dave » 03 Apr 2020, 12:02

I tried to connect a Verbatim 99201 USB keyboard to the Gigatron via Pluggy McPlugface and a PS2-to-USB adapter. The keyboard, which worked fine on my Raspberry Pi, had trouble connecting to the Gigatron. Sometimes it would start working almost immediately (in less than 10 seconds), sometimes it would take 20-50 seconds, but most of the time it wouldn't work at all.

Apart from the keyboard, the Gigatron was working --- the blinkenlights were flashing and the VGA display was fine. The Gigatron would work with the game controller but not with the USB keyboard.

The Pluggy McPlugface manual says that “We have heard success stories of people using a USB keyboard with a converter from USB to PS/2. Whether this works depends on both the converter and the adapter”. It goes on to say “If your keyboard is not working, possible problems are the keyboard or the power. Try another power supply or USB cable. If that doesn’t work, try another keyboard if you can. Also, it might take up to a minute for the keyboard to initialize”.

The power supply I used with the Gigatron was rated at 5V and 3A. The Gigatron, with Pluggy McPlugface and the keyboard was drawing between 90 and 100 mA and the voltage was steady at 5.04V. That gave me confidence that the power supply wasn't the problem.

The game controller worked perfectly every time, so that I had some confidence that Pluggy McPlugface was working. (I ordered a second Pluggy McPlugface just in case, but it hasn't arrived yet).

I was using a green PS2-to-USB adapter. Because the green adapters are intended for use with a mouse, I was concerned that it might not be wired to permit it to work with a keyboard; PS2-to-USB adapters for keyboards are purple in colour. I had read on the Internet that the green and purple adapters were wired differently, but that turned out not to be true.

I tried a purple (keyboard) adapter but the problem remained. I traced how the green (mouse) and purple (keyboard) adapters were wired and found that the adapters are electrically identical; they differ only in colour and markings.

This image provides information about PS/2 and USB connectors and how the PS2-to-USB adapters are wired.
USB-to-PS2 adapter.jpg
USB-to-PS2 adapter.jpg (134.84 KiB) Viewed 3747 times
I sourced a PS2 keyboard (a Perixx Periboard-409) from Amazon. It worked perfectly as soon as I connected it.

There was very little technical information about the Verbatim 99201 keyboard on Verbatim's website and nothing at all about using it with a PS2 adapter. Rather than tear apart the Verbatim 99201 USB keyboard to investigate why it wasn’t working reliably via PS2, I just decided to use the new PS2 keyboard.

walter
Site Admin
Posts: 91
Joined: 13 May 2018, 08:00

Re: Using a USB keyboard

Post by walter » 03 Apr 2020, 14:55

From https://en.wikipedia.org/wiki/PS/2_port ... us_and_USB:
Conversion between PS/2 and USB

Many keyboards and mice were specifically designed to support both the USB and the PS/2 interfaces and protocols, selecting the appropriate connection type at power-on. Such devices are generally equipped with a USB connector and ship with a passive wiring adapter to allow connection to a PS/2 port. Such passive adapters are not standardized and may therefore be specific to the device they came with. They cannot be used to adapt other devices to PS/2 ports.[citation needed] While combi-devices supporting USB and PS/2 are still available, most USB keyboards and mice in the 2010s no longer come with adapters or even support the PS/2 protocol. Connecting them to a PS/2 port would require a protocol converter, actively translating between the protocols. Such adapters only support certain classes of USB devices such as keyboards and mice, but are not model- or vendor-specific.

Older PS/2-only peripherals can be connected to a USB port via an active converter, which generally provides a pair of PS/2 ports (which may be designated as one keyboard and one mouse, even though both ports may support both protocols) at the cost of one USB port on the host computer.
So when you have a passive converter, it won't work with all (i.e. more modern) keyboards it seems. I wouldn't know how to tell active and passive adapters apart though. (A rule of thumb might be: if it's really just a plug, it's probably passive.)

User avatar
marcelk
Posts: 490
Joined: 13 May 2018, 08:26

Re: Using a USB keyboard

Post by marcelk » 03 Apr 2020, 15:31

Dave wrote:
03 Apr 2020, 12:02
I sourced a PS2 keyboard (a Perixx Periboard-409) from Amazon. It worked perfectly as soon as I connected it.
I spent several hours banging life into Walter's PERIBOARD-409. It wouldn't boot most of the time. I must have booted it 200 times while recording the boot times and conditions.

That's when we discovered that "difficult" keyboards can be dragged through their boot process by repeatedly sending 'Enable' commands. So Pluggy McPlugface does that. And that's where we also discovered that a small voltage drop can cause slow boots. We mitigated that by switching to thicker USB cables for power. This was almost 2 years ago.

Still, I feel we haven't reached full understanding on what's actually happening.

monsonite
Posts: 76
Joined: 17 May 2018, 07:17

Re: Using a USB keyboard

Post by monsonite » 03 Apr 2020, 21:41

Hi Dave,

Are you perhaps using one of those USB digital voltage and current meters?

I bought one of them, and found that it dropped a lot of voltage - from 5V to 4.5V IIRC.

If it is in line with the Gigatron supply - try removing it.

That might be part of your problem.


Ken

alastair
Posts: 19
Joined: 10 Oct 2019, 14:28

Re: Using a USB keyboard

Post by alastair » 04 Apr 2020, 14:58

One thing that may be a factor here is the contact resistance. I had a lot of issues with my project due to the large current draw and the contact resistance of the barrel connector. The Gigatron has a much lower current consumption, but there are three contact points between the PSU and keyboard (micro USB, DB9, PS/2).

It's possible the series resistance of the contacts could add up to a few hundred milliohms, so a large transient current draw may drop the supply by a few hundred millivolts. It would be interesting to open up the keyboard case and probe the internal VCC and see what's actually going on.

jbailey
Posts: 27
Joined: 20 Nov 2018, 08:54

Re: Using a USB keyboard

Post by jbailey » 04 Apr 2020, 19:20

I too had a lot of issues with the PluggyMc Plug Face (all three of them). Since the Gigatron's were the only devices I owned that could use as PS/2 keyboard I purchased a cheap keyboard. I found it would take 30-40 seconds before it would "initialize" and work, and occasionally it just wouldn't start up at all. I had random results using a "PS/2 to USB" dongle with a Dell keyboard.

I found a keyboard that always worked for me with both the Pluggy McPlug Faces and the Pluggy Reloaded, its the "Logitech PS/2 Classic Keyboard K100" (of course you may experience may be something different).

So I disassembled both the other keyboards and found they used cheap cables which leads to noticeable DC resistance, which in turn cased a voltage drop.

Their are a few things to think about:

* Ensure you are using a quality USB charger, battery pack and USB cable that is giving you at least 5.0v or 5.1 would be better.
* It's easy to measure the voltage across the Gigtron's power supply diodes leads.
* Check the voltage you are getting at the AT85 across its VCC and ground.
* See if a different PS/2 keyboard will work.
* As others indicated not all USB keyboard have the programming and electronics to work as a PS/2 keyboard using and adapter.

I really thought maybe I overheated the AT85 (during soldering), or statically damaged the device leading it to work intermittently. Maybe I had a cold solder joint somewhere leading to intermittent contact or excessive resistance. Once I purchased a quality keyboard, all of the "questionable" Pluggy McPlug Faces I had assembled ALWAYS worked without any issues.

I suspect the issue many people are having is a combination of a cheap keyboard (which has thin copper wires in its cable), and/or insufficient voltage at the AT85. Check your voltage between VCC and Ground on the AT85.

It seems this interface is intolerant of cheap USB cables or keyboards, but if you give it a quality device it works well.

User avatar
Dave
Posts: 8
Joined: 27 Mar 2020, 19:11

Re: Using a USB keyboard

Post by Dave » 06 Apr 2020, 12:08

At first I was just checking the voltage with a DMM. Later I plugged in a USB digital voltage and current meter. That's what I used to measure how many amps were being drawn.

Thanks for the tip. I'll measure the voltage at the Gigatron with the USB meter in place to see if it's dopping voltage.

Dave
monsonite wrote:
03 Apr 2020, 21:41
Hi Dave,

Are you perhaps using one of those USB digital voltage and current meters?

I bought one of them, and found that it dropped a lot of voltage - from 5V to 4.5V IIRC.

If it is in line with the Gigatron supply - try removing it.

That might be part of your problem.


Ken

User avatar
Dave
Posts: 8
Joined: 27 Mar 2020, 19:11

Re: Using a USB keyboard

Post by Dave » 06 Apr 2020, 17:41

Thanks. I hadn't imagined that I would have been getting the benefit of troubleshooting that you'd already done on the keyboard! I'd simply concluded (err, assumed) that I had an unsuitable USB keyboard and that "any" PS2 keyboard must work like a charm! As the old says goes, you know what happens when you assume ...

Obviously, the work that you did on Walter's keyboard addressed the problem since my keyboard hasn't exhibited any issues.
marcelk wrote:
03 Apr 2020, 15:31
Dave wrote:
03 Apr 2020, 12:02
I sourced a PS2 keyboard (a Perixx Periboard-409) from Amazon. It worked perfectly as soon as I connected it.
I spent several hours banging life into Walter's PERIBOARD-409. It wouldn't boot most of the time. I must have booted it 200 times while recording the boot times and conditions.

That's when we discovered that "difficult" keyboards can be dragged through their boot process by repeatedly sending 'Enable' commands. So Pluggy McPlugface does that. And that's where we also discovered that a small voltage drop can cause slow boots. We mitigated that by switching to thicker USB cables for power. This was almost 2 years ago.

Still, I feel we haven't reached full understanding on what's actually happening.

Post Reply