miminya.me ~ Arduino USB Bridge

Projects › ez2-io › Arduino USB Bridge

Arduino USB Bridge

Replaces the PC-side ISA card with an ATmega32U4 board that speaks the DB25 protocol and presents a composite USB HID device: a 32-button gamepad with two absolute axes for the turntables, plus a 24-LED output report for the lamps. 2EZConfig V2 binds it without drivers.

The I/O board, cabinet harness, lamps, encoders and on-board MCU are unmodified. Only the ISA card is replaced.

Parts

Qty Part Note
1 Arduino Micro or Leonardo 5 V, ATmega32U4. Uno, Nano and Mega have no native USB and cannot be used
1 DB25 male breakout with screw terminals Mates the board's existing F-F cable
16 220 Ω resistors One in series with every signal wire
— AWG 24 stranded wire, heat-shrink, USB cable and 5 V supply

The 220 Ω series resistors limit current in the event of a wiring conflict or an overvoltage on any line. Without them, a contention between an Arduino output and a board output can draw enough current to reset the Arduino's USB connection.

The I/O board keeps its original 5 V and 12 V feed from the cabinet PSU. The Arduino is USB-powered. Put both supplies on the same switched outlet so they power up together, and do not hot-plug the DB25.

Wiring

Two methods, either sufficient. Doing both is a useful cross-check.

From the schematic. Transcribe J1's pin table from the IKA Victor schematic and map it through the naming table in bus-protocol.md to Arduino pins.

By continuity. With everything unpowered, beep each breakout terminal through to a chip leg and land it per the table below. Count legs with the package notch away from you: leg 1 at top left, down the left side, then up the right.

Probe on Terminal is Arduino pin
Data 245, legs 2–9 D0–D7 2, 3, 4, 5, 6, 7, 8, 9
Control 245, legs 2, 3, 4 A0, A1, A2 10, 11, 12
Control 245, leg 9 Select 13
Control 245, leg 6 Read-range bit A1
Control 245, leg 7 Write-range bit A2
Control 245, leg 8 /WREN A3
Control 245, leg 5 IOGATEDIR A0, held high
Continuity to PSU ground Ground, 2–3 terminals GND
Continuity to nothing A6, not connected Leave unconnected

Put one 220 Ω resistor in series with each signal wire, sleeved. Never put one in a ground wire.

Verify in resistance mode before applying power: roughly 220 Ω end to end on each path, roughly 440 Ω indicates two signal wires crossed, and every signal should read open to ground.

Two hazards worth checking for on clone Arduino boards:

  • Analog header silkscreen is sometimes printed reversed. Confirm pin identity with a blink sketch before trusting the labels.
  • DB25 pin numbering mirrors between the two faces of a connector. Use a breakout with manufacturer-printed numbering, or resolve it against the schematic.

Bring-up order

  1. Pin test with the board disconnected — confirm every pin toggles.
  2. Wire, then verify resistances as above.
  3. Connect cold and power both supplies together.
  4. Self-test — lamp chase, every button, both pedals, coin, both platters.
  5. Turntable test — positions should march in order at all speeds.
  6. Load the HID bridge.

Only ez2_hid_bridge.ino is included in this repository. The self-test and turntable-test sketches referenced above were used during development and are not included.

2EZConfig V2 binding

Buttons. Press the control on the panel and let 2EZConfig capture it.

Button Control
1–10 B1–B10
11, 12 P1 Start, P2 Start
13–16 Effector 1–4
17, 18 P1 Pedal, P2 Pedal
19, 20 Test, Service
21, 22 P1 turntable, forward and reverse
23, 24 P2 turntable, forward and reverse
25 Coin

Axes. X is the P1 turntable, Y the P2 turntable, both absolute 0–255 and wrapping. Buttons 21–24 pulse while the corresponding platter is turning, so either binding style works depending on which your version of 2EZConfig prefers.

Lamps, listed as "LED 1" to "LED 24":

LED Lamp
1–5 P1 buttons 1–5
6 P1 turntable
7–11 P2 buttons 1–5
12 P2 turntable
13, 14 P1 Start, P2 Start
15–18 Effector 1–4
19 Neon
20–23 The four bits of write port 0x100
24 Unused

LEDs 20–23 map to bits 0–3 of port 0x100 in order. Their physical meaning varies between cabinets. On the machine used for this work, LED 21 is the blue left lamp, LED 22 both red lamps in parallel, LED 23 the blue right lamp, and LED 20 is unused. Confirm yours with a chase test.

Implementation notes

The sketch uses no external libraries and builds in a stock Arduino IDE. The following behaviours are deliberate.

  • Atomic bus cycles. Interrupts are disabled for the duration of each read cycle. Without this, inputs become erratic at full scan speed while lamps continue to work correctly.
  • Double-read agreement. A value is accepted only when two consecutive reads match, up to three attempts, otherwise the last known-good value for that port is reused.
  • Board-absent guard. All three button ports reading zero simultaneously is physically impossible, since idle lines are pulled high. It is treated as the board being disconnected or unpowered, and everything is reported idle rather than as a full-panel press.
  • Turntable delta clamp. A platter cannot move more than a few counts per scan; changes beyond ±63 are discarded as residual glitches.

Two Arduino IDE quirks affect edits to this sketch: automatic prototype generation breaks on custom types used in free-function signatures, which is why the HID report structs are file-scope globals; and PIN_A0 through PIN_A3 are reserved macro names.

Troubleshooting

Symptom Cause
Lamps random at power-on and unresponsive Normal power-on latch state. The first successful write clears it
Lamps mirror the buttons after a write The read-range bit was asserted during the write cycle
Writes decode at a decoder output but no latch clocks appear Probing the wrong decoder. The two 74LS138s are identical — identify by function and mark one
Everything reads 0x00, all buttons appear pressed Board unpowered or disconnected, or reads issued without the correct read-range bit
Inputs erratic at full scan speed, lamps correct Transient read glitches. Fixed by atomic cycles and double-read agreement
Arduino USB disconnects when the board is powered Current misbehaviour on the signal wires. The 220 Ω series resistors prevent this
Arduino appears to power up from the DB25 alone Phantom power through the pull-ups and protection diodes. Harmless briefly; power both supplies together
A pin measures dead, or averages around 1.6 V Multimeters cannot follow asymmetric fast strobes. Only slow, even-duty strobes are meter-readable. Reversed silkscreen also causes this by leading you to the wrong pin
An apparent "P2 pedal" behaves like a latch on an undocumented port That is the coin input, which is diode-isolated and MCU-processed. The real P2 pedal is on the keyed 3-pin connector J8
One cabinet lamp silent, two others always flash together Per-cabinet rewiring of the port 0x100 relay channels
Every second coin is ignored Known issue — see the top-level README

This page is synced from docs/arduino-bridge.md in the ez2-io repo.

Updated 18 Oct 2026

9 projects

Display Properties