Jump to content
Sign in to follow this  
loppydog

USB Oldschool Controller mod

Recommended Posts

Hi guys, I am starting a project and would like to get some feedback and suggestions. I am trying to modify a NES, SNES, and Genesis controller to be USB keyboards. I am also wanting to put a usb flash drive inside to have Hyperspin auto-run. So I would need a USB keyboard encoder, USB hub, and a Flash drive all inside. I started with a Genesis controller and I am finding that there just is not nearly enough room in there to even get a hacked USB keyboard encoder to fit!

I already have a really small USB flash drive. I ordered a small 2 port USB hub that should be here any time. I also ordered a USB numpad to see how big that encoder might be, but I doubt the matrix on that thing will allow many simultaneous key presses. The gampads use a common ground method, so a matrix really is a pain for me to wire.

I also order a Teensy 3.1 which will allow me to emulate a USB keyboard and should fit inside the case I think. After contacting the guys at Teensy, I also have another option that might work. The Teensy can be used with a SD adapter that allows it to be recognized as a keyboard AND SD card. That would eliminate the need for a hub. The problem is, they say it is only good for speeds up to 0.5 MB/s. I am assuming that is too slow for running a Sega emulator and Hyperspin?

I know there is a thread here that is similar to what I want to do, but he sets his up a joystick not keyboards. They also do not seem to sell the adapter anymore anyway. http://www.hyperspin-fe.com/forum/showthread.php?16223-My-first-controller-mod!

**EDIT**

I just found this from blacketj. WOW this has a TON of usefull info!

http://www.hyperspin-fe.com/forum/showthread.php?28095-SNES-Controller-HyperSpin-Install&highlight=teensy

I appreciate any suggestions and ideas you guys may have. Thanks!

post-9326-142870659404_thumb.jpg

post-9326-142870659408_thumb.jpg

post-9326-142870659412_thumb.jpg

post-9326-142870659416_thumb.jpg

Edited by loppydog

Share this post


Link to post
Share on other sites

Thanks for linking my post.

I think that the teensy is the way to go. When plugged into your computer I believe it shows up as Keyboard/Mouse/Joystick. So you can send any mix of those commands you want. I just stuck with keyboard presses for my project. The teensy is Arduino compatible, so you can and probably should do all your programming in the Arduino environment. I don't know you coding level, but Arduino is one of the easiest ways to get into micro controller programming. And there are lots of examples and free code out there.

There are two ways I would recommend when trying to poll the buttons for presses. Neither require trying to cut into traces for a place to solder.

1. The cleanest way requiring the least amount of wires and extra soldering, is to use the controllers built in shift register. De-solder the original wires coming from the controller's plug to the PCB. You can now use those connections to wire the shift register directly to the teensy. It will be "parallel in serial out" shift register connected to all the buttons. Not exactly sure what the pin out is, but hopefully you can figure it out with some googling. There should be plenty of arduino shift register tutorials out there.

2. Less coding, but more wiring/soldering. Carefully remove the shift register off the controller PCB. Now you have a nice solder pad leading directly to each button, and no cutting into traces needed. Wire from those pads to the teensy. Now you have a very simple loop of code to write where you just check the button and send the corresponding key press. But removing a surface mount chip can be a tricky operation depending on what tools you have. The easiest ways is with a hot air tool, but not everybody has one of those. Another method is to get a product called ChipQuik. I haven't used it myself, but there are tutorials on youtube and it looks pretty easy. Another option is to use a dremmel tool and carefully cut the body of the chip off of the feet. Now that all the feet are separated you can remove one at a time with a soldering iron and tweezers.

I would skip the teensy SD adapter simply because it is too slow. It will not be a very good HyperSpin experience at all.

Share this post


Link to post
Share on other sites

Thanks so much for the reply blacketj. I am brand new to Arduino/Teensy programming, but I am not new to coding in general. I have a very nice adjustable soldering iron and removing the IC off of the PCB is not too difficult for me. But, I would really like to not have to do that. Wiring directly to the built in shift register is definitely how I would like to try to do it first. As a matter of fact it sounds like I want to do it exactly like yours, with the "select shift button". Like select+start will kill the emulator and get back to Hyperspin or something like that. Maybe you could share what changes you had to make to make that happen. Obviously you used a SNES controller, I am starting with an NES controller. I am not too sure how different the code is, but according to what I read, it may be the SAME code. I looked at the pin-out for the Sega Genesis, and it looks way different actually. That system may be the hardest for me to figure out. Do you think the difference between Teensy 2.0 and 3.1 will make any difference in code compatibility?

Share this post


Link to post
Share on other sites
I have done the same thing, mine is inside SNES/NES controllers, haven't tackled sega yet. I use an arduino though instead of a teensy, either works. Hyperspin runs like complete garbage from the flash drive for me even with it configured for the lowest performance possible.

Interesting. I got my Teensy today, I will report back with how it goes.

Share this post


Link to post
Share on other sites

well, it appears I have a bad Teensy :( I plugged it in and it goes into a plugged/unplugged loop indefinitely. Bummer.

Share this post


Link to post
Share on other sites

Yeah I tried that stuff first. BUT, I think I may have got it recovered! I managed to program the simple blink program in between the perpetual "dinging" of windows ;) Now it appears to be working like it should...I am a little afraid to start programming now. Also, it looks like the pins are way different on the 3.1, so I am trying to figure out what wires go where.

**EDIT** OK I just tried the code from the "Mike Rogers" site, and I didn't seem to work. It appears to be looping pressing all of the keys in order causing windows to freak out! Keep in mind, that I do not have any wires connected from the Teensy to the controller yet. I think it is safe to say that code does not work with 3.1 ;) I did fire up the example code that allows key presses based on grounding each pin. That seems to work just fine.

Edited by loppydog

Share this post


Link to post
Share on other sites

Thanks Jeremy, that makes sense. I will give it a try with the controller connected. I am having a little trouble deciding where to connect the wires I have a little mock-up here..what do you think?

IMG_3547_zps7d83db10.jpg

Share this post


Link to post
Share on other sites

This is a genuine NES controller.

I got it! I tried to use the SNES library and sketch, and had the same result with the non stop button presses. Then I decided to try to reference the NES library and change the sketch accordingly. Bingo! works just like it should now. On to the next step. Thanks everyone for helping me with this.

Edited by loppydog

Share this post


Link to post
Share on other sites

I have not got my USB Hub yet, but I have everything else all set up. Even without the hub HS is pretty slow to load. It takes about 3-5 seconds for the first video to load and begin playing. Then scrolling games for the first few seconds in choppy and somewhat unresponsive. After that it seems pretty good though. It is not the PC since it is my brand new gaming rig. It must be simply the speed of the USB flash drive. I am wondering if I could design it differently so that maybe I could use a High Speed micro SD card. I am not sure that would even help.

Also, one other little problem is that I just found out that Auto-Play has been eliminated since Windows 7! Is there any other options I have to be able to plug this into anyone's PC and easily launch HS?

Share this post


Link to post
Share on other sites

So I was thinking.... They say USB 2.0 can handle 60 MB/s. My current USB drive, if i measured correctly, reads at about 5-10 MB/s for small files and about 20 MB/s for larger files. Read speed are all we really need to be concerned about I think. The Samsung EVO class 10 SD card says it will do up to 48 MB/s. That might make a real difference. I may try to get my hands on this card to see if there is any real world difference in speed. I will test with and without a hub to see if it bottlenecks there too.

Edited by loppydog

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...