DIY MD/SMS/Atari/C= to USB adapter

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

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

User avatar
witchmaster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 136
Joined: Wed Jun 15, 2011 10:50 am

DIY MD/SMS/Atari/C= to USB adapter

Postby witchmaster » Sun Oct 06, 2019 5:15 pm

I designed a simple to build Mega Drive, Genesis, Master System, Atari, C= controller adapter around the Arduino Pro Micro. The Arduino Pro Micro has very low latency when configured as a USB gamepad so it's well suited for these things. 3 and 6-button Mega Drive/Genesis gamepads are supported, also 1 and 2-button C=/Atari joysticks work along with Master System gamepads.

Source and build instructions can be found on GitHub: https://github.com/MickGyver/Mega-Drive ... SB-Adapter. Some fine tuning to the software might still be needed, works great with my 8BitDo M30 2.4GHz Mega Drive controller and TAC-2 joystick on MiSTer though.

I have a lot of extra of those extension connectors if anybody needs. I could sell a "kit" of the connector, switch and heat shrink tube for a couple of €uros.

Image
Image

BBond007
Captain Atari
Captain Atari
Posts: 414
Joined: Wed Feb 28, 2018 3:23 am

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby BBond007 » Mon Oct 07, 2019 8:37 pm

This is very cool...

I think it would be cool to use this in my A1200 MiSTer project (viewtopic.php?f=117&t=34703&start=75#p375012)

I have not yet connected the DB9s to anything...

Is it possible for this to read the additional buttons on the CD32 and Boomerang controllers? I think these additional buttons are read using a shift register.

Also, what is the switch used for? Is it necessary to have this switch accessible?

Thanks :)

User avatar
witchmaster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 136
Joined: Wed Jun 15, 2011 10:50 am

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby witchmaster » Tue Oct 08, 2019 6:43 am

BBond007 wrote:This is very cool...

I think it would be cool to use this in my A1200 MiSTer project (viewtopic.php?f=117&t=34703&start=75#p375012)

I have not yet connected the DB9s to anything...

Is it possible for this to read the additional buttons on the CD32 and Boomerang controllers? I think these additional buttons are read using a shift register.

Also, what is the switch used for? Is it necessary to have this switch accessible?

Thanks :)

The switch is not a must, in one position (default when no switch installed), the Mega Drive / Genesis gamepads are fully supported, in the other position, a faster routine for reading 1 and 2-button joysticks is used. 1 and 2 button joysticks are also supported when the Genesis routine is active.

Making this exact version support CD32 gamepads is a bit tricky since the CD32 gamepad needs +5V on pin 7 instead of 5. I might actually make another version with support for up to two CD32/C=/Atari gamepads/joysticks.

heffe2001
Atarian
Atarian
Posts: 2
Joined: Fri May 25, 2018 10:53 pm

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby heffe2001 » Tue Jan 14, 2020 3:35 am

Is there an error in the wiring diagram on this? It shows the switch connected to both GND's and pin 2, but your assembled version pictures appear to have it connected to gnd, 2 & 3?

Built one for my MiSTer box, and I'm having issues with it working with a Wico ball-top atari joystick (and a bat version, lol). Mister sees it, but when I try to map the joystick, it hangs on the first 'move right' (shows the ID for the device, but goes no further). Also tried the arcade version just to see if it made any difference, but unfortunately, same results.

robbo43
Retro freak
Retro freak
Posts: 11
Joined: Sat Feb 03, 2018 10:58 pm

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby robbo43 » Sat Jan 18, 2020 12:59 am

Hi Witchmaster,

Can this be adapted to work with SNES/NES/TG16/PCE controllers?

Cheers

Rob

User avatar
witchmaster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 136
Joined: Wed Jun 15, 2011 10:50 am

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby witchmaster » Sat Jan 18, 2020 7:54 am

heffe2001 wrote:Is there an error in the wiring diagram on this? It shows the switch connected to both GND's and pin 2, but your assembled version pictures appear to have it connected to gnd, 2 & 3?

Built one for my MiSTer box, and I'm having issues with it working with a Wico ball-top atari joystick (and a bat version, lol). Mister sees it, but when I try to map the joystick, it hangs on the first 'move right' (shows the ID for the device, but goes no further). Also tried the arcade version just to see if it made any difference, but unfortunately, same results.

The wiring diagram is correct! My assembled version shows the "wrong" connection, but it will work connected like that also. I will have a look at the issue!

robbo43 wrote:Hi Witchmaster,

Can this be adapted to work with SNES/NES/TG16/PCE controllers?

Cheers

Rob

Yes, should be quite easy. I have planned to do versions for NeoGeo controllers also. I will see if I find the time!

User avatar
witchmaster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 136
Joined: Wed Jun 15, 2011 10:50 am

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby witchmaster » Sat Jan 18, 2020 9:23 am

heffe2001 wrote:Built one for my MiSTer box, and I'm having issues with it working with a Wico ball-top atari joystick (and a bat version, lol). Mister sees it, but when I try to map the joystick, it hangs on the first 'move right' (shows the ID for the device, but goes no further). Also tried the arcade version just to see if it made any difference, but unfortunately, same results.

I tested it myself and it works for me, I'm able to successfully map the directions etc. However, I noticed a small bug in the X/Y reporting that I fixed, so you should get the updated code (I did the test before updating it myself). The arcade version I made didn't have this bug so I'm not sure what the problem is. I haven't updated my MiSTer since before christmas, maybe something has changed. I will update my MiSTer and see what happens.

redsteakraw
Atariator
Atariator
Posts: 17
Joined: Fri Dec 06, 2019 6:08 pm

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby redsteakraw » Sat Jan 18, 2020 1:54 pm

Does this work with the Paddle or Driving Atari controllers? I love the formfactor of this design and If i am not mistaken the arduino does have A2D hardware so if it doesn't now it theoretically could be possible.

User avatar
witchmaster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 136
Joined: Wed Jun 15, 2011 10:50 am

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby witchmaster » Sat Jan 18, 2020 3:25 pm

redsteakraw wrote:Does this work with the Paddle or Driving Atari controllers? I love the formfactor of this design and If i am not mistaken the arduino does have A2D hardware so if it doesn't now it theoretically could be possible.

That would also be possible, shouldn't be too hard, not working yet though and would need to use other pins on the Micro. Can analog sticks on gamepads now be used for paddle-games?

crocky
Atari maniac
Atari maniac
Posts: 98
Joined: Fri Nov 23, 2018 2:01 pm

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby crocky » Sat Jan 18, 2020 4:41 pm

Paddles can be used on Atari 2600, Pong arcade core and in future the AY Pong core. MiSTer treat "tilt" for paddle - absolute position (say voltage measurement). This is different from a spinner which is relative position (unlimited turns) and is mapped to MiSTer as mouse. Cores like Super Breakout, Arkanoid, Sprint 1 and 2 use that. In your case you can test using the Atari 2600 core or the Pong arcade core.

robbo43
Retro freak
Retro freak
Posts: 11
Joined: Sat Feb 03, 2018 10:58 pm

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby robbo43 » Wed Jan 22, 2020 5:52 pm

Hi Witchmaster,

Great work on the Genesis adapter optimisations, those lag figures are really impressive. Is the switch still an optional extra - will an SMS controller still work with the adapter in 'native' Genesis mode?

Regards

Rob

User avatar
witchmaster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 136
Joined: Wed Jun 15, 2011 10:50 am

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby witchmaster » Wed Jan 22, 2020 7:52 pm

robbo43 wrote:Hi Witchmaster,

Great work on the Genesis adapter optimisations, those lag figures are really impressive. Is the switch still an optional extra - will an SMS controller still work with the adapter in 'native' Genesis mode?

Regards

Rob

Thanks! The switch is still optional, but in Genesis mode, the buttons on an SMS controller will be interpreted as buttons 2 and 3 (B and C) instead of 1 and 2. That behaviour hasn't changed, was the same before.

The updated project can be found here: https://github.com/MickGyver/DaemonBite-Sega-USB

User avatar
Bama
Captain Atari
Captain Atari
Posts: 222
Joined: Sat Feb 28, 2015 1:25 pm

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby Bama » Thu Jan 23, 2020 12:22 pm

witchmaster wrote:The updated project can be found here: https://github.com/MickGyver/DaemonBite-Sega-USB


Awesome!
Thanks Witchmaster!
:-)
BAMA

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5794
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby Sorgelig » Tue Jan 28, 2020 6:20 pm

I think this converter can be moved to MiSTer-devel if witchmaster would like to. You can still maintain it by yourself.
Recently i've made similar project for MadCatz Arcade stick which is died in the same day when it's arrived. So i had nothing than remove epoxy chips and wire Teensy 3.2 on top of that PCB. Teensy 3.2 is much more powerful but i think it's a little too much for joystick. So Atmega32U4 is pretty much fine.
There are similar arduino compatible boards on atmega32u4 such as Teensy 2.0 and ItsyBitsy(from Adafruit) - they have more GPIO pins (i believe they use maximum available pins from chip). So with these boards you get even more GPIOs.
I think this project can be extended with analog inputs so it can be integrated in some existing old analog joysticks and paddles. Also recently several cores got spinner support which is also can be integrated in this project.
Probably even modern cheap $2-$5 gamepads can be modded by atmega32u4 to get better control over the polling rate and extra features.

User avatar
witchmaster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 136
Joined: Wed Jun 15, 2011 10:50 am

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby witchmaster » Wed Jan 29, 2020 8:30 am

Sorgelig wrote:I think this converter can be moved to MiSTer-devel if witchmaster would like to. You can still maintain it by yourself.
Recently i've made similar project for MadCatz Arcade stick which is died in the same day when it's arrived. So i had nothing than remove epoxy chips and wire Teensy 3.2 on top of that PCB. Teensy 3.2 is much more powerful but i think it's a little too much for joystick. So Atmega32U4 is pretty much fine.
There are similar arduino compatible boards on atmega32u4 such as Teensy 2.0 and ItsyBitsy(from Adafruit) - they have more GPIO pins (i believe they use maximum available pins from chip). So with these boards you get even more GPIOs.
I think this project can be extended with analog inputs so it can be integrated in some existing old analog joysticks and paddles. Also recently several cores got spinner support which is also can be integrated in this project.
Probably even modern cheap $2-$5 gamepads can be modded by atmega32u4 to get better control over the polling rate and extra features.

Cheers! :) I'm thinking I could make a USB hub board with two USB ports replaced with two 9pin connectors. It would have an Atmega32u4 on board with a special version of my software for it that could support Sega Master System controller, Mega Drive/Genesis controllers, Atari/Commodore/Amiga joysticks (one and two buttons), and Amiga CD32 controllers. I have code working for all those controller types already so the software part should be easy, I would just need to design the board. What do you think about this?

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5794
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby Sorgelig » Wed Jan 29, 2020 12:03 pm

I have nothing against it.
There is a similar design from THaase

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5794
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby Sorgelig » Wed Jan 29, 2020 12:05 pm

From other point of view, having usb stick as a converter is more flexible. You can use 1-4 pieces depending on use cases.

User avatar
witchmaster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 136
Joined: Wed Jun 15, 2011 10:50 am

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby witchmaster » Wed Jan 29, 2020 12:13 pm

Sorgelig wrote:I have nothing against it.
There is a similar design from THaase

Nice! What software did you design the USB hub board in? If you used Eagle PCB and you are willing to share the .pcb and .brd files, that would be great! :) Otherwise I will compare to the pdf of the 2.1 design.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5794
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby Sorgelig » Wed Jan 29, 2020 12:23 pm

I use Altium Designer - all sources are on repository.
btw, this version of pcb:
s-l400.jpg

can be integrated with DB9 into a small 3D printed case and be a small converter plugged to USB.
You do not have the required permissions to view the files attached to this post.

User avatar
witchmaster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 136
Joined: Wed Jun 15, 2011 10:50 am

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby witchmaster » Wed Jan 29, 2020 1:28 pm

Sorgelig wrote:I use Altium Designer - all sources are on repository.
btw, this version of pcb:
s-l400.jpg
can be integrated with DB9 into a small 3D printed case and be a small converter plugged to USB.

Ok, thanks! That's a cool little PCB. I ordered I few of those to try something out!

User avatar
witchmaster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 136
Joined: Wed Jun 15, 2011 10:50 am

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby witchmaster » Thu Jan 30, 2020 10:04 pm

robbo43 wrote:Is the switch still an optional extra - will an SMS controller still work with the adapter in 'native' Genesis mode?

I just updated the project on GitHub, the switch is not needed any more, switching between SMS/Atari/C= and Mega Drive/Genesis mode is now totally automatic.

By the way, don't use any Atari/Commodore/Amiga controllers that require +5V with this adapter (joysticks with turbofire, Amiga CD32 controllers and maybe some others), only passive controllers. The pin mapping on the Mega Drive is different, pin 5 is +5V on Mega Drive while pin 7 is +5V on Atari/Amiga/C= etc.

When it comes to Mega Drive gamepads, they should all work. I have tested the adapter with original 3-button controllers and an 8bitdo M30 2.4G wireless 6-button controller.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5794
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby Sorgelig » Sat Feb 01, 2020 11:15 pm

@witchmaster:
did you try to make 2 the same virtual USB devices on the same physical? Something like 2 joysticks adapter.

User avatar
witchmaster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 136
Joined: Wed Jun 15, 2011 10:50 am

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby witchmaster » Sun Feb 02, 2020 6:58 am

Sorgelig wrote:@witchmaster:
did you try to make 2 the same virtual USB devices on the same physical? Something like 2 joysticks adapter.

I have made such an adapter earlier but haven't tested it on the MiSTer. I will dig out the source code for that project and try it out.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5794
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby Sorgelig » Sun Feb 02, 2020 7:02 am

Make sure Serial Number field is empty, or devices will be combined. This also affects on physically different devices using hardcoded same serial number.
For best compatibility this field must be empty.

User avatar
witchmaster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 136
Joined: Wed Jun 15, 2011 10:50 am

Re: DIY MD/SMS/Atari/C= to USB adapter

Postby witchmaster » Mon Feb 03, 2020 1:47 pm

Sorgelig wrote:Make sure Serial Number field is empty, or devices will be combined. This also affects on physically different devices using hardcoded same serial number.
For best compatibility this field must be empty.

Thanks for the hint. The Arduino Pro Micro device I'm using has a serial number I'm afraid. I haven't yet been able to make it empty, but I can make it another value... I tried adding the quirk that is supposed to fix this on Linux (usbhid.quirks=0x2341:0x8036:0x040 to u-boot.txt) but that did not help, so two joystick ports on the same adapter are now combined. I can see that others are having similar problems with DIY adapters etc.


Return to “MiSTer”

Who is online

Users browsing this forum: No registered users and 9 guests