USB-Gameport dongle

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
Post Reply
Marko
Posts: 8
Joined: 24 May 2018, 19:48

USB-Gameport dongle

Post by Marko »

Afternoon all,

I'll grant it's a little over-engineered, but I've built a USB-Gameport dongle for programming the G.

https://www.thingiverse.com/thing:2965288/files



Marko
at67
Site Admin
Posts: 647
Joined: 14 May 2018, 08:29

Re: USB-Gameport dongle

Post by at67 »

Looks great!

The only thing missing is a pass-through DB9 connector for the controller, (I got sick of continuously unplugging the Arduino and plugging in the controller). So I added a male DB9 connector to my Arduino Nano and a slight mod to BabelFish.ino and now no more stress.
xbx
Posts: 5
Joined: 08 Jun 2018, 18:07

Re: USB-Gameport dongle

Post by xbx »

I've just soldered my wires to the pcb and left the gameport open for the gamepad...
at67
Site Admin
Posts: 647
Joined: 14 May 2018, 08:29

Re: USB-Gameport dongle

Post by at67 »

xbx wrote: 17 Jun 2018, 17:22 I've just soldered my wires to the pcb and left the gameport open for the gamepad...
I assume the Famicon controller's serial data output is open collector? But what about the Arduino, I don't think BabelFish.ino does anything tricky to simulate open collector outputs for SER_DATA?

You might be causing intermittent shorts between the controller and the Arduino, depending on their state; this may eventually cause some unhappiness.
Marko
Posts: 8
Joined: 24 May 2018, 19:48

Re: USB-Gameport dongle

Post by Marko »

Yup, did consider adding another DB9 and may still do. Been wrangling with my printer, as usual :)
Marko
Posts: 8
Joined: 24 May 2018, 19:48

Re: USB-Gameport dongle

Post by Marko »

at67 wrote: 17 Jun 2018, 16:51 Looks great!

The only thing missing is a pass-through DB9 connector for the controller, (I got sick of continuously unplugging the Arduino and plugging in the controller). So I added a male DB9 connector to my Arduino Nano and a slight mod to BabelFish.ino and now no more stress.
Did you wire the controller DB9 straight through to the output? If you hacked BabelFish I guess you're switching it in software somehow?
at67
Site Admin
Posts: 647
Joined: 14 May 2018, 08:29

Re: USB-Gameport dongle

Post by at67 »

Marko wrote: 17 Jun 2018, 19:27 Did you wire the controller DB9 straight through to the output? If you hacked BabelFish I guess you're switching it in software somehow?
Switched in software on the Arduino whenever it's not using the serial port for commands/downloads etc: here's the circuit diagram, (pretty simple) and here's the link to the new BabelFish.ino, (it's only been tested with the Arduino Nano, you need to add a few constants for the other modules and wire pin2 of the new male DB9 to whatever port you choose), in the circuit below I chose (J1-13, D10), which is PORTB2 on the Nano.

If you search for 'hasController' in 'BabelFish.ino', it will be become quickly apparent what I did.

P.S. If you wire it straight through, without open collector outputs for the Famicon Controller and the Arduino, I fail to see how contention and a possible short won't be an issue.

https://github.com/at67/gigatron-rom/bl ... elFish.ino

Arduino_Nano.png
Arduino_Nano.png (34.21 KiB) Viewed 5954 times
Marko
Posts: 8
Joined: 24 May 2018, 19:48

Re: USB-Gameport dongle

Post by Marko »

at67 wrote: 17 Jun 2018, 19:43
Marko wrote: 17 Jun 2018, 19:27 Did you wire the controller DB9 straight through to the output? If you hacked BabelFish I guess you're switching it in software somehow?
Switched in software on the Arduino whenever it's not using the serial port for commands/downloads etc: here's the circuit diagram, (pretty simple) and here's the link to the new BabelFish.ino, (it's only been tested with the Arduino Nano, you need to add a few constants for the other modules and wire pin2 of the new male DB9 to whatever port you choose), in the below circuit I chose J1-13, D10, which is PORTB2 on the Nano.

If you search for 'hasController' in 'BabelFish.ino', it will be become quickly apparent what I did.

P.S. If you wire it straight through, without open collector outputs for the Famicon Controller and the Arduino, I fail to see how contention and a possible short won't be an issue.

https://github.com/at67/gigatron-rom/bl ... elFish.ino


Arduino_Nano.png
Yup, I got ya. 2 DB9s and a USB port starts to get unwieldy for a "dongle", I may need to break out the gameport cable... *ponder*
User avatar
marcelk
Posts: 488
Joined: 13 May 2018, 08:26

Re: USB-Gameport dongle

Post by marcelk »

This looks neat!

I also don't believe the game controller data line is open collector. From all we see it is behaving as if there is a CD4021 inside. Granted, we've put a pull-up resistor R19 on the board, but its intended function is to provide a defined input voltage to the 74HC595 when nothing is connected.
Post Reply