13

I'm considering building some custom gizmos to connect to the gameport on my retro-hobby PC (SNES controller adapter, macro/turbo box, etc.) but I haven't been able to find much information on details such as allowed current limits.

(Just this un-cited mention on the DSLReports forums which claims "The standard operating voltage for a MIDI/Gameport is 5 Volts ± 5% and a current output of 40mA when active and 22mA when in standby.")

Given some of the fancier digital joysticks that didn't require external power supplies, I know it's possible to hang some kind of fancy load off the gameport's 5V lines, but I don't want to gamble that the SoundBlaster 16 I carefully sourced off eBay a few years ago is at least as robust as whatever combination of still-in-production USB-Gameport adapter and Raspberry Pi that I risk for development testing.

On the side of protecting the host PC, I'm hoping to find a solid source for details such as:

  • Maximum safe peak current
  • Maximum safe sustained current
  • The DOs and DON'Ts that digital joysticks stuck to when pinouts like this one list multiple 5V supply lines and specify that each GND line is intended for a specific button.

On the side of protecting the microcontroller, does anyone have any specs on maximum observed current when the buttons are pressed or the X and Y axis lines are at the 0Ω end of their range?

(In case it's relevant, I'm hoping to use those sub-$1 Chinese STM8S boards with Sduino if the numbers check out. 16MHz should be enough to bit-bang things and you can't beat 'em for size or price.)

A citation which also has similar information on PC and PS/2 keyboard ports would be appreciated since I'm also considering building a knock-off of the Dynapoint GameStar.

14

The documentation for IBM's original Game Control Adapter has some details that will be of use. Even though you're using a SoundBlaster card instead, it should still be compatible with the IBM original.

While the documentation doesn't specify maximum currents for any pins, it does have a logic diagram:

Circuit Diagram of IBM Game Control Adapter

It can be seen that on the original gameport, the button inputs are fed to a 74LS244 buffer (via 1Kohm pull-up resistors and 51pF capacitors). The 74LS244's datasheet specifies a maximum low-level output current of 24mA per pin, and high-level output current of -15mA.

The potentiometer (axes) inputs are fed to the timing inputs of an NE558 quad timer (via inline 2.2kohm resistors and .01uF capacitors). Its datasheet lists no details for the current load on these input pins; they're used as RC timing values.

The IBM diagram shows all the grounds (and 5V supplies) connected in common. I suspect the gameport's 5V pins are connected directly to the ISA slot's 5V supply; this could be verified for your card with a continuity test on a multimeter. If this is the case, the maximum current draw permitted for an ISA card may give some further guidance.

6

back in the (x386) days I was using GAME port as an ADC for home made scanner and other self build HW. As it is usual during development there is occasional set back like short circuit etc. The GAME Ports I was using was always GoldStar chip powered IDE/ports ISA card (they where very common) and a short circuit on the analog pins always burn up +5V power line on the PCB (no chip was harmed I know of as by bypassing the burned wire all worked again) so there is no obvious current limit other than the current density of the PCB wires used.

The wires back in the day could safely transfer 0.5A (they usually start burning above 1A) but I would not make a load bigger than 100mA.

However when I looked at the NE558 datasheet (link is in the Kaz's answer) apart of the pinout bug here is equivalent circuit of single timer:

NE558

the timing interval is:

t = R.C

where C = 0.1 uF and R >= 2K2. Considering Vcc = 5V and according to Transistor basics the transistor drop voltage Vce = ~0.2Vthen absolute "safe" maximum current for Timing output (GAMEPORT analog pin) is:

I = (Vcc-Vce) / R = (5-0.2)/2200 = 2.18 mA
tmin = R.C = 2200*0.1/1000000 = 220 us

which sound reasonable considering its the input current for a comparator. After such analysis The short circuit currents I remember are impossible so my GAMEPORT either did have different circuitry or the currents where through different pins (maybe VCC/GND).

Gameport analog pins have 2.18 mA current limit.

beware the load should be passive as the pin drains the current on its own so either Potentiometer or a NPN transistor (collector->Vcc,emitter->GAMEPORT_analog_pin) doing the same job.

However SB16 and or USB adapters might have different circuitry (especially if they include MIDI interface) but 2mA is common value for comparators and amplifiers.

Beware lower currents mean bigger conversion times so you need to find a compromise so your polling reading code does not wait too long and have enough resolution... for example 1 ms:

t = (Rl+R)*C
Rl = (t/C)-R
Rl = (0.001/0.1)*1000000-2200 = 7800 ohm

so if I see it right if your load is 0 .. 7K8 then the conversion will end in 1 ms tops.

Measuring my old Rockfire joystick the x axis has 160K right position zero on left and 68K in the middle (haven't used it for ages so the center position might be shifted) leading to max conversion time t = 16.22 ms

  • 4
    The 100mA is for the NE558 output, not timing input which is what the joystick port analog inputs are connected to. – Justme Sep 1 at 8:40
  • @Justme You're right (+1) I miss read it. After some more in depth examination I found more reliable limit. Have edited the answer. – Spektre Sep 2 at 7:44
  • I don't understand why you assume Vce is 0.6V which causes less current to flow. It would be better to assume Vce of discharge transistor is zero at these current levels and thus more worst case current flows. The difference is not much though, given all tolerances it should still be below 2.5mA per analog input. – Justme Sep 2 at 10:39
  • 1
    I really wish I could give out two "accepted answer" checkmarks because your updated answer and Kaz's answer really feel like two halves of the ideal answer. That said, I had to give it to Kaz for being both the start of the combined answer and the one who found the logic diagram for the original IBM adapter. – ssokolow Sep 2 at 18:13
  • 1
    @Spektre Vbe drop would be about 0.6V in transistors. But this is Vce drop. If the discharge transistor is similar to output transistor, as per the NE558 datasheet, Vce drop would be typically 0.1V at 10mA current, and since the available current at timing pin is below 3mA, the voltage would be well below 0.1V as well. – Justme Sep 2 at 20:11
4

There is no official specs for game port current limit. Some adapters may have resistors, ferrite beads or fuses for current limiting, but usually a short circuit still fries something (except for a polyfuse). I'd say 100mA is a safe limit in any case. The original adapter has 1k pull ups on buttons, so for all four buttons simultaneously pressed, it adds up to 20mA of current from button wires to ground wire. The analog inputs have 2.2k in series so all analog input pots being at 0R extreme position adds up to about 9mA of current from 5V wire to analog input wires.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.