The NEW Build Your Own Arcade Controls

Main => Main Forum => Topic started by: rCadeGaming on December 03, 2023, 12:37:19 pm

Title: Multi-USB Controller Encoder
Post by: rCadeGaming on December 03, 2023, 12:37:19 pm
Multi-USB Controller Encoder

(https://bitbucket.org/puddlez/multiusbcontrollerencoder/raw/d859283b9aad7d41131640febffbeef92020cc70/Pictures/MultiUsbControllerEncoder01.jpg)

This is a project I created to allow a variety of controllers to connect to a variety of game consoles.

Inputs:
Outputs:
When output mode is set to PC, the microcontroller connects directly to the PC as a USB keyboard.  When output mode is set to PS/XBox or Switch, the microntroller passes inputs to the external encoder which connects to the console as a controller.  In either mode, inputs are debounced and remapped according to a button map by the microcontroller before output.

This may be configured for use with a variety of AVR microcontrollers and button encoders, but is intended for use with a Teensy++ 2.0 development board (Atmel AT90USB1286 AVR microcontroller) and Brook Universal Fighting Board button encoder (not required for PC use).

Features:

Open source code, documentation, notes, and hi-res pictures can be found in the BitBucket repository linked below:
https://bitbucket.org/puddlez/multiusbcontrollerencoder (https://bitbucket.org/puddlez/multiusbcontrollerencoder)

---

Hi everyone.  Long time, no post.  In the past few years, I've been unable to make a lot of time for hobbies due to a hectic personal and work life.  When I do manage to fit in an hour or two here or there, I work on things like this.  This project has been done for a while, and I figured it was time to properly document it and get back online to share it.  I also wanted to make this open source in hopes that others can make use of what I've done.  If anyone is interested in replicating this or making your own variation, please document and share your results here.

The idea for this originally came about when I was trying to rewrite the code for some KADE Encoders I had sitting around to make my own keyboard encoders for use with MAME.  This led me to start working more with AVR microcontrollers in embedded C, which was kind of the next step after some previous experience with Arduino.  Around the same time, I started running into some other use cases I didn't have a solution for - connecting a Genesis Controller to a PC; connecting my arcade sticks to a PS4; connecting a Super Nintendo controller to my Switch; doing all this with proper debouncing and effective button mapping.  Eventually, I figured out how to roll all this into one project and this is the result.  I upgraded from the KADE encoder's Atmel ATMEGA32U2 to an AT90USB1286 with more pins, and wrote my own code from scratch, with the exception of PJRC's USB Keyboard library (this is credited in code - see UsbKeyboard.c).

Now that this is done, the next step is to make something similar that will work with all my retro consoles.  I'd like to start working with FPGA's and make that my first project.  It may even include audio/video switching and transcoding from RGB to YPrPb component video and vice versa.

Some more pictures...

These are the controller adapters.  They're easy to make with some controller extensions and d-sub connectors.

(https://bitbucket.org/puddlez/multiusbcontrollerencoder/raw/d859283b9aad7d41131640febffbeef92020cc70/Pictures/MultiUsbControllerEncoder04.jpg)

Some more pictures of the encoder.  The button in the back is the reset button for the microcontroller, which used when rewriting it for a code change or button map update.

(https://bitbucket.org/puddlez/multiusbcontrollerencoder/raw/d859283b9aad7d41131640febffbeef92020cc70/Pictures/MultiUsbControllerEncoder02.jpg)

(https://bitbucket.org/puddlez/multiusbcontrollerencoder/raw/d859283b9aad7d41131640febffbeef92020cc70/Pictures/MultiUsbControllerEncoder03.jpg)

Some pictures of the hand-soldered PCB, before and after adding the components and putting it in the enclosure.  For my next project, I think I need to learn to use PCB fab services.

(https://bitbucket.org/puddlez/multiusbcontrollerencoder/raw/d859283b9aad7d41131640febffbeef92020cc70/Pictures/MultiUsbControllerEncoder06.jpg)

(https://bitbucket.org/puddlez/multiusbcontrollerencoder/raw/d859283b9aad7d41131640febffbeef92020cc70/Pictures/MultiUsbControllerEncoder07.jpg)

(https://bitbucket.org/puddlez/multiusbcontrollerencoder/raw/d859283b9aad7d41131640febffbeef92020cc70/Pictures/MultiUsbControllerEncoder05.jpg)

This is the matching encoder PCB that goes in the arcade stick itself to work with the Multi-USB Controller Encoder.  It is a very simple design using a few CMOS logic ICs, but can support extremely high polling rates.  More details in another BitBucket repository linked below:

https://bitbucket.org/puddlez/17inputbuttonencoder

(https://bitbucket.org/puddlez/17inputbuttonencoder/raw/8af697539d0652b074ed52c4671a47e6255b8c06/Pictures/17InputButtonEncoder01.jpg)
Title: Re: Multi-USB Controller Encoder
Post by: wordsworth on January 07, 2024, 01:29:02 pm
Looks very nice!
Title: Re: Multi-USB Controller Encoder
Post by: javeryh on January 07, 2024, 06:23:55 pm
This is really neat.
Title: Re: Multi-USB Controller Encoder
Post by: jimdeprado on January 09, 2024, 09:05:34 pm
Very nice!  I'm excited to see if you can get it to control an Atari 2600 joystick or paddles.