Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: DIY Xbox Controller Interface on a budget *UPDATED and with Video*  (Read 36594 times)

0 Members and 1 Guest are viewing this topic.

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
I created a prototype controller interface for xbox based on a hacked smartjoy frag keyboard adaptor.

These smartjoys (also known as smartbox II) were designed to allow peeps to play FPS titles via a connected PS/2 keyboard and mouse.  I mentioned this project in my other post for a DIY USB Keyboard Encoder (for MAME).  The smartjoy is a neat little device and you can get hold of these very cheap.

I made a previous xbox prototype based on an AVR development board and a hacked smartjoy (I called it Minty Fresh Interface).  If you want the background you can find this on my project site at https://sites.google.com/site/degenatrons/controller-interfaces/xbox-interface  Unfortunately,  I had some issues with this so had to go back to the drawing board. :(

This time I had more success and the device is now tested and working with xbox.  :)

So I had to come up with a way to get the inputs from arcade controls to connect to the PS/2 keyboard input ports on the smartjoy.  I figured I could create my own PS/2 keyboard encoder circuit (a bit like a keyboard hack) to connect the arcade controls to the smartjoy.

I found a PS/2 integrated circuit at Farnell Electronics, it is Holtek model HT82K628A. It is a 40 Pin Dip IC. This is an old chip which was used in Windows 95/98/2000 keyboards. It is also very cheap. It accepts input from pins (via matrix) and communicates PS/2 to host. It does some other neat stuff too.
I built a breadboard circuit around this IC and tested with with a PC and it worked.  The circuit includes the chip, a couple of capacitors (0.1uf and 10uf) and a resistor (58.3k) to control the clock speed.  If you get the spec for the chip it includes a schematic for this circuit.

My breadboard circuit looks like this.  Very simple.



I connected the smartjoy to this test circuit and bridge a couple of pins.  Woohoo! everything was looking good,  so I set about hacking the smartjoy adaptor.

There was a bit of room inside the smartjoy so I managed to get my additional components inside the original case.
In the pictures below,  you can see that I mounted the chip its back (like a dead bug) so that I could solder wires to the legs.  To make space I removed the nasty memory card slot.  The chip is quite large but I was surprised by how well this fit.
The hole at the top of the smart joy (were the memory card slot was) is a convenient exit hole for the wires to the arcade controls.
I screwed some terminal blocks on the outside of the smartjoy.



I only paid a few pounds for the parts and I did not need a PS/2 cable. You can see that I just glued wires into the port.
Total cost for me was not more than £4 - but I did buy a bunch of smartjoys to get some discount.

This is very functional, I tested using the gamepad test tool on xbox.  

Mappings working for:

* Dpad (up/down/left/right)
* Analog Stick (up/down/left/right)
* Left and Right Triggers
* Left and Right Thumb Buttons
* A,B,X,Y
* Black, White
* Back, Start
* PS/2 or USB Trackball/Mouse

That's 20 inputs!  Plus the trackball/mouse.  Not bad eh!

Some other neat features:
* Analog sticks can be inverted
* Deadzone/Mouse sensitivity can be adjusted
* Left and Right sticks can be swapped (invert look/move)
* I found that the buttons on mouse/trackball can sometimes be assigned to xbox button.  This feature depends on device.

For all this to work, it needs a mouse (PS/2 or USB) connected to the mouse port - even if it is not used.  If you have a trackball then great, otherwise you can grab a PS/2 mouse for almost nothing - if you don't have one in the loft already.  
EDIT: It will now work without the need for a connected trackball/mouse.  This is done by spoofing the mouse by bridinging 2 pins (clock and data) on the mouse port with 10ohm (or other low value) resistor.  Credit to "John" on the CoinOps forum for this awesome contribution.  If you have a mouse or trackball then obviously you won't need to spoof.
For reference, You can see a picture at the bottom of my project page at https://sites.google.com/site/degenatrons/controller-interfaces/xbox-gamepad-encoder-mkii

Here is a demo video.



I am happy with this so it will be going inside my CoinOps arcade cab.
« Last Edit: June 15, 2012, 04:25:16 am by degenatrons »

ark_ader

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5645
  • Last login:March 02, 2019, 07:35:34 pm
  • I glow in the dark.
Re: DIY Xbox Controller Interface - on a budget
« Reply #1 on: June 08, 2012, 08:21:49 pm »
Cool.  I have one of these joy frags and they work fine for Halo, but the mouse function is a bit on the slow side.  Perfect for Spinner games though.   ;D

I would love to get my joy frag working with this mod.

Kudos for sharing.  :applaud:
If I had only one wish, it would be for three more wishes.

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface - on a budget
« Reply #2 on: June 08, 2012, 08:42:10 pm »
Cool.  I have one of these joy frags and they work fine for Halo, but the mouse function is a bit on the slow side.  Perfect for Spinner games though.   ;D

I would love to get my joy frag working with this mod.

Kudos for sharing.  :applaud:

You should try adjusting the mouse deadzone setting on your smartjoy.  Sensitivity can be set between 0 and 100.
Press ESC and a number key and fine tune with + and - keys.  Some information on this page should help you do that: http://hardware.teamxbox.com/articles/xbox/954/SmartJoy-FRAG-Review/p3/

rablack97

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2215
  • Last login:August 09, 2024, 08:49:57 pm
  • If you don't try, you have no chance at innovation
Re: DIY Xbox Controller Interface - on a budget
« Reply #3 on: June 10, 2012, 10:52:28 pm »
Are you going to do a step by step tut on the these, or keep that secret so you can make a little coin..... :applaud: :applaud: :applaud:

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface - on a budget
« Reply #4 on: June 11, 2012, 03:27:59 am »
Doing a step by step video for these - should be out very soon.

rablack97

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2215
  • Last login:August 09, 2024, 08:49:57 pm
  • If you don't try, you have no chance at innovation
Re: DIY Xbox Controller Interface - on a budget
« Reply #5 on: June 11, 2012, 08:49:00 am »
Awesome.....ordering the parts then.....woohoo

sharpfork

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 618
  • Last login:January 30, 2025, 08:21:36 am
    • KADE
Re: DIY Xbox Controller Interface - on a budget
« Reply #6 on: June 11, 2012, 06:11:05 pm »
Looks promosing.
What did you do to update the ps2 keyboard encoder?
Are you using this? http://www.leien.info/buttonbox/

johnm

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 130
  • Last login:May 28, 2025, 11:40:55 am
Re: DIY Xbox Controller Interface - on a budget
« Reply #7 on: June 11, 2012, 08:23:27 pm »

I think as it's a keyboard IC, it works out of the box.

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface - on a budget
« Reply #8 on: June 11, 2012, 08:59:00 pm »
Looks promosing.
What did you do to update the ps2 keyboard encoder?
Are you using this? http://www.leien.info/buttonbox/

Hey Sharpfork,  Thanks.

The chip I add inside the smartjoy is a PS/2 encoder that uses a matrix to map some inputs to generate scancodes.  These are sent as keyboard input to the smartjoy PS/2 port.  Some people would hack a keyboard to do this sort of thing,  but I managed to find a cheap PS/2 encoder and built myself a basic circuit.

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface - on a budget
« Reply #9 on: June 11, 2012, 09:00:14 pm »

I think as it's a keyboard IC, it works out of the box.

Yep,  you're right.  The Ps/2 chip works out of the box.   (Edited)
« Last Edit: June 11, 2012, 10:10:46 pm by degenatrons »

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface - on a budget
« Reply #10 on: June 11, 2012, 09:32:05 pm »
I put a video to show how this was built and at the end I test it with some controls.




ark_ader

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5645
  • Last login:March 02, 2019, 07:35:34 pm
  • I glow in the dark.
Re: DIY Xbox Controller Interface - on a budget
« Reply #11 on: June 12, 2012, 03:35:00 pm »
Great.   :applaud:

Instead of soldering the wires to the chip, can you use a socket instead?
If I had only one wish, it would be for three more wishes.

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface - on a budget
« Reply #12 on: June 12, 2012, 03:49:45 pm »
Great.   :applaud:

Instead of soldering the wires to the chip, can you use a socket instead?
Yep,  I was going to do that actually,  but decided against to keep the cost down. 

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface - on a budget
« Reply #13 on: June 14, 2012, 08:00:52 am »
UPDATE:

It will now work without the need for a connected trackball/mouse.  This can be done by spoofing the mouse by bridinging 2 pins (clock and data) on the mouse port with a 10ohm (or other low value) resistor.  Credit to "John" on the CoinOps forum for this awesome contribution. 

If you have a connected mouse or trackball then obviously you won't need to do this spoof.


rablack97

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2215
  • Last login:August 09, 2024, 08:49:57 pm
  • If you don't try, you have no chance at innovation
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #14 on: June 14, 2012, 08:29:27 pm »
Will a 56k resistor work with this, i can't find a 58.3k anywhere.

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #15 on: June 15, 2012, 03:43:12 am »
yep,  that should be ok, it's the chips spec that says 58.3k.  I used a 59k resistor and these are easy to find.

Resistor sets the clock speed.  It shouldnt need to be super accurate.  I will run some tests with different value resistors to try to work out the range.
For now,  I would recommend 59k.  I will update my info too.

I got my 59k resistors from here for £0.03 each!
http://uk.farnell.com/jsp/search/productdetail.jsp?sku=1563238

I also found some 59k at RS in UK
http://uk.rs-online.com/web/p/through-hole-fixed/6833853/

and at mouser
http://uk.mouser.com/ProductDetail/Xicon/271-59K-RC/?qs=ALy0fn3lC2vlV%2feHSbQsmNFoA5s7tWTtdPV715ddMAk%3d

You should find similar at other suppliers.  Just look for 59k. 
I think I will remove reference to 58.3k,  they are difficult to source. 

Cheers



rablack97

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2215
  • Last login:August 09, 2024, 08:49:57 pm
  • If you don't try, you have no chance at innovation
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #16 on: June 17, 2012, 05:07:53 pm »
For folks with super solder skills, here is the layout for the ps/2 pin on the PCB.  You should be able to solder the wires to these points under the board, hot glue,  and wrap this around the backside into the chip.  It's not necessary, but just in case you want a cleaner look to the frag.

« Last Edit: June 17, 2012, 05:11:30 pm by rablack97 »

sharpfork

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 618
  • Last login:January 30, 2025, 08:21:36 am
    • KADE
Re: DIY Xbox Controller Interface - on a budget
« Reply #17 on: June 18, 2012, 12:00:37 am »
UPDATE:
It will now work without the need for a connected trackball/mouse.  This can be done by spoofing the mouse by bridinging 2 pins (clock and data) on the mouse port with a 10ohm (or other low value) resistor.  Credit to "John" on the CoinOps forum for this awesome contribution. 
If you have a connected mouse or trackball then obviously you won't need to do this spoof.

I assume you would spoof the keyboard side.  Would that allow a trackball to be plugged in as needed?
I have one of these kicking around that would be nice to try: http://www.sparkfun.com/products/10758

Also, can anyone recommend a US supplier for the non frag parts?  I can solder well but have only ordered parts in ready to solder kits and am afraid I'm going to but the wrong stuff and waste time.


degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #18 on: June 18, 2012, 04:03:50 am »
For folks with super solder skills, here is the layout for the ps/2 pin on the PCB.  You should be able to solder the wires to these points under the board, hot glue,  and wrap this around the backside into the chip.  It's not necessary, but just in case you want a cleaner look to the frag.
Very useful reference for this.  Thanks for the post. 

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface - on a budget
« Reply #19 on: June 18, 2012, 04:12:14 am »
UPDATE:
It will now work without the need for a connected trackball/mouse.  This can be done by spoofing the mouse by bridinging 2 pins (clock and data) on the mouse port with a 10ohm (or other low value) resistor.  Credit to "John" on the CoinOps forum for this awesome contribution. 
If you have a connected mouse or trackball then obviously you won't need to do this spoof.

I assume you would spoof the keyboard side.  Would that allow a trackball to be plugged in as needed?
I have one of these kicking around that would be nice to try: http://www.sparkfun.com/products/10758

Also, can anyone recommend a US supplier for the non frag parts?  I can solder well but have only ordered parts in ready to solder kits and am afraid I'm going to but the wrong stuff and waste time.

If you are plugging a trackball then you would not need to spoof at all:  The keyboard IC is connected to the keyboard port and does not need to be spoofed.

When I plug wires into the front of the smartjoy it makes it obvious that this port is used.  If wiring to the PCB then I would suggest desoldering and removing the keyboard port as I do not think it is possible to run 2 keyboard simultaneously.  Another option would be to have a switch to set input from keyboard IC or keyboard port.

SNAAKE

  • Trade Count: (+29)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3564
  • Last login:Today at 02:07:33 pm
  • my joystick is bigger than your joystick !
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #20 on: June 18, 2012, 03:22:41 pm »
modded xbox setup is serious bizness..only $800 :laugh2:
http://newyork.craigslist.org/que/vgm/3085689618.html

rablack97

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2215
  • Last login:August 09, 2024, 08:49:57 pm
  • If you don't try, you have no chance at innovation
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #21 on: June 18, 2012, 04:41:48 pm »
Maybe they are scarce in Queens.... :dunno

I heard the clear cases are rare........and I heard having exactly 300 games is super rare....I'd jump on that deal.... :lol

SNAAKE

  • Trade Count: (+29)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3564
  • Last login:Today at 02:07:33 pm
  • my joystick is bigger than your joystick !
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #22 on: June 18, 2012, 06:28:30 pm »
I like how hilariously bad the description is. doesn't even say what kind of hard drive. for all I know I am getting snes emulator with "300 games" :laugh2:

this guy gets some kind of "dumbest ad ever" award.

(sorry about the off topic..back to haxing) :burgerking:

sharpfork

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 618
  • Last login:January 30, 2025, 08:21:36 am
    • KADE
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #23 on: June 18, 2012, 06:29:08 pm »
The Spark Fun trackball should work just fine with an active PS/2 -> USB adapter ($2) plugged into a USB -> Xbox adapter. ($7) 
Not to derail the thread but they don't really work this way.  They work in XBMC but not in any of the emus.

sharpfork

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 618
  • Last login:January 30, 2025, 08:21:36 am
    • KADE
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #24 on: June 19, 2012, 12:29:17 am »
*shrug* People have reported it works fine with CoinOps 4.  Anything that's worked in XBMC has also worked in CoinOps for me.
If you remember where you saw that, please PM me and point me in the right direction.  i've tried 4 different trackballs in coinops 2/3/4 and only the xArcade one works.
I'm going to build a couple of these and see how the sparkfun cheepo works in coinops too.
« Last Edit: June 19, 2012, 01:50:46 am by sharpfork »

ark_ader

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5645
  • Last login:March 02, 2019, 07:35:34 pm
  • I glow in the dark.
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #25 on: June 19, 2012, 07:59:43 am »
*shrug* People have reported it works fine with CoinOps 4.  Anything that's worked in XBMC has also worked in CoinOps for me.
If you remember where you saw that, please PM me and point me in the right direction.  i've tried 4 different trackballs in coinops 2/3/4 and only the xArcade one works.
I'm going to build a couple of these and see how the sparkfun cheepo works in coinops too.

PBJ is spot on there.  I have tried Kensington trackballs that work great with Coinops 4.  I have a bunch of GoldenT TV trackballs that are working fine (obviously mouse hacked).

My old Penny PS/2 trackball works a treat.  Had problems saving the settings with Coinops 3 but I will try tonight with CoinOPS 4 and see if that has been fixed.

BP did a lot of work getting trackball and mouse working.  I do not know about light gun as I have only one TV light gun for the Xbox and have yet to hook it up to a conventional TV.  Topguns work though.  ;D
If I had only one wish, it would be for three more wishes.

rablack97

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2215
  • Last login:August 09, 2024, 08:49:57 pm
  • If you don't try, you have no chance at innovation
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #26 on: June 24, 2012, 11:11:05 pm »
This is my first attempt at fabricating my own pcb board from scratch, came out pretty darn good.  This was just for fun, but the idea is to be able to plug the PCB  into the smartjoy and give you terminal blocks to wire too, same concept just prettier I guess. 

I don't know jack squat about electrical or connections, i just looked at degenetrons video and took a stab at it.  I plan on getting some sockets as they are only .37 cents a piece, and soldering that to the board, my solder skills arent that great so i dont want to ruin the chips.  Also, if a chip ever fails i can just pop the old out and plug in a new one.

Any suggestions would be great or pointing out where i screwed up or what i could do different.  Or the old this was stupid why in the hell did you did you do that reply.... :dunno  This was more of a see if i could do it thing.. :cheers:



degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #27 on: June 25, 2012, 05:25:53 am »
Wow!  This is pretty neat for a first attempt Rablack!  Good work.  I will take a closer look at the circuit later.

I have some important findings after running more vigourous testing of the hack...

I encountered a blocking issue when using the analog directions.  Analog is mapped to W, A, S and D on the keyboard.  Basically,  the IC uses a keyboard matrix and unfortunately these keys are mostly assigned to the same pins.  There is a limit on the number of keys that can be pressed on the same pin on this cheap keyboard IC :(
A potential workaround is to reprogram the smartjoy to use other keys for the analog directions.  I will take a look at this.

I have this working perfectly when using the dpad directions.  There is more flexibility with arrow keys on the matrix table - there are 2 sets of direction keys so we can avoid conflicts.
So here is my setup and recommendation for your key mappings:



With this setup you can move all directions (incl diagonals) and have 4 buttons pressed simulateously.  I am using 14 buttons in my cab.
I added the analog keys (in light gray) for reference purposes.  These should be avoided until I work out a fix  :banghead:

I will take a look to see if there is a better 40pin IC keyboard chip so we can use with the analog directions.

« Last Edit: June 25, 2012, 05:33:31 am by degenatrons »

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #28 on: June 25, 2012, 08:08:07 am »
ok,  I think i can workaround any blocking issue by reprogramming the smartjoys key mappings.

Note that reprogramming will not be necessary if you want to use d-pad and the default key combination from my previous post.

Smart joy reprogramming:
It is done by connecting a PS/2 keyboard to the keyboard port.
There are 8 presets which can be loaded by pressing function keys F1 through to F8
The factory default can be recalled by pressing F12
It is possible to change key mappings for all buttons.  It is not possible to change key mappings for analog sticks.
To get this working properly with analog we need to reassign other buttons so they don't conflict with the assigned analog direction keys (W, A, S and D)
To change a key mapping...
  press and hold down the ESC key,  press the key to change,  press the new key (e.g.  The smartjoy default key for X button is the X key.  X appears on the same row in the key matrix as the analog up and down.  We could remap to Left-Shift key which is on a row (R15) and otherwise unused.
A couple of other simple changes and we remove the blocking.
To save a preset press ESC and one of the function keys together.
To load a preset press one of the function keys.
To get the preset to load on startup we can wire 2 pins together.  F5 is a good key to use as it does not share pins with other default keys.

These are just some notes of the top of my head to alleviate my own concerns with the analog mappings.
To reprogram,  we need to know the sequence of key presses.
I will test this (when i get another smartjoy delivered) and publish the sequence.

rablack97

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2215
  • Last login:August 09, 2024, 08:49:57 pm
  • If you don't try, you have no chance at innovation
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #29 on: June 25, 2012, 08:31:53 am »
Thanks, although it's trash now that you've waited to point out this blocking issue. :angry: :banghead: :soapbox: :badmood:

LOL, no worries though this was a prototype, and I still need to do some hole placement adjustments and I'm sure once you look at the circuits you will see that I did didnt complete my ground loop from the resistor to the chip.  I think when i did my auto-route it erased the trace in between both resistors..I noticed it once i posted the blown up picture on here..... :banghead: :banghead:

Once I figured out how you were wiring the jstik and buttons, I was like how in the world am I gonna get traces to all of these pins.  That's what i came up with after a few hours.  It didnt dawn on me that you dont have to use the whole matrix on your video, some dont apply to the xbox config.

Ok, on these ananlog sticks, my question is how often are they used in the mini arcade setup?  You only have one stick, and even if you have a 2-player setup it would be awkward.  The D-pad should be plenty or are you saying there is no diagonal movement on the D-pad setup?

Something i was pondering was using the xbox to usb adaptor and placing a passthrough via player 2 somewhere on the side or in the front....So if anyone using it wants to use a stick, they just pug into it.  This would also help with some of the coin ops configuration issues.  You could label it service or something.

Let me know what you find and I'll redo the traces.  Also before i order the rest of the parts, is this something you'd be interested in seeing completed?  I dont want to jam up your thread with crud that you dont feel will help the project.
« Last Edit: June 25, 2012, 08:36:07 am by rablack97 »

sharpfork

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 618
  • Last login:January 30, 2025, 08:21:36 am
    • KADE
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #30 on: June 25, 2012, 11:14:59 am »
Is working analog stick mapping a requirement for this project or a nice to have?   ???

When I started doing encoder testing with padhacks, I mapped every single every control I thought I would use in an xbox controller and that meant I included the shoulder buttons and the analog clicks.  I have never once wished that I had analog sticks other than a few emu cores needing it for initial screen config which I do by temporarily plugging a pad in.

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #31 on: June 25, 2012, 11:27:21 am »
Hey rablack,

Thanks.

I always map to the dpad and I reckon this is the most common approach.  However,  I thought I had better mention the analog stick blocking because someone might want to do that.
If you use the mapping table from my earlier post then you won't have problems.  D-pad includes diagonals by combining direction keys.  I tested diaganals and 4 button presses together in my cab with this setup.

I can workaround the analog blocking issue by reprogramming the smartjoy.  Maybe this will not be a requirement though.

For a basic cab setup,  which is probably the most common for xbox cabs then we are fine and as you say,  we can disregard some of the pins.  



We need 16 pins for this setup (d-pad, A,B,X,Y,LT,RT,White,Black,Start,Back).
Pins are C0,C1,C2,C3,C4,C5,R1,R2,R4,R5,R7,R10,R11,R12,R13,R14

I think we can simplify your schematic if we stick to these pins.  Unless anyone thinks we should map to more.
If we add R3 then we are covered for both thumb stick presses too.  Not sure if this is of great benefit.  If I need to do something outside of gaming then i normally plug in a controller anyhow - I mount the controller ports in the back panel normally.
I would add R3 so we need 17 pins for mappings + pins for PS/2 lines and oscillator.

I don't understand how your terminal block arrangement would work on your pcb.  Maybe you should add traces between IC pins and the terminal.  I'm assuming this would currently require wiring from IC to terminals.
I would recommend breadboarding this out to make sure it works before commiting to PCB production.  Also,  need to decide if our basic keymappings is what people want.  

I appreciate your contribution and you are helping the project.  Keep posting.  Thanks.

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #32 on: June 25, 2012, 11:35:26 am »
Is working analog stick mapping a requirement for this project or a nice to have?   ???

When I started doing encoder testing with padhacks, I mapped every single every control I thought I would use in an xbox controller and that meant I included the shoulder buttons and the analog clicks.  I have never once wished that I had analog sticks other than a few emu cores needing it for initial screen config which I do by temporarily plugging a pad in.

Hey thanks sharp. 

Thanks for that post.  It is a weight of my mind now.  Analog is a nice to have,  and it is possible if i reprogram the presets on the smartjoy.  However,  I would rather not do that.

I think we should run with d-pad and my working arrangement (as per table) then this would be working without issue.

Do you think there is any point in including mappings for L & R thumbstick press?


degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #33 on: June 25, 2012, 11:44:01 am »
I think you answered my question about the L/R thumbs already sharpfork.  Thanks.

We should not include them and keep this nice and easy.  Any config needs doing,  then plug in a controller.

So we need 16 pins for input.

Rablack - If it will help you i don't mind knocking up a schematic for the circuit.  Your earlier PCB is etched really well but I think it needs some work on mapping inputs from terminals to PCB.  Are you using some design tool?

sharpfork

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 618
  • Last login:January 30, 2025, 08:21:36 am
    • KADE
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #34 on: June 25, 2012, 12:03:33 pm »
Hey thanks sharp.  Thanks for that post.
No problem.  I do a bit of software product management and architecting in my job so I'm used to keeping engineers/coders on track.  :cheers:
I don't want to see secondary use cases derail a great project.

On another note, I'm not going to be including analog clicks on my final CP, I want it as clean as possible.  I'm debating if I should even add the left/right triggers since scrolling via D pad has been sped up when held.
« Last Edit: June 25, 2012, 12:09:13 pm by sharpfork »

rablack97

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2215
  • Last login:August 09, 2024, 08:49:57 pm
  • If you don't try, you have no chance at innovation
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #35 on: June 25, 2012, 01:47:42 pm »
I agree with you both, thumbsticks for this application is null and void.

The only time you would really use them for CoinOps would be for screen resizing which is available for certain games, and reconfiguration of your button layout, which also is only available on certain games.

I think your basic layout should suit just fine.

I'm using a application called Pad2Pad, its free....I can send you the file I was working on if you dont want to work from scratch via email.

There are others out there, but since i'm a beginner at this, this app seemed to be more user friendly than the others.

I'm a bit confused on your confusion on the traces....I thought that's what i was doing was mapping IC pins to the terminal blocks?

Per your matrix there are some keys that require the use of the same pin.  So what i did was look at your first matrix chart(video), pick out the keys I wanted to use and used a filter to find out how many times that pin was used.  So for example in your new schematic pin C1 is used 5 times, so I connected 5 terminals to that pin.

My thinking was in order for the connection to produce the movement the circuit had to be closed, + to R1, - to C1, so even thought the trace is attach horizontally to the adjacent terminals it wouldn't matter unless those buttons were pressed to complete their circuits to the other pins.

Unless your talking about branching out the traces before they reach the terminal blocks.  If so, there was a spacing issue with the other traces, and that's why it looks like it does now.

I'm not an expert, so i'm logically going through the motions on this, i look for you and the forum to keep me grounded on the realism of what works and what doesn't.

Let me know if you want the file to toy around with, i'll look at your new matrix tonight.

I'm gonna drill some holes in this thing tonight to make sure eveything fits.

Question, would the spoof resistor totally screw up the ps/2 interface for the mouse?  If we hard soldered the resistor under the board, and plugged in a trackball etc, would it not work....Just asking as a switch to toggle between spoof mode and ps/2 interface mode would be cool for upgrade purposes..or is that even possible.

I was thinking about removing the mouse jack and using it for the prototype PCB we are working on...to save a few dollars, but that would totally rule out ever upgrading the smart joy with a trackball.  Any thoughts?
« Last Edit: June 25, 2012, 02:07:41 pm by rablack97 »

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #36 on: June 25, 2012, 03:42:39 pm »
I think we are agreed on the layout then.  Nice one. 

I take onboard what pinballjim is saying re: box games with analog, but this would overcomplicate this project.  For these games it is more authentic to plug in an xbox controller anyhow.

I have done a fair bit of electronics but have never had to make a PCB so this is a learning curve for me too!  I will take a look at pad2pad.  It would be cool if you would send the file.

Sorry,  I misinterpreted your layout.  It looks good.  I took a quick look earlier and assumed the IC was top of photo when viewed from my mobile.  It was only when I got home I noticed the black lines surrounding the IC.   So no confusion about the traces and your reasoning if correct re: the connections being closed.  It is a very good attempt and you have included a good idea to hang multiple terminals per pin.

So,  this would need to be updated to use the new matrix table.

A couple of thoughts.
The terminals can be bigger than 0.1" pitch.  The 0.2" and above ones will be significantly cheaper.

For terminals, we can use fewer if we share them..or..
If we have a dedicated terminal for each connection then this makes it possible to logically group them.  The traces can go around the IC so that terminals are next to each other in a line e.g.  An 8 way terminals could be arranged as |up1|up2|down1|down2|left1|left2|right1|right2|.  It would then be super easy to connect controls.
There is an argument either way, less terminals is simper layout and cheaper. More terminals has better order and usability.

A connected mouse would not work with the resistor in place.  A simple switch can cut the resistors connection from clock to data to allow mouse to function.  This could be labelled as trackball/no trackball.
To save cost you could leave of the port but keep traces and mount holes in place.  I have seen this on some other PCB's.  If someone wants a trackball they can add the port or solder wires direct to PCB.
Or you could have 4 screw terminals for trackball (Live|Ground|Clock|Data).

One of the above options should make it possible to keep the trackball. 

Great work Rablack  :applaud:.  This is coming on nice,  I think.

sharpfork

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 618
  • Last login:January 30, 2025, 08:21:36 am
    • KADE
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #37 on: June 25, 2012, 04:09:41 pm »
More terminals has better order and usability.
More terminals please...

I agree with you both, thumbsticks for this application is null and void.

Question, would the spoof resistor totally screw up the ps/2 interface for the mouse?  If we hard soldered the resistor under the board, and plugged in a trackball etc, would it not work....Just asking as a switch to toggle between spoof mode and ps/2 interface mode would be cool for upgrade purposes..or is that even possible.

I was thinking about removing the mouse jack and using it for the prototype PCB we are working on...to save a few dollars, but that would totally rule out ever upgrading the smart joy with a trackball.  Any thoughts?
Unless there is a reason to keep the programability, I was planning on pulling the keyboard jack and putting the resistor on that side.  I would think this would allow that ability to add in a trackball or mouse if needed.

You don't need analog support for CoinOps, you will need it if you plan on playing any Xbox games. 
For instance, Gauntlet Dark Legacy is decently ported to Xbox.  Can't play it with the d-pad.  This is where the X Arcade encoder really excels as you can easily switch modes.
It is cool that the xArcade does that.  I just pull out a gamepad on the rare occasion I play an xBox1 game.


degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #38 on: June 25, 2012, 04:45:32 pm »
johnm offered a really neat solution...

to use 16-way ribbon cable

This would be really tidy and super easy to connect to PCB and controls.  :applaud:  Thanks John
There could be a single 16-way connector mounted on the PCB.  The cable would have 16-way header on one side and 4.7mm or 6.3mm terminals on the other side so it would double up as a wiring harness.
I have seen this type of arrangement with Xin-Mo encoder.  This made use of lots of 4-way headers so you could connect 4 directions and 4, 8 or 12 buttons.

For the pcb,  we could simply plug the whole cable in one go like an IDE cable. 

This is a lot simpler and a lot cheaper.  The 16-way cable is about £1/metre on ebay.

« Last Edit: June 25, 2012, 04:48:35 pm by degenatrons »

rablack97

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2215
  • Last login:August 09, 2024, 08:49:57 pm
  • If you don't try, you have no chance at innovation
Re: DIY Xbox Controller Interface on a budget *UPDATED and with Video*
« Reply #39 on: June 25, 2012, 05:36:57 pm »
Links man links, I need to see what your talking about......I'm visual.

16 way ribbon cable with terminals.....graphics please.