Universal PCB (eventually) thread

Version 2.5 released! Currently tested and supported systems:
-Xbox
-Gamecube
-PC USB
-PSX
-PS2
-PS3
-NeoGeo
-NES
-SNES
-Sega Saturn
-Sega Genesis (3 and 6 button)

Coded and believed to work, but not tested:

-Sega MasterSystem
-TurboGrafx-16 (2 and 6 button)
-Atari Jaguar
-3DO
-FM-Towns
-X68000 (2 button)
-Amiga CD32
-Most old DB-9 controller systems from the 80’s like Commodore 64’s.

Other features:

  • On-the-Fly button remapping using a Programming button: Hold the button you want to remap, press the programming button, hold down the buttons you want the original button to be (or none if you want the button disabled), release the programming button.
  • Ability to make your mappings permanent: Hold down the programming button, press start three times. Mappings are different for each system, so your NeoGeo mapping can be totally different from your PSX mapping.
  • ‘Tournament Mode’ to disable or enable the Start button via keypress: Hold Select and Start, press Up to enable Tournament Mode. To disable Tournament Mode, hold Select and Start and press Down. Tournament mode settings are NOT saved, so Tournament Mode is always disabled when you first plug the stick in.
  • ‘Turbo’, adjustable button rapid fire: Press Program by itself, and hold it. Press and hold the button you want to change the speed of. Press Up to make the speed faster, and Down to make the speed slower. ‘No turbo’ is the same as ‘fastest turbo’, so to turn it on initially, you’ll need to go Down.

Imagine you buy a new Sega Saturn, and you’ve never had one before. You do already have a fighting stick with the UPCB in it that you play all the time on other systems. In order to use your stick on the new Saturn, you would need 1. A Saturn plug, either from an extension cable or a sacrificed or dead controller. 2. A DB-15 plug and hood. Total cost to play the stick on the new system, somewhere between $1 and $5. That’s the goal of project, to support as many systems extremely cheaply.

Months down the road, a new game system, the XCube3, comes out and you want to play your stick on it. The XCube3 wasn’t even out when your UPCB was made, so you think you’re stuck. But, as soon as the controller protocol is supported in UPCB, here’s what you have to do: 1. Plug the stick into your PC with the same cable you use to play PC games and mame. 2. Run a program that updates the UPCB 3. Make a cable just like above. UPCB can be updated anytime without even needing to open the stick, and with the same cable you’ve already got.

Here is the updated schematic. Sorry for the huge size of the image.
http://www.marcuspost.com/downloads/upcb/UPCB_Schematic_21.jpg
Here are the ‘Gerber’ files for the Rev 2.1 board. Any PCB fabrication service can use these to stamp out as many as you could possibly want.
http://marcuspost.com/downloads/upcb/Rev2.1.zip

The core is the 18LF4550 I/P ‘PIC’ microcontroller. The crystal is 20 MHz, and the unmarked resistors are just pull-ups, so any high resistance resistor will work (go with 4.7k ohms). C1 and C2 are just small ceramic caps; I’ve been using 0.1uf. Put them as close as possible to the two pairs of power pins on the PIC. The location and value of the C3 electrolytic cap is not too important; I’ve been using 33uF caps.

Here is the sourcecode using MPLAB and Microchip’s C18 compiler : http://marcuspost.com/downloads/upcb/UPCB_25.zip
Procompiled .HEX files are in there under the ‘_output’ directory.
I’m using a new naming structure for the .HEX files. Check the ‘Which one do I use’ file to make sure you use the one that matches your setup.

Instructables:
How to Assemble a UPCB: http://www.instructables.com/id/ETNJA2CF23Z33K8/
How to Create a Console Cable: http://www.instructables.com/id/E9SM77YF1Y7H1KH/
How to Create a USB Button Select Cable:http://www.instructables.com/id/EO5ISEYF2FRV8XH/
How to Upgrade the UPCB Firmware: http://www.instructables.com/id/E9A4ERZF2FRV8RG/
How to Install a UPCB in a HRAP2: http://www.instructables.com/id/EDZKJN6F2NOBR7S/
How to Piggyback a Dreamcast Controller:http://www.instructables.com/id/ELYFIVKF54HJ3K4/
How to Piggyback an Xbox360 controller:http://www.instructables.com/id/How-to-Piggyback-an-Xbox360-controller-on-a-Univer/

Q: So how does the UPCB know which system it’s connected to?
A: Pins on the 15 pin connector that aren’t used are tied either high or low. Based on which pins are tied where, the UPCB detects which system it is and acts accordingly. The pinouts must match what the UPCB expects exactly. The see the currently assigned values, check the systemselect.txt file in the ZIP.

Q: How would I make one of these?
A: Any way you like. You can make one one a breadboard, on some type of prototyping board like the one I’ve been testing with, etch your own PCB, have a PCB fab house make a PCB for you, whatever. Fabbed PCB’s are available for sell: http://forums.shoryuken.com/showthread.php?p=3991373#post3991373 The files required to have your own manufactured are available here: http://www.marcuspost.com/downloads/upcb/Rev2.1.zip
I highly recommend having a professional fab house make them; doing that many vias by hand etching your own from those files would suck.

Q: How do I program the PIC in it?
A: Once the bootloader has been programmed on it, you use the USB cable to update the PIC.
In order to get the bootloader on it, that would require a PIC programmer of some sorts. Since it’s only needed once, you just have to find someone to program it that first time. I’ll happily program a PIC for anyone who sends them to me, as long as they send me postage for mailing it back.
Or you can get a PIC programmers and start learning microcontrollers. They’re kinda fun.

Q: What’s the deal with PS2 support?
A: The UPCB currently works marvelously for every Playstation 2 game I test it with. Previous problems have been eliminated. As of yet, I have not found any converters it works with, and since I’ve tested something like 4 different converters (old PSX->USB Radio Shack model, Pelican PS2->PS3, Innovation PS2->DC, and Magic Box PS2->Xbox) and none of them worked, I do not have high hopes for any other converters to work. [Side note: Magic Box and Innocation converters work just peachy with the UPCB’s Saturn support.] This will be addressed in the future.

Q: You have USB. What about PS3 support?
A: PS3 support is in and working, including PSX button support. Tested successfully on 20GB, 40GB, and 60GB models, including backwards compatibility and PSX button.

Q: How is this different from a project box setup?
A: Good question. First of all, you can use project boxes with the UPCB. Just ground pin 9 so the UPCB thinks its connected to a Neo-Geo, and make sure the project box pinout matches. So, all of the advantage of a project box setup are there. Here’s a short list of what makes the UPCB better.

  1. If you do use project boxes, then any project box interface you make will have the benefit of programabilty (once I code programming into it)
  2. Project box setups require a sacrifice controller, a project box, and a jack. For systems supported by the UPCB, you only require a cable (third party extension cables are tons cheaper than new controllers), a jack, and a hood (which are tons cheaper than project boxes).
  3. Most project boxes can’t really be securely attached. (GoPodular’s IDC cable and velcro method is one exception) Using a D-Sub hood with thumbscrews means you can attach the cable very securely. If you tripped over an attached serial cable, you’re PC would go flying. Project boxes have pressure and weight that can cause them to loosen.
  4. Soldering wires into the D-Sub jacks is much cleaner and easier that some pad hacking.
  5. If you do use project boxes and are using the optional Programming button, then any project box interface you make will also have the benefit of on-the-fly button remapping. These mappings can be permanently saved like every other system.
  6. Tournament Mode is still usable with project box interfaces.

Q: What would this cost for me to make?
A: The most expensive item is easily the PIC. However, you can sample 3 of them for free from Microchip.com. The rest of the parts are pretty cheap. A Digikey shopping list is already in this thread; also kits with everything but the PIC are available to purchase: http://forums.shoryuken.com/showthread.php?p=3991373#post3991373

Q: What about Xbox360 support?
A: Unless someone cracks the protection Microsoft uses to make sure you use their controllers, it ain’t gonna happen. You can still use a Xbox360 project box, or piggyback a Xbox360 PCB. More on the piggybacking in a bit.

Q: What about Dreamcast support?
A: Dreamcast is gonna be hard, but I havent given up hope on it. For a good while, Dreamcast won’t be supported, but I hope to figure out how to do it eventually. You can still use a Dreamcast project box, piggyback a Dreamcast PCB, or use the working Saturn support with a Saturn->Dreamcast converter like the Innovation.

Q: So what’s this about piggybacking?
A: Both of the main problem systems (DC and X360) use two wires for communication. So, it is possible to use an analog switch IC to ignore the wires from those controllers until we want them. What this means is that you can install the UPCB along side a DC or X360 PCB, connect them together all clean inside your stick, and have a Dreamcast or Xbox360 cable connecting to the jack on the back like normal. Unless they open the stick, it’ll look just like the DC or Xbox360 was naturally supported.
Piggybacked systems can NOT take advantage of button remapping, however they CAN take advantage of Tournament Mode.

Q: What about the Xbox?
A: Xbox is now tested and working. There is not, nor will there likely ever be, support for Xbox memory cards or headsets.

Q: Gamecube? N64?
A: Gamecube support is in and works awesome. N64 should be dead easy to implement, but I don’t have one to test with. As soon as I do, it’ll be in.

Q: What’s this about Smash Brothers working with a stick?
A: There are two Gamecube modes specifically for Smash Brothers: one simple mode that tries to capture the ease of the Wiimote-Only control scheme from Brawl, and another advanced mode that tries to make everything possible. Please read for more information, and feel free to suggest improvements. http://forums.shoryuken.com/showpost.php?p=5171213&postcount=477

Q: How big is the PCB itself?
A: 82.2mm x 67.3mm. Assembled, its about 14mm tall depending on the components. One of the connectors hangs over the edge a little, making the assembled length about 85mm.

Q: What is the option Programming button do?
A: Support for recording and playback is expected, but is not implemented yet. The current features of having a programming button are:
1. Using a USB Button Select cable, you can press this instead of Start & Select to go into bootloader mode for reprogramming the PIC.
2. On-the-fly button remapping. Press the button you want to remap, hold down the programming button, hold down the buttons you want the original buttons to press, or none at all if that’s your taste, and release the programming button. You can make your mappings permanent for that system by holding the programming button and pressing Start 3 times.
3. Turbo mode. Press and hold Program, then press and hold the button you want to adjust the rapid fire speed of, and move the stick up or down to adjust the speed. ‘Fastest’ is the same as no turbo at all.

Q: I hear about this ‘button select’ stuff, like the ‘button select USB cable’. What other options are there when plugging the UPCB in?
A:

Q: I’m having a problem updating the firmware with Vista. I’m receiving an ‘error 997’
A:

For those who need help assembling the rev 2 board, here is the board with the resistors and capacitors labelled, and the pinout for each direction/button. Buttons are labeled in their usual Street Fighter name: JAB, STRong, FIErce, SHOrt, FORward, ROUndhouse, SELect, STArt. EX0 is the optional fourth punch button, EX1 is the optional fourth kick button.

http://img61.imageshack.us/img61/5972/labelledupcb21qx9.jpg

thats fucking awesome man, keep us posted for sure

Oh my god.

that’s freaking awesome.

You going to evo2k7? I owe you a beer.

edit:

Since you’ve got it going one way, that being, parallel in->serial(typically) out…

I don’t suppose you’ve thought about doing it the other way for us supergun builders, do you?

this is epic,
goddamn toodles…goddamn.
if you manage 5+V support i’ll make sure every stick i ever touch uses this

Actually, toodles already linked to a step-up product that’ll work with the PS/PS2 sticks…

(i’m fairly certain it works for ps/ps2 sticks)

i know hes putting it on the flash and i SUCK at electronics completely but im wondering if its possible so that when i “add a pad” to the upcb i can 5+ wire (since the db15 is “full” maybe on the db itself) and update it so it’ll work flawlessy with a p360/flash
or is that impossible at all? (i dont know circuitry at all so that pic is gibberish to me)

other than finding a +5v, it should work, since it uses common grounds for all the buttons and stick directions.

Thanks for the kind words guys. Some how I managed to go from 1200 rep to 3000 rep after a single +rep. Weird.

The ‘LF’ in the 18LF4550 means it works over a wide voltage range, including the 3.? volts the playstation supplies. Because the voltage used for high and low is based off of the input voltage, it’s actually best for the pic to be directly powered by the PSX. However there’s no reason you can’t use a DC-DC conveter before the stick. I want this to be able to handle any option you want to throw at it, and putting in a DC-DC converter is very doable. I’m not sure if I want to put one into the fab’ed pcb because it’s a solid 1 inch square of real estate. On the other hand, I am definitely not fighting for room like with the flash. I’ll think about it.

I doubt I’ll be at Evo this year. Just too damn poor at the moment.
As for use on a supergun, since it has a Neo-geo mode, you should be able to use a UPCB stick on a supergun just fine; I’ve been testing the neogeo mode on my CMVS as well as the few project boxes that were used with Bone Daddy but not stolen. But I know that’s not what you mean. You’re wondering about having it act as a PSX->Neo/Supergun converter, so you can put a pair in a supergun and have PSX sticks work on your supergun. That is not immediately possible with the code and schematic above, but it wouldn’t take much tweaking to make it happen. A couple of pull up resistors on the PSX lines would be needed, and the code rewritten. Ask me in again in a couple of weeks when the PSX code isn’t pissing me off so bad.

Speaking of PSX code, I realized what I did different when PS2 games worked. The PSX code in the release uses the serial SPI module to take care of the handing of bits back and forth. THe one that worked on PS2 was using ‘bitbanged’ serial where I controlled the pins directly. Gimme a coule of days to play and test and PS2 games should work fine. PSX converters are just being a bitch and I doubt I’ll be able to fix those without a damn Oscope.

If anyone has a cheap 2-4 channel >25MHz oscilliscope they’d be willing to donate or sell cheap, please let me know.

yeah, very weird… =P

But onto the questions

-Do you intend to have this reproduced like you were going to do with the flash, or is this a diy thing?

-Is it possible to address the pause issues through the programming?

-Is there anyway to emulate the 360’s signal to get around the hardware key, or will this just not work on 360 for now?

Random tidbits:
-Wii. According to a site I found last weekend, the Wiimote communicates with peripherals using a protocol called I2C, which the PIC supports natively. As soon as I get some more information about the specifics used with the ‘Classic Controller’, having the UPCB act as a classic controller and plugging into a wiimote shouldn’t be too hard.

-Dreamcast. I won’t lie, DC is gonna be hard, and it may be a long damn time before its supported, if ever. The funky protocol plus the high speed means at best I’d have 6 instructions per bit coming in, and Id have to use them all just to catch the bit when its sent. Im seriously thinking that the only poosibilities are to either figure out how in the hell the Innovation converter does it (it also uses a PIC microcontroller, and an older/slower one at that. It has this weird tristate gate and transistor that are doing something to the signal, hopefully to make it easier for the PIC to communicate with. But I dont know if Im that smart. Im mapping it out and it just doesnt make any sense, and I can’t peek at the PIC code because none of my programmers support that PIC.) or use a small but fast microcontroller in the hood to convert the DC signal into a format the SPI on the main PIC can use. But I do have a bitof a workaround I’m going to try and put into the fab’ed PCB. More on this in a sec. Because the Saturn protocol is simple and supported by the Innovation controller, my current hope is that my Saturn support will work with the innovation so I can keep playing.

-Xbox360. Probably will never be supported. Instead of a difficult and fast protocol like the DC, this one is just a malicious attempt by MS to prevent this very sort of thing. Until someone figures out how to get around it via software, this just isnt going to happen, and I’m not bunnie. Im not smart enough to crack it. Which leads us to a similar workaround…

-Using additional hacked PCB’s along with the UPCB. The DC uses two wires. The 360 uses two wires. One thing I plan to add for the fabbed pcb is a spot for an analog IC, the same one used for turning the 360 controller into a common ground setup. THe idea is to have two of the currently unused pins (RB7 and RB6 I’m thinking, since if they are used, there is no need to debug the PIC with the ICSP header.) each controlling the two switches for that system. What this means is that you have a DC pcb, and install it in the stick. The four wires that normally go to the cable get wired to the UPCB for power, GND, and the two data lines. You have a DC cable hacked to a D-Sub like normal, and because of the pins tied high and low, the UPCB think ‘Oh, he wants to use the DC pcb’, turns on the switches so the data lines to the DC pcb are connected, and goes to sleep. When not using DC, the data lines wont be connected and since the DC PCB is powered, wont interfere with normal operation. Ditto the same for an Xbox 360 pcb, but you’d have to use a couple more analog switch IC’s to make the 360 pcb work with common grounds. If a software solution ever becomes possible, believe me, I’ll take it. But I think this is a better option than an external project box.

  1. If there is a demand, sure. I plan on getting a batch of PCB’s made, mainly so I can have a clean pcb to use, and I’ll hapiily sell the rest of the batch off, and if there’s demand, of course I’ll run more batches for sell. But there is no need to rely on me or give me a damn cent. The schematic, HEX files, and source code are all above, and will continue to be. Anyone could grab a prototyping board or even etch their own pcb without anything having to do with me. This is a VERY niche thing afterall, so I have no delusions about this being a money maker.

  2. Im not familiar with what you mean. If you can tell me more, I’ll tell you what I have planned. Of course, since the source will be open, anyone can fix any problems.

  3. See above. So far, no.

Alright one last little tidbit for now that I’m really hoping for down the line. The LF4550 does come in very small surface mount size. I’m kinda hoping some time down the road of making a UPCB replacement for SNES and six button Saturn pads :slight_smile:

If you mash a move you run the risk of hitting the pause button, like mvc2 hailstorms, damage reduction in a3, getting out of holds, stun, etc…

We do need the start button to play, but if it worked differently maybe that problem wouldn’t happen, like if it were changed to not send the signal unless it was held down for a second, or anything other than a single button press.

oh, you mean a like a ‘tournament mode’. Absolutely. I can even leave the select unaffected so taunting is possible, but pausing isn’t. If DC ever gets implemented, I plan on having the select button emulate short+start, so again taunting is possible but not pausing. Maybe I just really want to see Ryu’s SFA3 fake fireball more.

Having it only register if its the only button I really wouldnt be comfortable with; you wouldn’t ever be able to soft reset on DC or PS2, or enter the UniBios in game menu on NeoGeo. If only held down for a second is doable, but would have to wait until I put in the routines for programmability. How about a key combination to enable or disable the start button?

Anyone have recommendations for a key combination using the standard stick, six button+start & select to enable/disable tournament mode? Im thinking Up+Select+Start to enable it, and Down+Select+Start to disable it.

If anyone thinks Select should be disable-able, please say so. I can’t think of any games where it’d be a problem.

It would also be possible to save whether to use tournament mode to the EEPROM, so even if you unplug the controller and plug into another console, tournament mode would still be enabled until you manually disable it with the key combo. Opinions?

lp,lp,forward,lk,hp?

that seems fine
if i had the upcb install i’d wire a led to illuminate if tourney mode is on or off

As of right now, there are 5 unused pins. Two of them (the mentioned RB7 an RB6) cant really be used for an LED or button because that would interfere with using the ICSP connection for debugging. Since this wont be a problem when used with the internal pcb hacks (the DC and 360 I mentioned above), they’re pretty much assigned for that duty.

That leaves three that don’t have any set assignment. I can directly control 6 LED’s with all three, or 3 dual color LED’s (the ones that can be Red, Green, or Orage) without any extra hardware. I’ve been using two of them as LEDs for testing, but they can be used for just about anything. I was thinking of setting one aside as a optional button for recorded playback. That leaves use with two pins, and I’m starting to think a single dual color LED would be best. With three colors and the ability to flash, that’s a lot of information.

There’s lots of other possibilities with two wires though. I could connect an I2C eeprom for more storage. Use it to connect to another UPCB to send commands as needed for the ultimate in a training mode dummy. So many options. The main thing is I want is to have the minimum specs needed to use it be the eight buttons and stick.

PS2 is fixed. From what I can tell, the bootloader was using one set of configuration bits, while the main program uses its own. I made the hex file using the bootloader’s config, which I gather is just too slow to keep up with the PS2, but barely enough to keep up with the PSX mode (controller clock is 250KHz in PSX mode, and 500KHz in PS2 mode). I may just hunt down the bootloader config, but for now, I’ll just leave the config bits in the main program and tell the bootload program to use the new config instead. I’ll update the zip package to 1.2 as soon as I get a few old school consoles supported, especially Saturn, and hopefully a tested PS3 USB.

Umm, anyone own a saturn and have any input on the buttons? I was planning ABC for short, forward, roundhouse, and XYZ for jap strong feirce, start is of course start, but what about L and R? I could make one select, but I still would have one left over. Any saturn owners got an opinion? Ima gonna check what MAS does… Grr, cant tell what MAS does. How do you taunt in the Saturn SFA3?

What about those of us who want a hybrid SNK/Capcom layout?

that being
ABCD
KKKK

?

I’m all over it. Time to go order some free samples.

If you do order some free samples, you can order I think up to 3 pieces of up to four different PIC’s, so do a little research and make the most of the other PIC’s you can sample. 12F675’s are great little PIC’s, and I know the open source modchips for the Wii use them. 12F629’s are the exact same, except dont have the A/D converter. Both are great little 8 pin devices and uber usefull. The 16F88 are I think one of the best of the 18 pins, and of course the 18LF4550 is just a monster of a 40 pin PIC. Just make sure to check the package when sampling to ensure you get a PDIP version if you don’t want to do surface mount soldering.

If you use the six button SF layout, ABCD is currently jab-short-strong-forward. I plan on having a key combination change that when in neo mode, so you can toggle between that and having ABCD be short-jab-strong-fierce. Along with the ‘tournament mode’, the setting will be saved to EEPROM so it remains until you manually change it.

I’m thinking about putting in some compile time #defines for the optional pins, like one for two play buttons like you’re describing, one for two buttons specifically for record/playback, one for a pair of LED’s, and one for a single red/green led. The downside is I’d have to recompile and export the main hex 6 times for each release :frowning: