custom USB controller adapters

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Sorgelig, Moderator Team

User avatar
Newsdee
Atari God
Atari God
Posts: 1041
Joined: Fri Sep 19, 2014 8:40 am

custom USB controller adapters

Postby Newsdee » Thu Dec 07, 2017 12:03 am

One of my favorite USB controller adapters out there is the Retro Freak's, but unfortunately it's very expensive ($60) and doesn't allow using Neogeo/arcade controllers.

Looking around it seems that most USB adapters are in the $20 to $25 range, so it's also pricey to get an adapter per system. That got me wondering whether it would be viable to choose one legacy standard, only convert to USB from it, and have everything else convert to that standard.

I'm thinking: (any console) --> SNES --> USB

Why SNES? Because of all the legacy formats I've looked at, that one and the NES (which is compatible by wiring) seem to be the only ones that need an MCU / CPU to decode. And at that point one might as well use that CPU to handle the USB as well. The SNES has 8 buttons (plenty) and could in theory support more (e.g. that NTT controller).

Now the question is how cheaply one can DYI small PCB adapters. I found some schematics for decoding Genesis 6 button and Saturn pads into "raw" formats so converting them to SNES can be done with discrete components removing any chance of lag. NES is direct wiring, and Atari/Neogeo/arcade are "raw" formats so they just need a couple of 4021 chips to encode.

What do you guys think? Happy to see other ideas around this.

Sorgelig
Atari God
Atari God
Posts: 1208
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: custom USB controller adapters

Postby Sorgelig » Thu Dec 07, 2017 12:18 am

Why don' use USB controller instead?
You can buy USB pads for around $9 only. So why bother to create a converter?

It's very important to describe your target in details to understand what advantages over existing solutions you will get and will it worth or not.

User avatar
Newsdee
Atari God
Atari God
Posts: 1041
Joined: Fri Sep 19, 2014 8:40 am

Re: custom USB controller adapters

Postby Newsdee » Thu Dec 07, 2017 1:48 am

Fair enough. I own lots of controllers, including several legacy ones for retro systems. I care about quality of the controller and also in using the best controller for a given game. I also have systems which do not have USB (e.g. Arcade SuperGun) and I sometimes build my own joysticks with DE15. I know "the best" is subjective, but basically, I like having the option to plug anything anywhere. :)

For MiSTer we only care about USB, indeed. There are excellent USB controllers out there (e.g. Buffalo) and the 8bitdo receivers allow using Bluetooth ones as well (e.g. PS3/PS4). I'd recommend the 8bitdo wireless approach over anything else, but many people (like me) already have original controllers too. Playing the NES with the Neogeo gamepad with microswitches is pretty cool.

The goal would be to make a lag free adapter which could support as many legacy formats as possible, maybe not out of one box but with a dongle for diffwent connectors. The assumption of course is that said dongle can be made cheaper than a whole USB adapter (or at least comparable). One MCU probably won't have lag, but with two in the chain it might be a problem.

spidersfrommars
Atarian
Atarian
Posts: 7
Joined: Mon Nov 20, 2017 3:39 am

Re: custom USB controller adapters

Postby spidersfrommars » Thu Dec 07, 2017 2:02 am

If you looking for a multi controller adapter, you might look in to a bliss-box. You can get the diy version for 35 buck and then buy the ports you want to solder your self. I use the 4play version that supports 4 controllers, and the ports are premade cables. so the 4play version is quite a bit more, but the diy is the same chip, just you only get on controller.
http://skunx7.wixsite.com/bliss-box/online-store
Last edited by spidersfrommars on Thu Dec 07, 2017 2:17 am, edited 1 time in total.

User avatar
Newsdee
Atari God
Atari God
Posts: 1041
Joined: Fri Sep 19, 2014 8:40 am

Re: custom USB controller adapters

Postby Newsdee » Thu Dec 07, 2017 2:10 am

So delving deeper into my controller nerdom (and for future reference) here are the standards I've been looking at:

  • Atari/SMS/Amiga (DE9, raw, 2 buttons)
  • Early Megadrive (DE9, multiplexed, 4 buttons)
  • Later Megadrive (DE9, multiplexed, 8 buttons)
  • NES (Nintendo plug, serialized, 4 buttons)
  • SNES (Nintendo plug, serialized, 8 buttons*)
  • Saturn (Sega plug, multiplexed, 9 buttons^)
  • Neogeo/JAMMA (DE15, raw, 6 buttons)
  • USB HID (USB, 10 to 12 buttons in most encoders)
(* and ^: the protocol seems to allow for more buttons but I haven't tried it)

For all of these:

  • (any) --> USB needs an MCU
  • Multiplexed formats cam be encoded and decoded with discrete components
  • Serialized formats can be encoded with discrete components
  • But the serial formats need an MCU to decode
  • SNES and NES are pin compatible so can be considered one format

Originally I was thinking of using DE15 as standard but that only gives me 6 buttons and converting from SNES needs an MCU.

Sorgelig
Atari God
Atari God
Posts: 1208
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: custom USB controller adapters

Postby Sorgelig » Thu Dec 07, 2017 3:22 am

Newsdee wrote:The goal would be to make a lag free adapter which could support as many legacy formats as possible

then bliss-box posted above should be exactly what you want.

User avatar
Newsdee
Atari God
Atari God
Posts: 1041
Joined: Fri Sep 19, 2014 8:40 am

Re: custom USB controller adapters

Postby Newsdee » Thu Dec 07, 2017 3:47 am

Sorgelig wrote:
Newsdee wrote:The goal would be to make a lag free adapter which could support as many legacy formats as possible

then bliss-box posted above should be exactly what you want.

It's too expensive. At ~$120 it costs the same as two Retro Freak adapters; that also does what I want :) Or I could get individual adapters at $20 each too. But thanks for pointing it out, It's a good product.

I suppose I could breadboard a discrete adapter to start and go from there.

spidersfrommars
Atarian
Atarian
Posts: 7
Joined: Mon Nov 20, 2017 3:39 am

Re: custom USB controller adapters

Postby spidersfrommars » Thu Dec 07, 2017 4:09 am

The diy one is only 35, you just gotta buy the connectors for the controllers and solder them.

You could also build your own, you'd still have to buy all the connectors. Maybe a good standard would be hdmi, you can buy breakout boards. It's what the blissbox 4play uses. hdmi has 19 pins to work with. Although breakout boards can get expensive. So its just a thought.

Sorgelig
Atari God
Atari God
Posts: 1208
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: custom USB controller adapters

Postby Sorgelig » Thu Dec 07, 2017 4:44 am

Newsdee wrote:It's too expensive. At ~$120 it costs the same as two Retro Freak adapters; that also does what I want :) Or I could get individual adapters at $20 each too. But thanks for pointing it out, It's a good product.

I suppose I could breadboard a discrete adapter to start and go from there.

if DIY version for $35 is too expensive or you want to be involved deeper into such adapter to control every bit, i suggest to look at Arduino Micro. It has native USB port which can be used as USB device. It has good amount of GPIO.
Using Arduino IDE, you can easily develop the firmware. Arduino IDE has libraries for Micro to simulate different USB devices, including input devices.
I've done A500 kbd to USB adapter and it works better than Keyrah.

Arduino Micro is dirt cheap. Be careful while choosing Arduino board - not every Arduino has native USB (many of them has USB-Serial chip instead, used only for programming and serial communication) and thus won't be able to simulate the USB joystick. Micro is the smallest one with native USB port.

Sorgelig
Atari God
Atari God
Posts: 1208
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: custom USB controller adapters

Postby Sorgelig » Thu Dec 07, 2017 4:50 am

Forgot one thing: Choose Arduino Micro 5V version since you will need to communicate with 5V logic in some retro pads.

User avatar
Newsdee
Atari God
Atari God
Posts: 1041
Joined: Fri Sep 19, 2014 8:40 am

Re: custom USB controller adapters

Postby Newsdee » Thu Dec 07, 2017 8:07 am

I saw that the one without USB (mini?) is going at around $2 on AliExpress... it needs a programmer but that's ridiculously cheap...

Sorgelig
Atari God
Atari God
Posts: 1208
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: custom USB controller adapters

Postby Sorgelig » Thu Dec 07, 2017 1:22 pm

https://www.aliexpress.com/item/Pro-Mic ... 19179.html

This is just for reference. I didn't buy from this seller.
Key feature is ATmega32U4 chip.
You don't need any other components for you converter. Just wire any retro joystick directly to its GPIO and write the firmware :)

User avatar
cvenditti
Atarian
Atarian
Posts: 7
Joined: Sun Nov 19, 2017 12:45 am

Re: custom USB controller adapters

Postby cvenditti » Thu Dec 07, 2017 6:06 pm

Sorgelig wrote:You don't need any other components for you converter. Just wire any retro joystick directly to its GPIO and write the firmware :)

nes.png

No need to write the firmware, this guy already did it (partially):
https://github.com/mcgurk/Arduino-USB-H ... ickAdapter
You do not have the required permissions to view the files attached to this post.

Sorgelig
Atari God
Atari God
Posts: 1208
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: custom USB controller adapters

Postby Sorgelig » Fri Dec 08, 2017 12:38 am

so it's just matter of testing the code and modifying it for your needs.

User avatar
Newsdee
Atari God
Atari God
Posts: 1041
Joined: Fri Sep 19, 2014 8:40 am

Re: custom USB controller adapters

Postby Newsdee » Fri Dec 08, 2017 12:08 pm

I wonder if the MCU could handle four connectors sharing the ground, VCC, and CLK. Then it could make a USB adapter and multitap :) But my first priority is to explore the SNES standard a bit, I find it interesting to wire a discrete encoder. I will need a male connector, fortunately many original controller cables have some kind of Molex connector so I can adapt one without destroying it...

Sorgelig
Atari God
Atari God
Posts: 1208
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: custom USB controller adapters

Postby Sorgelig » Fri Dec 08, 2017 1:04 pm

Newsdee wrote:I wonder if the MCU could handle four connectors sharing the ground, VCC, and CLK.

You always can make several adapters.
Each joystick requires its own virtual device on USB. This may require a complex device description. With $4 per board it's not a problem to make several.

User avatar
Newsdee
Atari God
Atari God
Posts: 1041
Joined: Fri Sep 19, 2014 8:40 am

Re: custom USB controller adapters

Postby Newsdee » Fri Dec 08, 2017 1:24 pm

Some interesting finds...

This guy built his own SNES controller from scratch (including 3D printed shell):
http://blogfarts.blogspot.hk/2016/11/op ... oller.html

And linked from that page, here are nice schematics for the discrete circuit:
http://www.raphnet.net/electronique/arc ... rol_en.php

User avatar
Newsdee
Atari God
Atari God
Posts: 1041
Joined: Fri Sep 19, 2014 8:40 am

Re: custom USB controller adapters

Postby Newsdee » Sat Dec 09, 2017 3:37 am

I've been playing with Eagle while I wait for the Nano to arrive. I had the idea of making a DIY PCB to test joysticks in Neogeo/Arcade format, which actually allows for 9 buttons if using non-standard pins (so I assigned to a "home" button we could use for OSD). I've added a standard DC plug for 5V (to feed VCC for the gamepads). My diagram is simply having LEDs with individual resistors in parallel... which should work.

5cm boards are the cheapest option for prototyping on DirtyPCB so I tried to keep to that size.
It's quite crammed as a result; I hope it's not too difficult to solder it. I will check if I can get tiny leds before ordering the PCBs, though.

joy_tester.jpg

joy_tester_schematic.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
Newsdee
Atari God
Atari God
Posts: 1041
Joined: Fri Sep 19, 2014 8:40 am

Re: custom USB controller adapters

Postby Newsdee » Sat Dec 09, 2017 5:43 am

After googling around I think it's a bad idea to put a DC jack without adding a voltage regulator circuit or it might damage controllers. I guess I can just change it to holes to solder a battery holder on the back of the PCB.

udo
Atariator
Atariator
Posts: 19
Joined: Fri Jun 02, 2017 10:47 am

Re: custom USB controller adapters

Postby udo » Sat Dec 09, 2017 9:11 am

Newsdee wrote:I've been playing with Eagle while I wait for the Nano to arrive.


Hi,

I am not sure that Your really want a Arduino Nano. I think only the Arduino Micro or Leonardo has the right MCU (Atmega32u4) which has USB-HW-Support. I have a Adruino Leonardo myself and did some testing. So far I did connect a "normal" Atari-Joystick without any problems.

User avatar
Newsdee
Atari God
Atari God
Posts: 1041
Joined: Fri Sep 19, 2014 8:40 am

Re: custom USB controller adapters

Postby Newsdee » Sat Dec 09, 2017 10:06 am

I got one atmega32u4 (that's the one with proper USB if I'm not mistaken) and a few 328p (which are dirt cheap). My rough idea is to use the 32u for development and the eventual adapter, but then use the 328p for general conversion/non-USB stuff.

Does anybody have an Eagle library/part for the shape of these Arduino boards? I might not fab the PCB but I find it helpful to layout a board even to give me an clearer idea of a circuit. Here's my second attempt...

joy_tester.jpg
You do not have the required permissions to view the files attached to this post.


Return to “MiSTer”

Who is online

Users browsing this forum: No registered users and 1 guest