PDA

View Full Version : Universal PCB (eventually) thread


Pages : [1] 2 3 4

Toodles
05-09-2007, 11:28 PM
http://www.akihabarashop.com/misc/UPCBakishop.jpg

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

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://www.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

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'm having a problem updating the firmware with Vista. I'm receiving an 'error 997'
A: Just a quick note to anyone trying to run the PDFSUSB program under Vista and getting 'error 997', try the following:

Right click pdfsusb, properties, compatibility, set to XP or 2000 or so. Also check 'run as administrator' if you haven't disabled UAC.
In device manager, select the PIC18F4550 Family Device, right click properties, power management, uncheck 'allow the computer to turn off this device'
Run the program as admin (right click, run as admin [if this is available])

Should solve the problem. As seen at http://forum.microchip.com/tm.aspx?m=241830

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

SaBrE
05-09-2007, 11:51 PM
thats fucking awesome man, keep us posted for sure

Taiki
05-10-2007, 03:46 AM
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?

laugh
05-10-2007, 04:05 AM
You're gonna be so many guys' hero for doing this.

Gasp
05-10-2007, 04:28 AM
this is epic,
goddamn toodles....goddamn.
if you manage 5+V support i'll make sure every stick i ever touch uses this

Taiki
05-10-2007, 04:57 AM
this is epic,
goddamn toodles....goddamn.
if you manage 5+V support i'll make sure every stick i ever touch uses this

http://www.sparkfun.com/commerce/product_info.php?products_id=8290

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)

Gasp
05-10-2007, 05:09 AM
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)

Taiki
05-10-2007, 06:41 AM
other than finding a +5v, it *should* work, since it uses common grounds for all the buttons and stick directions.

Toodles
05-10-2007, 11:36 AM
Thanks for the kind words guys. Some how I managed to go from 1200 rep to 3000 rep after a single +rep. Weird.

this is epic,
goddamn toodles....goddamn.
if you manage 5+V support i'll make sure every stick i ever touch uses this
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.

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?

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.

FMJaguar
05-10-2007, 11:59 AM
Thanks for the kind words guys. Some how I managed to go from 1200 rep to 3000 rep after a single +rep. Weird.

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?

Toodles
05-10-2007, 12:05 PM
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.

Toodles
05-10-2007, 12:11 PM
yeah, very weird... =P

But onto the questions

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

2. Is it possible to address the pause issues through the programming?

3. 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?
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.

Toodles
05-10-2007, 12:18 PM
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 :)

FMJaguar
05-10-2007, 12:27 PM
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.


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.

Toodles
05-10-2007, 01:59 PM
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?

Gasp
05-10-2007, 02:07 PM
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

Toodles
05-10-2007, 02:30 PM
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.

Toodles
05-10-2007, 04:32 PM
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?

Taiki
05-10-2007, 07:54 PM
What about those of us who want a hybrid SNK/Capcom layout?

that being
ABCD
KKKK

?

chippermonky
05-10-2007, 11:18 PM
I'm all over it. Time to go order some free samples.

Toodles
05-10-2007, 11:34 PM
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.

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

that being
ABCD
KKKK

?
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 :(

chippermonky
05-11-2007, 12:12 AM
hey, thanks a ton toodles. i've been trying to get into programming ICs but simply couldn't overcome the huge learning curve. Maybe that's becaues Ive been trying to start from programming something myself from scratch. I guess it's better if I try and program one that's done already. Didn't even know there was a wii modchip :D. I owe you one.

Btw, would you mind if I IM you eventually to ask for help about programming ICs?


lastly. I know you had the flash PCB idea in mind but it's been a bit dead in the water lately especially due to parts concerns. Since I'm building a vacuum forming machine this summer NO FREAKING MATTER WHAT, I'm wondering if it's practical to vacuum form a plastic cover of the flash PCB. I could easily make around 36 at once with about 20 dollars worth of plastic.

Toodles
05-11-2007, 01:15 AM
Parts havent been an issue so much as the housing. The flashes I've made work, but seem to have to be tweaked by hand to get them to work right and I want to avoid that. They're a little flaky but honestly I can't say they're more flaky than the originals. I have the CNC mill here, but have a lot of work and learning before I can use it for making housings, or at least a housing prototype. I kicked this project in gear in order to take a break from the flash, but will be focusing on it hard after the next UPCB release when I have a tested and working PS3 support.

If you're in the market for a programmer/debug, check out the Inchworm+ (an ICD2 clone) at www.blueroomelectronics.com . I have the original Inchworm and the Firefly, and they're pretty cheap for a solid programmer and in circuit debugger.

Taiki
05-11-2007, 03:50 AM
I had a thought. Why not include the option of using a parallel in-serial out shift register in conjunction with one of the pins to provide a set of 8 or 16 operating flags?

IE: a set of dip switches to tell the chip it's in tournament mode, neogeo mode, capcom 6 button mode, etc?

fluxcore
05-11-2007, 01:58 PM
VERY cool project. As with many people around here, I'm sure, I have a ton of hacked gamepads for various systems which are bulky and annoying to switch around - especially when some pads don't support common grounds (crappy xbox systems...).
This will both be awesome AND useful :D

--flux

final_cut
05-11-2007, 02:12 PM
Chipper, do you plan on vacuum forming joystick encasements with your machine? I had a friend that I was going to work with on a similar project, and we were debating on whether to go the plastic route, or the folded metal. He works for a solar panel company, and he says they have a machine that could just bang these things out.

Toodles
05-12-2007, 04:28 PM
Put in support for Saturn and tested with the Innovation converter. Works awesome.

Also put in support for NES, SNES, Genesis (3-button) and TurboGrafx-16 (togglable between 2 and 6 button operation, including autofire for the two button mode). Added information to all of the .h files for each system describing the protocol and pin, and how to create a UPCB cable for them. Added information to the neogeo.h for using the neogeo module with older 80's systems, including specific pinouts for FM-Town, X68000 (two button), and Sega Mastersystem (which should be the one used for most 9 pin 80's systems like Commodore 64). All of these in this paragraph are untested because I dont own these systems.

I'm tweaking the USB HID piece, getting ready for Monday when I'll be testing a bunch of different descriptors to see how well they work with the PS3. Assuming I find one that works awesome, I'll package everything together for a release on Tuesday.

chippermonky
05-12-2007, 08:46 PM
Chipper, do you plan on vacuum forming joystick encasements with your machine? I had a friend that I was going to work with on a similar project, and we were debating on whether to go the plastic route, or the folded metal. He works for a solar panel company, and he says they have a machine that could just bang these things out.

I am definitly planning on doing at least one of those. Main reason I want a vaccum forming machine is because they are so darn cool though. I also wanted to do a bent metal joystick but a lot of people have already done those (namely finkle) and I don't have one of those metal bending machines either.

Toodles
05-13-2007, 01:39 PM
Here's something I dont know if many people knew.

Playstation and Playstation 2 use the same data line for all controllers and memory cards.

What does this mean and why do you care? It means you can cheat. If I tweaked the PSX code, I could beat JWong at PS2 MvC2, me playing on my stick, no matter what stick or controller he played with. I can't make it ignore things he presses, but I can make it press anything for him. So I can make it always down all 6 buttons so he never attacks; his pressing or not pressing wont matter because the PS2 will always think he held them down. Or if I wanted to get tricky with it, have it only cheat when I wanted to so it wouldnt be immediately obvious, like say have him press up whenever I do a low short. Or if I do a certain combination, he'll do a DHC after only only a couple of hits from his AHVB, and keep DHC'ing early for low hit count so it drains all his meter. How about forcing your opponent to taunt and the end of a round they win in GG so you get the free meter next round? For all roll cancel attempts to be full rolls? Have it count the frames from when they activate A-groove, so the first free frame they roll?

No this problem does not exist when using the USB converters on PS3. That I know of.

Evo needs to move away from PS2's.

cheezies
05-14-2007, 12:08 AM
Here's something I dont know if many people knew.

Playstation and Playstation 2 use the same data line for all controllers and memory cards.

What does this mean and why do you care? It means you can cheat. If I tweaked the PSX code, I could beat JWong at PS2 MvC2, me playing on my stick, no matter what stick or controller he played with. I can't make it ignore things he presses, but I can make it press anything for him. So I can make it always down all 6 buttons so he never attacks; his pressing or not pressing wont matter because the PS2 will always think he held them down. Or if I wanted to get tricky with it, have it only cheat when I wanted to so it wouldnt be immediately obvious, like say have him press up whenever I do a low short. Or if I do a certain combination, he'll do a DHC after only only a couple of hits from his AHVB, and keep DHC'ing early for low hit count so it drains all his meter. How about forcing your opponent to taunt and the end of a round they win in GG so you get the free meter next round? For all roll cancel attempts to be full rolls? Have it count the frames from when they activate A-groove, so the first free frame they roll?

No this problem does not exist when using the USB converters on PS3. That I know of.

Evo needs to move away from PS2's.

Great find. Hopefully EVO won't have players screaming "hacks! hacks!". :rofl:

Regardless, you rock Toodles!

Toodles
05-14-2007, 12:23 PM
PS3 owning friend is fighting with his wife, so it looks like I wont be visiting his house tonight to test the PS3 support. I copied the USB descriptor from the Pelican adapter, and the information it reports. I haven't copied everything (like the device ID, manufacturer's ID, and some other data the device reports, but outside of the descriptor) but it should be plenty for the PS3 to work. I just need five minutes alone with a PS3 to find out.

PS2 is continuing to be a bitch. For no reason I can figure out, it works just fine in the player 2 slot, but not in the player one slot. PSX games work fine, no matter which slot the UPCB is plugged into. My earlier report about it working fine on a PS2 looks to be incorrect. I'm guessing I was playing it with the UPCB in the player 2 port. Motherfucker. There is no reason there should be ANY difference so I'm scratching my head on this one. It makes no damned sense.

If the friends get together tonight gets canceled, I'll go ahead and release what's done so far and work on laying out the PCB so I can get some of those made. Even with the PS2 freakiness, it's more than far enough in my mind to justify installing it in my favorite stick.

cheezies
05-14-2007, 01:38 PM
This is all pretty amazing.

Toodles
05-14-2007, 09:12 PM
I tested on two other PS2 systems. On my GF's fat PS2, it works on both controller ports. On my sister's thin PS2, it only works on the P2 side. Mine is a fat PS2, so I'm completely confused about WTF is going on. Broke down and ebay'ed an oscilloscope, so hopefully I can figure out what the fuck is going on. I know I probably should have just made a cheezy parallel port logic analyzer type thing, but I'm sure the Oscope will be very handy.

I laid everything out on a PCB, and the dimensions are just over 3"x3" and includes everything for piggybacking a dreamcast and/or xbox360 controller. I'll do a little cleaning and prep work on it so I can get an order in. I should be able to get about 14-15 pieces for the order. I plan on taking tons of pictures of builting mine and putting into an instructables.com project. Probably do the same for adding the DC and 360 piggybacking.

I also updated the schematic: I put in values for the pieces that needed it, like the crystal and C3 cap. There was also a minor problem; the connection to the D-Sub cable should have been at RC4 and RC5, not RC6 and RC7. (Edit: WHOOPS. They were supposed to be at RC6 and RC7. Schematic corrected. ) probably wouldnt affect actual use, but still needed changed. They both still connect to the others with the resistors, but the line from the D-Sub should be straight to the top two, and through the 22 Ohm resistors for the bottom two. I also added a pullup resistor to RB4/D-Sub pin 9. This will leave one pin you don't ever have to worry about soldering in for non-Neogeo cables.

I am certain this is is the only hardware change that will ever be needed. Everything from here can and will be done via firmware upgrades.

At the GF's now, so will put up the updated schematic tomorrow along with the 1.1 release files, and will update the first post. I'll be taking a break from this for a little bit to figure out my CNC machine and work on the flash more until the UPCB PCB's arrive. After I play with timer's and interrupts more on the PIC's, I'll be adding in the recording/playback, tournament mode (good for all consoles), compile time options for the 3 extra pins, Jaguar support, and hopefully N64 and Gamecube support. And hopefully shortly after the Oscope gets here, I'll be after to say PS2 is 100% working, lock the code, and be done with it.

cheezies
05-15-2007, 12:14 PM
So excited! I cannot wait any longer! :looney:

shoo
05-15-2007, 12:23 PM
this kicks ass :tup:

vapulus
05-15-2007, 12:29 PM
I am so fucking impressed right now, I am all for giving you running for president.

Mikei
05-15-2007, 02:06 PM
This is really amazing. Honestly, I was just running out of PS1 dual shocks and tired of hunting down controllers to hack. These sound like a god send.

comoesa
05-15-2007, 03:31 PM
So wait this universal pcb will work with all consoles

Toodles
05-15-2007, 03:42 PM
So wait this universal pcb will work with all consoles.../
If you can't be bothered to read the thread, I can't be bothered to listen.

KabaL
05-15-2007, 03:50 PM
Best thread I've seen in all my years of SRK'er... haha not really, but for sure it's one of the best around!!

vapulus
05-15-2007, 04:31 PM
This is really amazing. Honestly, I was just running out of PS1 dual shocks and tired of hunting down controllers to hack. These sound like a god send.

This is one of my issues, too.
My ps2 stick is dead, but I can't find any dualshock 1's.

Toodles
05-16-2007, 12:32 PM
First post updated. Schematic is linked instead of shown because its kinda huge, but much easier to look at now. I broke it down to show all of the optional pieces that can be used. This is the exact schematic that I'm designing the PCB with. I'm gonna take some time to look the schematic over to doublecheck everything is laid out right, and then send an order off to a fab house. Currently, the PCB is 3.2" x 2.6". It looks a little scary, but there is room for everything in the schematic. It just may be a little cramped if you use every option.

Source code is released as well for 1.1 including all of the new supported systems. The .H file for each system contains good information on the pinouts, the protocal, and how to wire a UPCB cable for that system.

final_cut
05-16-2007, 01:02 PM
Awesome. Would you consider offering installation services of said PCB and or piggyback PCBs into pre-made custom sticks?

thanks

Toodles
05-16-2007, 01:39 PM
I'd consider it, but it wouldn't be cheap. But I am willing to work in trade for toys I want (DOA4 PCB, FC Twin, CPS-2 PCBs :) That's a lot of time. But I do plan on having tutorials up on Instructables for assembling the UPCB, and eventually wiring up the piggyback PCB's. It's not hard, just requires time. The Xbox360 piggyback will be harder, since you have to use the analog switch IC's, but I'll be covering that too.

Here's what the top of the pcb will look like. Im placing an order now. Yes, it looks scary, but it really isn't. A good part of the board no one except me will ever use.

http://img69.imageshack.us/img69/7112/upcblayoutboardzq4.png

final_cut
05-16-2007, 02:19 PM
Ok, I know you said more details were coming or whatever, but as far as piggybacking is concerned-
on the schematic it lists a piggyback inputs for xbox 360 or DC, would I just solder the wires from my hacked dc or xbox 360 PCB into those spots? sorry to sound dense, I just want to make sure I understand this correctly.

Toodles
05-16-2007, 02:53 PM
Ok, I know you said more details were coming or whatever, but as far as piggybacking is concerned-
on the schematic it lists a piggyback inputs for xbox 360 or DC, would I just solder the wires from my hacked dc or xbox 360 PCB into those spots? sorry to sound dense, I just want to make sure I understand this correctly.
Hehe. Not dense, good question.

--Dreamcast piggybacking, easy version (all PCB's are powered at once)
Yes, just wire it up. Since Dreamcast pads use a common ground, you'll want to wire it up directly. Short to A, Forward to B, Up to Dpad Up, etc. The line marked RB0 should go to start. You don't have to wire Select up to anything if you dont want, but I would wire it up with a pair of diodes like this:

UPCB side DC Side
Select------+---|<|-----A
+---|<|-----Start

-|<|- is a diode
So it would act as a Taunt button for the Capcom games.
Remove the normal cable from the PCB. There are 4 wires (the fifth green one can be ignored for now) in that cable. Where the red wire went into the DC PCB, connect the VCC line from the UPCB. Black wire - GND from UPCB. White and blue are the real data lines. Connect them to DC_1 and DC_2.

--Xbox360 piggybacking, easy version
Xbox360 doesn't use common grounds, so you have to make it use common grounds first. This requires the use of the analog switch IC's. The ones I am planning to use for mine are the MAX4611. Each chip has four lines going to it, and eight going out. If the line going in is low, it connects the two matching lines. High and it disconnects. So 3 of those chips will turn an xbox360 controller into a common ground setup.

UPCB side Xbox360 side
Short----------MAX4611-------------- First point for 'A' button
+---------------Second point for 'A' button

And repeat for all 4 directions and 8 buttons.
Again cut the cable, wire the black to GND, red to VCC, and the two data lines to X360_1 and X360_2.


The complicated way I havent totally figured out yet. I hope to keep the PCB's unpowered when not in use, but Im still working on that.

By using the RB0 line instead of Start, I can still keep a tournament mode for the piggybacked PCB's.

This'll be so much easier to explain when I get a good one made with pictures.

Toodles
05-16-2007, 06:52 PM
There's no way to format this in a way that doesn't look like ass. Digikey part numbers for everything and cost. Bare minimum, if you sample the PIC from microchip.com, A little under $7. PIC by itself is over $13, so sample that mofo. With all of the extra possible stuff, it can reach $20, assuming you sample the PIC. (Most of that is if you buy the ribbon cable from Digikey. Just use old IDE cables :)

Digikey Part No. Quantity Cost Description Notes

4.7KQBK-ND 15 0.81 Pull up resistors 4.7kOhm
22QBK-ND 2 0.27 USB resistors 22 Ohm Cost is for 5 (minimum order)
1.0MQBK-ND 1 0.27 Crystal resistor Cost is for 5 (minimum order)
X439-ND 1 0.58 20 MHz Crystal
490-3859-ND 2 0.18 0.1uF capacitors (C1 C2)
490-3629-ND 2 0.56 15pF caps for Crystal
P13129-ND 1 0.17 33uF cap (C3)
P13466-ND 1 0.11 470nF cap for vUSB
ED90059-ND 1 1.98 40 pin IC socket
PIC18LF4550-I/P-ND 1 13.73 18LF4550 DIP PIC Can be sampled for free from Microchip.com
215FE-ND 1 1.29 Female DB-15 Output jack. Most small computer stores have tons of
motherboard pieces, including a 15 pin female jack to
a 2x8 header made to plug into the motherboard. If you
can find these, they make things much easier and cheaper than
making your own.


Optionals:
4.7KQBK-ND 2 0.27 Pull up resistors 4.7kOhm Needed for RA0 and RA1 to be buttons. Price for 5.
220QBK-ND 3 0.27 LED Resistors Needed for Power, RA0 or RA1 LED's
RXEF040-ND 1 0.44 PTC Resetable Fuse Highly recommended
ED3114-ND 1 0.63 14 pin IC socket Needed for Piggyback switch
WM4204-ND 1 0.66 6 pin molex KK header Needed for ICSP connector
296-8329-5-ND 1 0.50 4066N chip Needed by Piggyback switch
215ME-ND 1 1.04 Male DB-15 For NeoGeo input/Neogeo converter
HRP16H-ND 0-4 2.92 16 pin IDC socket One for Output header, one for button ribbon connector
one for DC piggyback, one for Xbox360 piggyback.
Price is for four.
WM4204-ND 1 0.66 6 pin molex KK header For optional 6 pin stick connector
HRP10H-ND 1 0.59 10 pin IDC socket for optional 10 pin stick ribbon connector
MC16G-5-ND 5 ft 2.60 Grey flat IDC cable Ribbon cable
MC16M-5-ND 5 ft 4.62 Colored flat IDC cable Rainbow colored ribbon cable
HKR10H-ND 1 0.50 10 pin IDC connector for optional 10 pin stick ribbon connector
HKR16H-ND 0-4 2.76 16 pin IDC connector One for Output header, one for button ribbon connector
one for DC piggyback, one for Xbox360 piggyback.
Price is for four.
WM2004-ND 1 0.53 6 pin molex crimp connector required is using the 6 pin stick connector option
WM1114-ND 10 0.74 molex crimp pins Price is for all ten. Required if using 6 pin stick connector option

Chozen1
05-17-2007, 11:08 PM
gotta love the TM on the pcb bro, Excellent.

isamu
05-18-2007, 04:37 AM
Nice work Toodles. Check your PM bro.

Toodles
05-20-2007, 06:48 PM
Well, I finally got a chance to test it on a PS3, but had limited success. X and O worked on the dashboard, but nothing else worked anywhere. The X and O working is a pretty good sign that it just needs a little tweaking. None of the stores I can find anywhere will rent a PS3, so I'm a little stuck.

I added EJP (Atari Jaguar and some Atari PC's) support and 3DO support. I cant test the Jaguar, but I will be able to test the 3DO support as soon as I get some more hoods in the mail which should be Monday.

I'm starting work on trying to get Xbox support going. I'm quite the USB noob, so I'm doing the work outside of the UPCB first, and will integrate it as soon as it's working. No, there will not me any Live headphone support.

This is a total longshot, but I'm willing to do custom work if someone will loan me a PS3. I expect it would take 2 weeks MAX before the UPCB completely worked. Probably only a couple of days, but just in case, 2 weeks should be expected. So if anyone has the cajones, and I've got tons of references, I'll install a UPCB in whatever stick you want, and even make a USB cable to go with it, so when I return the PS3 and stick after 2 weeks, you can plug and play it. If you need some other sort of custom work, let me know and I can probably do it.

shoo
05-20-2007, 06:57 PM
where do you live toodles?

Toodles
05-20-2007, 07:02 PM
Blowme Imaho = Boise, Idaho

shoo
05-20-2007, 07:03 PM
oh :/

if you were in cali id lend you mine :[

Taiki
05-21-2007, 04:54 AM
Blowme Imaho = Boise, Idaho

Funny, you don't *look* like a white supremacist.

Toodles
05-21-2007, 10:49 AM
Long sleeves, they cover up the the swastika tattoos.

(Holy hell, this USB stuff for xbox is gonna take a while. This is some complicated shit.)

c0rderr0y
05-21-2007, 11:44 AM
Keep up the good work Toodles very interested in this I was going to build a Stick but have to decided to wait for this.

Toodles
05-21-2007, 09:18 PM
Since the attempt with the Pelican adapter descriptor didnt work, I reset the code back to the Radio Shack PSX->USB adapter so I could try it out. Hot damn it worked. Response in VF5 training with input display on was solid. I didnt get to test long, but I can tell you that it did work on the dashboard, and in VF5. I attempted to check BC with VF4:Evo, but couldn't get past the point where it asked to load a file. Niether directions or buttons would respond at that point. I can't say for sure if he had the 1.7 update, but the fact VF5 and the dashboard worked make me damn happy.

I REPEAT, PLAYSTATION 3 SUPPORT IS TESTED AND CONFIRMED!

I also got to test SNES support at his house, which worked perfectly. Because the code for SNES and NES are almost identical, Im willing to consider the NES completely working as well.

The Radio Shack code used with the PS3 above will be reintroduced, and the Pelican code disabled in the next 1.2 release. If you can't wait (HA! Like anyone else has actually built one of these....) then use the 1.0 hex file.

I've got the pictures taken and uploaded, and beginning the writing of an Instructables.com section for building a cable for UPCB, using SNES as the example. When the fabbed PCB's get in, I'll bo doing another one for its construction.

(Dude, it fucking worked!)

shoo
05-21-2007, 09:23 PM
I REPEAT, PLAYSTATION 3 SUPPORT IS TESTED AND CONFIRMED!


hell yesss :rock:

Gasp
05-21-2007, 09:26 PM
Hot damn


hot damn indeed
when do you think a final product will be introduced? i have a couple sticks i was gonna build to sell and im pondering postponing them

Toodles
05-21-2007, 11:34 PM
hot damn indeed
when do you think a final product will be introduced? i have a couple sticks i was gonna build to sell and im pondering postponing them

Whadya mean by final? As long as work continues to include support for new systems or improve support for old system, or adding/tweaking features, it won't every be 'final'. The schematic is final, and allows for a bunch of different options with the extra input line and two extra in or out lines; those options will likely vary from stick to stick. Frankly, none of those are really used in the software yet.

Since the schematic is final, all of the changes will be in 'firmware', which can be updated a UPCB USB cable. All of the cables that are supported have been mapped out, and will not change; I did have to move a couple around when implementing 3DO support, but I will never change the pinout of a system once its supported. In short, build the hardware. Build the cables. They will always work. The only changes will be in software upgrades.

If you mean 'when can I get something to install in the sticks from you?', then the answer is as early as a couple of weeks. The PCB order went in last week, and if the time my last order took is any indication, I should have them in my hands in 1-2 weeks from now. The parts needed are already listed above, and the instructables page will show how to assemble it. If you still want me to assemble it, I can, but expect to pay out the nose for it. Its boring and time consuming. Frankly, assembling them yourself is fun, as I found out assembling Inchworm PIC debugger kit. Troubleshooting can be frustrating, but very rewarding when you figure it out.

IF YOU ARE IN THE SLIGHTEST BIT INTERESTED IN PLAYING WITH A UPCB, CREATE AN ACCOUNT ON MICROCHIP.COM, AND ORDER SAMPLES OF THE PIC, SPECIFICALLY THE 18LF4550 I/P.

Those bastards cost over $13 if ordered from Digikey. Do everyone a favor and get some for free from the source. You can get up to 3 each of 4 different models, up to twice per month. Also get the 18LF4455 I/P ; its the same chip with a 2/3 of the memory; Since Im only using like 1/4 of the program memory and RAM, everything should fit in there fine. Get some 12F683 I/P and 18LF1330 I/P to round it all out; either use them to learn PIC programming, or send them to me as a tip to toy around with :)

If you get some sampled, and send them to me as part of an order for the pcb when it gets here, I'll certainly discount the cost of the pcb if you let me use the extras in other orders.

So go, signup for accounts, and sample some free goods. They should be here before the PCBs are, and it beats paying $13 to anybody for them.

Gasp
05-22-2007, 01:16 AM
i ment as in like when can i start making a stick
build this pcb
and use your firmware?

pics are very welcomed

Toodles
05-22-2007, 01:28 AM
There's no reason you can't build one right now. The schematic on the front page should tell you everything you need to assemble one on any kind of prototyping board, like stripboard (Veroboard for you English folks) or the 'Pad per hole' prototyping board they sell at Radio Shack. I could post up pics of the one I made on the pad per hole board, but it is quite fugly and not really helpful in figuring out how to layout your own.

If the schematic isn't enough, you'll have to wait for the pcb's to arrive and for me to put up assembly directions for it. 2 weeks+

Edit: Adding this because I want to make sure people see it instead of being lost in the last post of the previous page:


IF YOU ARE IN THE SLIGHTEST BIT INTERESTED IN PLAYING WITH A UPCB, CREATE AN ACCOUNT ON MICROCHIP.COM, AND ORDER SAMPLES OF THE PIC, SPECIFICALLY THE 18LF4550 I/P.

Those bastards cost over $13 if ordered from Digikey. Do everyone a favor and get some for free from the source. You can get up to 3 each of 4 different models, up to twice per month. Also get the 18LF4455 I/P ; its the same chip with a 2/3 of the memory; Since Im only using like 1/4 of the program memory and RAM, everything should fit in there fine. Get some 12F683 I/P and 18LF1330 I/P to round it all out; either use them to learn PIC programming, or send them to me as a tip to toy around with :)

If you get some sampled, and send them to me as part of an order for the pcb when it gets here, I'll certainly discount the cost of the pcb if you let me use the extras in other orders.

So go, signup for accounts, and sample some free goods. They should be here before the PCBs are, and it beats paying $13 to anybody for them.

Toodles
05-22-2007, 12:09 PM
Instructable up on how to make a UPCB cable.

http://www.instructables.com/id/E9SM77YF1Y7H1KH/

Paik4Life
05-22-2007, 12:28 PM
Great work. I'll read the instructables later and make an account. Those guys will probably be like, "Why the hell are we getting all these requests for samples of these PICs???"

I will toy around with this in the near future. I just have some other projects to finish up first.

~Paik

Ramon
05-22-2007, 12:49 PM
Toodles:

Im guessing you got your hands on a PS3?

I was going to see if I could nab one for you, I think I might know someone who doesn't play theirs as often and would be willing to lend it to "me" for a few weeks, and well, I'll could just hand it off to you for X weeks or however long.

I just need to see if this guy will still let me borrow it. He's offered it to me before in the past (month after release), but I didn't have any games, or any sticks to use on it. So I declined his offer.

~Goodbye

Toodles
05-22-2007, 12:55 PM
Toodles:

Im guessing you got your hands on a PS3?

I was going to see if I could nab one for you, I think I might know someone who doesn't play theirs as often and would be willing to lend it to "me" for a few weeks, and well, I'll could just hand it off to you for X weeks or however long.

I just need to see if this guy will still let me borrow it. He's offered it to me before in the past (month after release), but I didn't have any games, or any sticks to use on it. So I declined his offer.

~Goodbye
I brought my stuff over to a friends house, and had about 5 minutes to test. I'm certain he'd loan me his copy of VF5 but the PS3 itself it out of the question. Hell yeah, I'd love to have one here to test with for a couple of days. The only thing I KNOW it currently works with is VF5 and the dashboard; Id like more of a chance to test the BC games and try other tactics to get it working.

Paik4Life
05-22-2007, 05:47 PM
Just read the instructable. Very nice tutorial. I love the extra emphasis on testing : )

I'll get to the parts ordering later tonight.

~Paik

Green
05-22-2007, 06:12 PM
DC support :(

Toodles
05-22-2007, 06:42 PM
DC support :(
Have you SEEN the information on how the maple bus works??? Eventually I should have it coded in, but frankly, it scares me.

c0rderr0y
05-23-2007, 10:10 AM
Hey toodles just a suggestion if any other systems in the future are like the xbox360/dreamcast you should put in a place for an option/upgrade board addon

Taiki
05-23-2007, 10:30 AM
Hey toodles just a suggestion if any other systems in the future are like the xbox360/dreamcast you should put in a place for an option/upgrade board addon

Were you born retarded or did your dad have to hit you in the fucking head a few times as a kid?

c0rderr0y
05-23-2007, 10:42 AM
Were you born retarded or did your dad have to hit you in the fucking head a few times as a kid?

Do you even understand what I am talking about? What if another system comes out that uses a similar port/method as the dreamcast then what? It wouldn't be compatible thats what. Then it WOULDN'T work with ALL systems like toodles intended it to which is his goal for this project.

Taiki
05-23-2007, 11:03 AM
Do you even understand what I am talking about? What if another system comes out that uses a similar port/method as the dreamcast then what? It wouldn't be compatible thats what. Then it WOULDN'T work with ALL systems like toodles intended it to which is his goal for this project.

Xbox and xbox360 are like that. Just splice the wires from the xbox360 passthru or the dreamcast pass through.

c0rderr0y
05-23-2007, 11:29 AM
Ok so the dreamcast/xbox360 pass through are universal then correct? Thats all I needed to know I though they were specific to each system maybe label them something else for n00bs like me (ie. Passthru A and Passthru B)

Toodles
05-23-2007, 12:35 PM
Ok so the dreamcast/xbox360 pass through are universal then correct? Thats all I needed to know I though they were specific to each system maybe label them something else for n00bs like me (ie. Passthru A and Passthru B)

They are universal as long at the console uses at most 2 wires for communication.

I just got word that the PCB's are printed and FedEx'd. According to tracking, they should be here Friday.

Im cleaning up the code for another release. All of the USB stuff that was spread all over has been consolidated to a usbtemplate.h and usbtemplate.c. They are huge, but all of the information is in one place. If I get to understanding it well enough to know which functions can be used by all USB systems, and which ones are system specific, I'll separate them so there is more code re-use.

Other than the fact I could really use some more hoods, I got everything here to build the first pcb when it arrives, and take bunches of pictures for another Instructable. I won't be selling ANY of the pcb's until the first one is completed and tested. I wanna make sure the PCB design works, and I also want to test the piggyback designs.

c0rderr0y
05-23-2007, 01:18 PM
Hey toodles I put in my sample order over at microchip.com so I'm ready to order a pcb from ya, just when ever your ready let me know.

Taiki
05-23-2007, 02:23 PM
That's odd, it didn't like my cox email address for sampling.

It does however, like my UNLV school of engineering address.

Green
05-23-2007, 04:29 PM
Eventually I should have it coded in
das wut i'm talkin bout

c0rderr0y
05-23-2007, 04:34 PM
I can't wait till this thing is done.... I have 8 different systems and 3 sticks for 3 different systems.... now I can sell those and only have to own 2 for all 8 systems =D

Toodles
05-24-2007, 01:16 PM
Well, for some reason my prototype is acting up, and with the boards due to arrive tomorrow, I can't be bothered to try and figure what the problem is. Probably a cold solder point somewhere.

For those that are curious, here's what the prototype looked like. The PCBs coming in tomorrow are significantly smaller.
http://img70.imageshack.us/img70/6599/protoud2.jpg
A lot of it looks like a hodge podge because of the order things were added in. The main circuit with ICSP, crystal, PIC and USB port were done first, so nice and clean. The DB-15 on the bottom was added next, and I did my best to do it cleanly with uninsulated bus wire on the bottom, but that tool up half the damn board, and only came out sort of clean. Then I found out the internal pull ups were not strong enough to be reliable, so the 12 pull up resisitors for everything, and starting to look messy. Then the 16 pin IDC connector for the output was put in, and I just connected it with the green 30 AWG wire. Then I had to reroute the power so the power from the IDC connector went through the PTC fuse, and then I realized I could use a pull up on the RB4 line for easier wiring, blah blah blah. It's messy, but it served me well until last night. It looks I'll be needing two of the PCBs for myself now. One for my favorite stick, and another to keep outside of a stick for testing/development.

In other news, I think I have a handle on how timers work. With the board down, I cant really test like I'd like to, but I think I have it down. If I'm right, this means that I can implement support for Gamecube (which I can test), N64, and 6 button genesis (both of which I cant test) ; and implement recording/playback and tournament modes.

Taiki (and anyone else that is rooting for 8 button support), can you give me an idea of how you would want things laid out for each system with an 8 button layout? I know the ability to switch layouts is wanted for Neogeo, but how should the layout be be for other systems? For NES? GC? Six button layouts like genesis? PSX? Be thorough and I'll start putting it in.

TheRealNeoGeo
05-25-2007, 09:14 AM
What are the dimensions off the UPCB in millimeters?

Toodles
05-25-2007, 09:31 AM
82.2mm x 67.3mm

Ain't it purdy?
http://img527.imageshack.us/img527/1592/realpcbde7.jpg

c0rderr0y
05-25-2007, 09:37 AM
Nice work.....~!!! can't wait for the finished product, so how much off do we get for sending you all those samples?

sorry i am a little bit excited.

Paik4Life
05-25-2007, 10:01 AM
That is quite sexy. The size is not too bad either.

~Paik

TheRealNeoGeo
05-25-2007, 10:53 AM
Toodles bringing sexy back ^_^. Thanks for the measurements :).

Taiki
05-25-2007, 04:52 PM
Taiki (and anyone else that is rooting for 8 button support), can you give me an idea of how you would want things laid out for each system with an 8 button layout? I know the ability to switch layouts is wanted for Neogeo, but how should the layout be be for other systems? For NES? GC? Six button layouts like genesis? PSX? Be thorough and I'll start putting it in.

For NES/SNES/GC/Genesis, just define the far right six buttons, and leave the L1/L2 unmapped(or in the GC's case, L1 or L2, seeing as something's gotta be the Z trigger).

When I mame it up with my HRAP, I have it defined default to the far right six buttons SF2 style then I just re-map to ABCD in NeoGeo games.

Oh, you can also do very preliminary six button genesis testing using a simple parallel port interface.

Ilavos
05-26-2007, 04:17 AM
Nice work.This battle is yours.Looks like xbox/dc determine the outcome of the war.

In case you forgot: http://forums.shoryuken.com/showthread.php?t=125026

Numbski
05-26-2007, 11:03 AM
82.2mm x 67.3mm

Ain't it purdy?
http://img527.imageshack.us/img527/1592/realpcbde7.jpg

Yes. Yes it is. :D

That's what I get for turning my back for a moment...you got this project licked! Good work!

So where do I send my money? :D

(Also...who was working on the sanwa optical boards? That thread kinda faded...don't know what became of it...)

DH020
05-26-2007, 12:25 PM
ok im absolute noob at this

but does mean have to solder ps1 leads off oringal ps1 pads to solder to this pcb?

Starcade RIP
05-26-2007, 12:47 PM
82.2mm x 67.3mm

Ain't it purdy?
http://img527.imageshack.us/img527/1592/realpcbde7.jpg

That is pretty amazing. Great work!

c0rderr0y
05-26-2007, 12:47 PM
ok im absolute noob at this

but does mean have to solder ps1 leads off oringal ps1 pads to solder to this pcb?

No. Only Dreamcast and 360 but thats if Toodles can't get those to work.

kazlaz
05-26-2007, 01:28 PM
OK im a bigger noob what does this do? Lol sorry about not reading i just dont have the time right now

Toodles
05-26-2007, 01:45 PM
Im assembling the first UPCB now. It is going very slowly because I am taking pictures of everything and writing the Instructable as I go. I'm hoping that if I document everything well enough there once, I wont have to constantly repeat myself.

ok im absolute noob at this

but does mean have to solder ps1 leads off oringal ps1 pads to solder to this pcb?
You dont need a playstation PCB at all, just the cable. Check the instructable example for making a cable; the process for making a playstation cable is the same, as long as you check the psx.h file for the pinout.
http://www.instructables.com/id/E9SM77YF1Y7H1KH/
OK im a bigger noob what does this do? Lol sorry about not reading i just dont have the time right now
If you don't have time to read the thread, or at least the first post in the thread, I don't have the time to answer.

Green
05-26-2007, 02:26 PM
Im assembling the first UPCB now. It is going very slowly because I am taking pictures of everything and writing the Instructable as I go. I'm hoping that if I document everything well enough there once, I wont have to constantly repeat myself.


You dont need a playstation PCB at all, just the cable. Check the instructable example for making a cable; the process for making a playstation cable is the same, as long as you check the psx.h file for the pinout.
http://www.instructables.com/id/E9SM77YF1Y7H1KH/

If you don't have time to read the thread, or at least the first post in the thread, I don't have the time to answer.
somebody prem this man

Toodles
05-26-2007, 07:38 PM
Alright, I got the first one assembled. It'll be the one I use for testing and development, so instead of the connectors for stick and buttons, it has the DB-15 male and female soldered straight to the board. I've documented everything so far on the Instructable for assembling a UPCB. I went ahead and set it as published for now, so you can get an idea what you'd be getting into. Of course I talk alot, so it is still 22 pages unfinished.

Here are some pictures of the one I assembled. I have a blue power LED which is SICK bright, along with a red and green status LEDs that I can use for troubleshooting. What can I say? I'm a sucker for das blinkenlights. I had to use the ribbon cable to cover the light just so I could get a damn picture of the board.

http://img84.imageshack.us/img84/2752/dsc02523cj2.jpg

And here it is with my NeoGeo old style stick plugged in, and using the UPCB Saturn cable. This is the first console test of the UPCB, and it passed wonderfully.

http://img99.imageshack.us/img99/6718/dsc02526cg3.jpg

That's about all I'll be able to do with the UPCB for at least today. When I can, I'll be assembling one to go into my stick, so I can show the rest of the options I didnt use with this one.

Gasp
05-26-2007, 08:32 PM
ill get around to finish reading this page (kinda busy) but looks amazing toodles

good work :)

Dummy Account
05-27-2007, 02:09 AM
I stop checking Tech Talk for a month and I miss this?! Great job Toodles. Your gifts to the fighting game community have surely allowed you passage into whatever positive afterlife you believe in.

Numbski
05-27-2007, 09:00 AM
Yeah, you and me both. This is some awesome stuff. :D

22 pages? That's all? Weak. :P

(j/k)

Toodles
05-28-2007, 05:41 PM
I have two of the UPCBs put together with pictures; the one I'll leave outside of a case for development, and the other one I'll install in my HRAP2. The second one is assembled, but not installed, so I don't have any of the pictures for it needed for making an Instructable for installation, but I can finish the Instructable for assembly. I am doing that now, and should be finished with the Instructable tomorrow.

I ordered a bunch of parts, and as soon as they get in, I'll have 5 UPCBs for sale by themselves, and 10 UPCBs to be sold as a kit. They have all of the components except for the PIC itself, but if you took my advice on sampling, that won't be an issue. Everything needed to assemble the UPCB and install it is included, just provide the buttons, stick, and case. Quick disconnects and #4 bolts to secure the pcb would be a good idea too. I even got the cool multicolored ribbon cable, so the pics from the inside of a stick will look even better. I will also have the parts to make a couple of USB button select cables as well. Just depends if I can find USB cables for cheap, but I have enough for 2 short cables right now.

I'm afraid I have to take back what I said before about offering a discount for those who send me extra 18LF4550's. I just don't think there is a need for the 18LF4550's to go through my hands at all. The offer for free programming still stands though. Send me 1 or 10, I dont care, I'll flash them. It's pretty simple with the ZIF attachment I have on my programmer. If anyone wants to leave spares with me in case others need them, you're welcome to, but I am thinking that effectively buying the samples and reselling them is both unethical and a pain in the ass.

I have a pretty big project coming of wiring up a racing setup, and the parts should be here Wednesday. While I'm working on that, my work on the UPCB will be on hold. He's paying good money for the work, so want to get it done ASAP.

The order of items I'm tackling is like this. I'll d what I can until the racing parts get here,and pick it up once it's done (or when I need to take a break from it).
Finish Assembly Instructable
Package current source code for 1.2 release
Create instructable for the USB button select cable (the one for PC and PS3 play, and also upgrading the firmware. Prolly the most important cable to make.)
Create instructable walking through the firmware upgrade
<the above are probably the only ones I'll get done before the racing gear gets here>
Troubleshoot PS2 player 1 problem, as soon as my Oscope probes come in the mail.
Wire up an Agetec PCB as a piggyback.
Test and implement piggyback support.
Make Instructable for making a DC piggyback.
Implement tournament mode
Implement record/playback
Implement GC/N64 support
Wire up DOA4 pcb as a piggyback (whenever it gets here. Told it was in the mail, but havent seen yet.)
Make instructable on making a xbox360 piggyback.

lastly, I have some smart friends in college for EE that I'll be sending information about how the DC communicates. Hopefully they can give me a simple way of converting it to an easier signal for the PIC to read.

Taiki
05-28-2007, 05:47 PM
I'm afraid I have to take back what I said before about offering a discount for those who send me extra 18LF4550's. I just don't think there is a need for the 18LF4550's to go through my hands at all. The offer for free programming still stands though. Send me 1 or 10, I dont care, I'll flash them. It's pretty simple with the ZIF attachment I have on my programmer. If anyone wants to leave spares with me in case others need them, you're welcome to, but I am thinking that effectively buying the samples and reselling them is both unethical and a pain in the ass.


What kind of programmer are you using? Can I build my own?

Toodles
05-28-2007, 07:16 PM
What kind of programmer are you using? Can I build my own?

The main one I use is the Inchworm. It's a clone of Microchip's 'hockeypuck', the ICD2. You can order either the bare PCB, or a full kit from dipmicro.com. The Inchworm kit when I got it was 36$, and wasnt difficult to assemble. I had a little problem with it because of a point I completely missed when soldering, but since then, it's been great. The debugging is just awesome.

The ZIF socket is separate. You can easily make your own, or get the Firefly board, which is made to go with the Inchworm.

Info on both is available from http://www.blueroomelectronics.com

The Inchworm is also a debugger; it's not just a programmer. Keep that in mind. $36 and some soldering and you got a very usefull piece of equipment.

If you want cheaper, you can find other programmers you can build for damn cheap. The 'JDM' programmer comes in tons of different forms, including schematics you piece together yourself, kits you assemble, or already assembled. Olimex.com has a PIC programmer for $10 already assembled.

I do recommend the Inchworm for price/usefullness; it's all I've been using for making the UPCB. There is a new version called the Inchworm+. If you get one, make sure to get the plus. If you have any specific needs, let me know and I'll see if anything fits better.

Numbski
05-29-2007, 07:30 AM
I'll have to look those up later. The big requirement for me is Unix-compatibility. I work on macs normally, but even Linux/FreeBSD would be feasible. If it only works on Windows it's pretty useless to me. :(

codyk
05-29-2007, 09:35 AM
I ordered a bunch of parts, and as soon as they get in, I'll have 5 UPCBs for sale by themselves, and 10 UPCBs to be sold as a kit.

I'd like to buy one (don't care whether kit or just pcb).

How are you handling the (probably long) list of people who want to order one?

Vidness
05-29-2007, 11:52 AM
Toodles! Good work man! I must admit, I am a bit jealous, for I as well have been working on such a thing. I am using the MC68HC11, with a 2Mhz bus speed. My first priority was indeed tackling the Maple bus, but with not much luk (oddly enough I *am* and EE). I am thinking with it's dual serial protocol, maybe it isn't too strict with the timing? Or if it is, I could make a parallel -> serial converter to collect data and then shooting it out at the 2 mhz speed the DC wants. I was doing research today, and totally stumbled across this thread! I think I will delay my efforts for now and see how yours turns out, for it's much easier to NOT re-invent the wheel :)

Mucho props to you my friend, and I will open some of my many PS2 2 DC converters to get an idea of what they are using. Perhaps this may be a help to you or anyone else who wants to simulate a DC joystick.

Toodles
05-29-2007, 01:26 PM
I'll have to look those up later. The big requirement for me is Unix-compatibility. I work on macs normally, but even Linux/FreeBSD would be feasible. If it only works on Windows it's pretty useless to me. :(
I'm not too familiar with PIC development on other OSes. I know that the MPLAB IDE and the debugging hardware made to go with it, like the ICD2 or Inchworm, are supposed to be for windows. I do not know if any other applications for other OSes support it. But, the debugger uses serial, and handing a serial port for VMWare to use was pretty easy last time I tried. If you just want a simple programmer like a JDM, I am sure there are apps for linux or MAC that will do it, but you may be up a creek for debugging.

I'd like to buy one (don't care whether kit or just pcb).

How are you handling the (probably long) list of people who want to order one?

Hadn't put too much thought into it. Even if they all sold out immediately (which I doubt), it would only take less than 2 weeks to replace and have more ready to go.
Toodles! Good work man! I must admit, I am a bit jealous, for I as well have been working on such a thing. I am using the MC68HC11, with a 2Mhz bus speed. My first priority was indeed tackling the Maple bus, but with not much luk (oddly enough I *am* and EE). I am thinking with it's dual serial protocol, maybe it isn't too strict with the timing? Or if it is, I could make a parallel -> serial converter to collect data and then shooting it out at the 2 mhz speed the DC wants. I was doing research today, and totally stumbled across this thread! I think I will delay my efforts for now and see how yours turns out, for it's much easier to NOT re-invent the wheel :)

Mucho props to you my friend, and I will open some of my many PS2 2 DC converters to get an idea of what they are using. Perhaps this may be a help to you or anyone else who wants to simulate a DC joystick.
MC68HC11 at 2Mhz? Please keep in mind, I don't know the Motorola uC's well at all, but I was under the impression that each instruction would take somewhere between 2-6 clock cycles (I forget the official name of it. E-steps or something). The Maple bus transmits at 2Mbits/sec, giving you only 500ns between bits. You sure that'll be fast enough to bitbang? Unless you converted the signals to something a separate function like SPI or SPP could read and write, I don't see how you'd get around the immediate speed problem. Of course if you did figure out how to convert the signal to something SPI could read, then for the love of god, tell me how, because that would mean implementing would be easy. I am hoping my friends can help point out a few normal glue logic gates that will help make it easier to read, even if it is not in SPI format. I'm thinking having an OR gate, so when it is time to read the data, we know which bit is being sent (since one will be low to mark the clock, the other line is the bit to read. Both inputs in an OR will give us the bit to read) and having the two lines each going to an input that will trigger an interupt on negative edge (since according to the waveforms in the maple bus patent, the only times the lines drop is when sending the clock tick so the other line is read). Sad thing is, even doing that, I have only about 3 assembly instructions possible in the interupt to stash the bit, since I only have 6 instructions between bits. I'm not too worried about writing to the bus; as long as the string of bits to send has been figured out before sending, I am sure I can have it move the data line and the clock drop every 6 instructions.

But boy am I hoping they can help make it something SPI can read; that'd make it soo much easier. :) As always, anything I figure out, I'll be posting here.

As for converters, I know the Innovation converter uses a slower PIC, the 16C...err, 16c57? Damn, I forgot the PIC they use. They have a daughterboard on them with a 74HC126, a cap, and a transistor on it. I've tried to map out the connections as best I can, but it makes no sense at all so far. I am hoping to see the in and out with my Oscope when I get a chance to see if it makes any sense when I see it run.

ComboMasher
05-30-2007, 04:24 AM
Why isn't this thread a sticky?

Great stuff toodles!!!!

Vidness
05-30-2007, 07:06 AM
I just opened one of my best converters, and the CPU info was scratched off! But I was going to solve the DC thing one of two ways:

1. Test the maple bus for speed acceptance. I am 62% sure that it will allow a slow CPU to send the data based on the negative edge of the serial line that is the 'clock'.

2. Build TTL circuitry that can talk 'speedy' to the DC, and just send it 8 bits at a time.

One of these has to be the case for converters, for putting beefy CPU's in a device doesn't make you a lot of money. I'll do more research tonight with my other adapters.

Numbski
05-30-2007, 07:30 AM
@Vidness - That sucks. I hate it when vendors go scratching identifying info off of IC's. Actually, back in 1999 there was a company called Netpliance that put out a pretty neat little QNX-based box called i-Opener. Getting Linux to run on it was pretty simple...then they locked down the bios, which was socketed. Next revision? The bios was epoxied into the socket. So then we had to spend half an hour scraping epoxy off prior to switching out the chips. :P Lame...

@Toodles - yeah, I could probably get the stuff running in Wine (I have Crossover Office here...just about all Windows software works, but I avoid it as it's a pain to set up the first time)

Toodles
05-30-2007, 01:08 PM
The more I think about it, the more I think that OR gate will help a lot with DC support. I can't count on it to always switch the dropping clock line; there are interupt commands it sends by holding one line low and pulsing the other high a low repeatedly.

Does anyone know of any kind of logic gate (or a chip using multiples of the same gate, but only needing one chip for our needs) that will change the output on the falling edge of either of two inputs? Perferably either toggling the state (from high to low, or low to high) so that each change happens when one of the lines is dropped. I guess the truth table would look something like this:

(X = Don't Care)
Input 1 Input 2 Output
_/---- X No Change
---\__ X !O (opposite of what O was before the change)
X _/---- No Change
X ---\__ !O (opposite of what O was before the change)

Or maybe that would pull the output line high (or low, I can check either way) when one of the inputs goes low, and then changes the line back to normal when either of the lines goes high (since there will always be at least one line going high before the next 'clock' tick)

Input 1 Input 2 Output
---\___ X H
___/--- X L
X ---\___ H
X ___/--- L

It's a longshot, but if any EE guys have any ideas on how to make something like the above, please let me know.

The racing gear just got in. I'll be checking the thread prolly once a day, but won't be able to do additional work on the UPCB until this is done. I will make a thread in the Trading outlet when the kit parts come in.

If anyone wants to help, I could certainly use contructive criticism on the two Instructables currently up. Grammar, typos, anything that doesn't make sense that you feel could use more explanation. I'd like to have it be as complete as humanly possible, while staying on topic (so no How to Solder, or What's a PIC Programmer type info) just with the assembly of a UPCB or UPCB console cable.

Vidness
05-30-2007, 05:03 PM
So I popped open a couple of my other adapters...One had a EM78P447SBP in it, with another chip epoxied. The other had both of it's chips epoxied. The third, however, had nothing covered. It is using a PIC16C57C, with a 20Mhz crystal next to it. The schematic wouldn't be *too* hard to discern, and I suppose the chip is readable (if I had a programmer). Hopefully this can lead us to an easy DC solution.

I'll take a closer look at your question. Seems that the first can be designed with a feedback circuit. The 2nd seems quite easy, perhaps that OR gate you were talking about.

DC code you will be ours!!

Toodles
05-30-2007, 05:21 PM
PIC16C57C sounds like the one in the Innovation I mentioned. Did it have any other parts between the DC data lines and the PIC? Cuz I know the UPCB PIC is faster.

If you have a way of trying ot read the code on that PIC, please do. All of my programmers use serial, and that chip has to use a parallel method of programming like the PICkit 2 uses. There is a very good chance the code is protected, so we'd prolly be up a creek even if you have the hardware to read it.

Oh, and I realized the secondtruth table I put up wont work. If the DC sends 10, there will be no low to high transistion between bits.

If we can:
1) Make a clock circuit that goes from low to high when either of the data lines goes low, and holds itself high for 1-3us before falling back down to low.
2) Make an OR gate that will only change state when either of the data lines goes low, and holds the output at that value until the next time one of the lines goes low.

Then BAM, we have a way to read the incoming data via the SPI. The output of 1 would be used for the clock line, the output of 2 would be the serial data in line (that's why the special OR gate; so we know the value is legit, even though we'd be reading it on the falling edge of the clock 1-3us after the clock went high) We'd still have to bitbang the writing to the data lines , but that's much much much easier and less error prone than reading the incoming data.

shoo
05-30-2007, 05:43 PM
It is now in the essential thread
http://forums.shoryuken.com/showthread.php?t=132452

Toodles
05-31-2007, 02:10 AM
!@#$!#$%! The student edition of C18 expired recently. It still works, but loses some of the optimizations. No optimizations means that the bootloader code extends past 0x800 and causes it to break. I actually had to program the hex from the last release just to get a good bootloader. Damnit, I'm gonna start write protecting that bootloader area for safety's sake. Don't worry, none of these means a damn thing to anyone, I'm just venting.

First post updated, version 1.2 released. Changes are:
-All USB code consoladated (sp?) into usbtemplate.c and usbtemplate.h. This should make adding other USB devices side by side a bit easier than fishing through too many files that go 4 subdirectories deep.
- usbtemplate.h includes the needed pinout information for making the different USB cables.
- Added support for EJP/Jaguar and 3DO. Both are untested.
- Added a config.h to hold the different selectable configuration options, like LEDs and buttons on the unused lines.
- Changed the HID descriptor back to the Radio Shack converter. Now works on PS3.

Last update for a bit while I work on another project. I'll update when the boards and kits are in. When the other project is through, first thing is fixing the PS2 code.

Numbski
05-31-2007, 07:40 AM
I'm puzzled. (Understand you're talking to a network engineer, and sometimes perl coder here, bear with me...)

I was of the impression that the DC's maple bus was a well-documented beast. Am I wrong about this? I have an off-brand DC controller here I can pop open to see if there's anything useful about it, but I'm a bit suprised that a controller that doesn't have analog buttons such as the DC would be so difficult. Last I looked, all of the buttons on my controller hit to a common ground, are simple digital gates, and hit back to an IC (or is the IC in question the major problem here...?)

Numbski
05-31-2007, 07:58 AM
(Went ahead and opened up the controller...it's a first-gen mad-catz controller, 6 face buttons, Z/C which are just L/R rewired.)

It has a single IC, Xilinx XC9572. Has some other numbers on it:

PC44AEM9917
F1083247A
15C

Just at a glance, the buttons do share common ground. The chips appears to be an FPGA:

Manu Part # Description DigiKey Part # Price Each

U1 XC9572-15PC44C Xilinx CPLD 122-1171-ND $5.35

Numbski
05-31-2007, 08:01 AM
In case it becomes pertinent at some point, you can make a programming cable for the FPGA chips:

http://toolbox.xilinx.com/docsan/2_1i/data/common/hug/fig13.htm

Another potentially useful link:

http://www.dcemu.co.uk/vbulletin/showthread.php?t=58804

Vidness
05-31-2007, 11:06 AM
EE & perl programer here as well :) The problem with the Maple bus is twofold:

1. The speed at which it handles data, on the order of 2mhz, and
2. The method it deals with data, using an alternating clock scheme.

Both are by no means unsurmountable, just will take time and perhaps creativity with the given hardware. Knowledge of how the DC handles certain situations would also be nice. If we were just sending data, that would improve our situation, but we also need to read data from the DC as well, in order to follow the functions it asks. Fun stuff :)

Toodles
05-31-2007, 10:16 PM
Vidness explained it well. How the maple bus works is well documented, but it is still a complicated protocol running at very fast speed. Hell, I've stick got an incomplete PS2 code, which is a simple protocol running at 1/4 the speed. But the source code to UPCB is open, so I encourage everyone and anyone to give it a shot. It's just C code, and a quick look at any system already in there should give you an idea of how things work. I dont care how it's done, as long as it works. I just think a little bit of glue logic, hopefully small enough to fit in a Dsub-15 hood, would make the process a whole bunch easier and more reliable. I'd love to learn to play with FPGA's down the road, but they are outside of my ability for the moment, and I have never seen a through-hole FPGA, only surface mount. Using the PIC meant assembling would be fairly easy, even if the only soldering you've ever done was tinning speaker cables. It also allowed me to reuse the bootloader code and USB code that was already provided by Microchip.

Heh, long time Perl coder here, too. Make sure to download the code so you can see it without the word wrapping.
http://www.perlmonks.org/?node_id=118799

Toodles
05-31-2007, 10:42 PM
Ya know, if someone DID manage to pull the code from that FPGA, and they're still available to purchase like Numbski said, then making a daughterboard specifically for it would be very doable. Instead of the IDC header in the DC Connector part of the UPCB, just put in a standard 2 row header. Make the daughterboard with optional VMU connector (the vmu connector would have to come from a sacrifice VMU or puru puru pack, but would be optional), a place for the fpga and any components it needed, and have it connect straight to the headers like the old Xbox mod chips that connected straight onto pins soldered to the LPC bus did. Hmmmm.

Any FPGA guru's in the house?

Toodles
06-01-2007, 12:10 AM
Oh shit son, am I reading this right? Someone wanna help me wrap my head around this? Page 16 of 76 in the maple bus (page 17 of the pdf), Fig. 28 and 29.

http://boob.co.uk/docs/MaplePatent.pdf

If I'm reading that right, that's a one chip, (two chip tops) method of converting DC to parallel, 8 bits at a time. Damnit, and none of the pins for the parallel function of the PIC are on the output pins. There are other small schematics for detecting the start pattern/start crc pattern/end pattern crap, too. Man, i gotta try to hunt down a shift register that'll match that waveform. If that one shift register does what I seriously think it's doing, that's the hard part. Filling in all of the details of the communication would be time consuming as all fuck, but itd be POSSIBLE ffs.

Edit: The 4015 chips like the 74HC4015 look perfect, except they mark the clock by the transition from low to high, and we need the other direction. I suppose I could use a single inverter chip to invert the two lines going in and the one line going out......hmmmm

Steve F
06-01-2007, 01:22 AM
Great work man, you are working FAST! I read the post from the beginning, and it sounds like it's going great. The PCB you had custom made looks awesome. I wish I knew enough about programming to help with something... I will definitely want one of these when you have all the kinks worked out.

Vidness
06-01-2007, 04:39 AM
Oh shit son, am I reading this right? Someone wanna help me wrap my head around this? Page 16 of 76 in the maple bus (page 17 of the pdf), Fig. 28 and 29.

http://boob.co.uk/docs/MaplePatent.pdf

If I'm reading that right, that's a one chip, (two chip tops) method of converting DC to parallel, 8 bits at a time. Damnit, and none of the pins for the parallel function of the PIC are on the output pins. There are other small schematics for detecting the start pattern/start crc pattern/end pattern crap, too. Man, i gotta try to hunt down a shift register that'll match that waveform. If that one shift register does what I seriously think it's doing, that's the hard part. Filling in all of the details of the communication would be time consuming as all fuck, but itd be POSSIBLE ffs.

Edit: The 4015 chips like the 74HC4015 look perfect, except they mark the clock by the transition from low to high, and we need the other direction. I suppose I could use a single inverter chip to invert the two lines going in and the one line going out......hmmmm

Good find!! It does look like it each shift register is responsible for every other bit. The bottom one takes the 0-bit, then they switch and the top one takes bit-1, etc, until all 8 bits are accounted for. This is the type of thing I was suggesting earlier (option #2 on my May 30 post). I have an all-day convention today, but I will definitely devote some time to this over the weekend.

I don't quite follow how a transition of high to low for a data change won't trigger an accidental data pull on the 'off' register...perhaps there is an 'enable' on the shift register that is synchronized to a 2mhz clock? Still, I can definitely see this working...

realtea
06-01-2007, 07:12 AM
[QUOTE=Toodles;3900658]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.


Just stumbled across your UPCB project... Absolutely amazing! I've been using a dsPic30F6040A to so a PS2 controller to console interface among other things. But frustratingly getting stuck on emulating a PS2 controller (analog red mode) while pumping out seemly appropriate bit pattern responses on the SPI to the console. Specifically the console is not switching its clock freq from 250KhZ to 500kHz to engage the PS2 controller mode.

You mentioned both a SPI and bit banging approach. The SPI seem the more elegant of the two (utilizing existing on-chip modules)...

I would like to request some advice on how you got it to work and perhaps your latest code. This means I could port it to the dsPIC30 development board and assist in some that aspect of the PS2 testing as well as getting me out of a deep hole... Hope you can help!

Toodles
06-01-2007, 12:28 PM
I don't quite follow how a transition of high to low for a data change won't trigger an accidental data pull on the 'off' register...perhaps there is an 'enable' on the shift register that is synchronized to a 2mhz clock? Still, I can definitely see this working...Hell I can answer that. The first one has the serial input connected to A, and Clock connected to B. Second one has the serial input connected to B, and Clock connected to A. The idea behind the shift registers is that each one of the lines, will go up and then down, every 1MHz. It may go up immediately after it went down, or just before it goes down again, but it will go down every 1us, and go up sometime between each drop. Look at the waveforms on that page by itself. However I can't seem to find chips that act when the clock drops, only when it rises. Unless Im completely off my rocket when reading them.

So, let's see. An inverter to swap the two lines so the shift register shifts at the right time. A counter (that has an enable and reset line) set to count the number of rising edges that will set or drop a line when it gets to 4 (to tell the uC to read the 8 parallel bits when the 4th bit has been latched). And the counter flip/flop setup in the pdf to tell use when we get a valid start frame/start crc frame/end frame data, so we can reset and enable the counter. uC waits until one of the start frame command pins drops. When it does, the counter is reset. When the counter pin shows the 4th bit has been read, uC reads all 8 bits at once, stashes it in a buffer and resets the counter. Repeat until an end frame pulse is found or an error pulse if found.
I think that'd make you able to read the data from the DC, even on a 2MHz uC. There's still sending to deal with, but it looks like the pdf answers most of that except for how to make the CLKA, shift CLKA, CLKB, and shift CLKB lines.

I am starting to think that doing this will require either a bunch of logic and a separate microcontroller on a daughterboard connected to the DC Connector port, or a single CPLD in the Dsub hood. Maybe I'm gonna have to leard vhdl or verilog....

Does anyone know: Does the DC controller have to package the data it sends to the DC in the 'start frame' and 'end frame' pulses, too? And how does the DC controller figure out which port it's pluged into?


Just stumbled across your UPCB project... Absolutely amazing! I've been using a dsPic30F6040A to so a PS2 controller to console interface among other things. But frustratingly getting stuck on emulating a PS2 controller (analog red mode) while pumping out seemly appropriate bit pattern responses on the SPI to the console. Specifically the console is not switching its clock freq from 250KhZ to 500kHz to engage the PS2 controller mode.

You mentioned both a SPI and bit banging approach. The SPI seem the more elegant of the two (utilizing existing on-chip modules)...

I would like to request some advice on how you got it to work and perhaps your latest code. This means I could port it to the dsPIC30 development board and assist in some that aspect of the PS2 testing as well as getting me out of a deep hole... Hope you can help!

When I was looking for information to see if others have done something similar, I came across a post from a guy complaining of the same problem. He mentioned briefly that he did get xbox working via a uC though. If you're that guy, PLEASE get ahold of me about how you did the xbox!

The post complained that he could get it working as the dualshock 1, but his post indicated that the PS2 somehow was identifying the dualshock 2 controllers immediately and instantly kicked the clock up to 500KHz. If that is true, then I do not know how it is identifying the controller so quickly. It would make sense that the bus would start at 250Khz, run a couple of commands to the controller to identify its capabilities (Commands for querying and setting modes: http://lynxmotion.com/images/files/ps2cmd01.txt ) and then kick it up to 500KHz once it has comfirmed the controller supports it. This is what would make sense, but either that poster wasnt aware of those commands, or the ps2 is using some other method of checking to see if the controller supports 500KHz.

I agree that SPI is the best way to do this and that is how it is currently implemented. The code I'm using is only trying to emulate a digital PSX controller, and has no support currently for anything else, or for any commands other than the 0x42 status command. You're free to take a peek at it; it's in psx.h and psx.c in the archive, linked in the first post of the thread. Its written for C18, but if you want the disassembly for those functions instead, I can easily send them to you. But to be honest, it sounds like you may be farther supporting it than I am. Any input you may have would be appreciated, and I'd love to see the code you're using as well. If you have the ability, via Oscope or any kind of snooping, you should check the clock line on the legit dual shock 2 when it is first plugged in. If the clock immediately starts at 500KHz, then I don't know how it's identifying that the controller supports it. If it starts at 250KHz, and then later changes to 500KHz, then you can bet that the PS2 is querying the controller, and changing the clock when it gets the response that the controller supports it.

On a PS2 with PS2 games, the controller code is not properly working in the P1 slot, but works fine in P2. If I could take a peek at your code as well, maybe I can resolve that problem.

Numbski
06-01-2007, 03:18 PM
Heh, long time Perl coder here, too. Make sure to download the code so you can see it without the word wrapping.
http://www.perlmonks.org/?node_id=118799

You're a sick man, Toodles. :)

Numbski
06-01-2007, 03:27 PM
Ya know, if someone DID manage to pull the code from that FPGA, and they're still available to purchase like Numbski said, then making a daughterboard specifically for it would be very doable. Instead of the IDC header in the DC Connector part of the UPCB, just put in a standard 2 row header. Make the daughterboard with optional VMU connector (the vmu connector would have to come from a sacrifice VMU or puru puru pack, but would be optional), a place for the fpga and any components it needed, and have it connect straight to the headers like the old Xbox mod chips that connected straight onto pins soldered to the LPC bus did. Hmmmm.

Any FPGA guru's in the house?

Not a guru, but the programming cable can be made. I'm presuming one can read from an fpga as well as write using the same cable...or I would hope anyway. If that's the case, what needs to happen is I sacrifice my controller, get an fpga socket, and solder it to the programming cable. The issue is that the solder points for the socket will be TINY. Unless there's a hold-through version that I can put it into a little piece of breadboard...in that case I have some chip-off around here someplace from way back when. If I can find it, use that to remove the fpga chip (it's a surface-mount chip version rather than socketed), and drop it into the socket.

If that logic doesn't carry, I guess I could always leave the chip on the board, and solder the programming cable directly to the controller at nearby solder points. Might be easier to do at the end of the day too.

Numbski
06-01-2007, 03:39 PM
Oh, btw...I found this comment:

>>It appears that most FPGA's are programmed with a serial eeprom.

I have closed my controller up now, but I don't recall seeing an eeprom on the controller. I'll look again later. If that's the case, then what we need is an eeprom reader, and then figure out how this thing fires up. You'd have two chips, eeprom and fpga, and that'd be about it. If you could fidget the eeprom code into your existing chips, then your design goes up by 1 chip, nothing more.

realtea
06-01-2007, 04:23 PM
I agree that SPI is the best way to do this and that is how it is currently implemented. The code I'm using is only trying to emulate a digital PSX controller, and has no support currently for anything else, or for any commands other than the 0x42 status command. You're free to take a peek at it; it's in psx.h and psx.c in the archive, linked in the first post of the thread. Its written for C18, but if you want the disassembly for those functions instead, I can easily send them to you. But to be honest, it sounds like you may be farther supporting it than I am. Any input you may have would be appreciated, and I'd love to see the code you're using as well. If you have the ability, via Oscope or any kind of snooping, you should check the clock line on the legit dual shock 2 when it is first plugged in. If the clock immediately starts at 500KHz, then I don't know how it's identifying that the controller supports it. If it starts at 250KHz, and then later changes to 500KHz, then you can bet that the PS2 is querying the controller, and changing the clock when it gets the response that the controller supports it.


Your first question: No, I'm not the same guy so unable to help with the XBox issues.

Fortunately, I have access to a scope and can see the hand-shaking taking place when a legit PS2 controller is plugged into the PS2 console. The clock starts at 250kHz and a complex hand-shaking procedures follows which eventually cumulates in the console deciding that the controller can support 500kHz. It has not been possible to decipher the procedure yet, since it takes place over many frames. I can only the trigger the scope on one frame at a time. Effectively, my efforts are comparable to yours on this narrow PS2 controller topic. I am in pursuit of a possible solution and will send you the outcome (and relevant code) of my investigation as when I get them in the next few days.... Magnificent effort on your part in the UPCB! :)

Toodles
06-01-2007, 05:55 PM
Numski, I think usually development FPGA's use eeproms to hold the code, which is loaded when the FPGA boots. It looks like that CPLD holds the code itself internally. I dont know i it can be READ, but they can be programmed. I doubt highly there is a separate EEPROM on that controller.

Your first question: No, I'm not the same guy so unable to help with the XBox issues.

Fortunately, I have access to a scope and can see the hand-shaking taking place when a legit PS2 controller is plugged into the PS2 console. The clock starts at 250kHz and a complex hand-shaking procedures follows which eventually cumulates in the console deciding that the controller can support 500kHz. It has not been possible to decipher the procedure yet, since it takes place over many frames. I can only the trigger the scope on one frame at a time. Effectively, my efforts are comparable to yours on this narrow PS2 controller topic. I am in pursuit of a possible solution and will send you the outcome (and relevant code) of my investigation as when I get them in the next few days.... Magnificent effort on your part in the UPCB! :)

Damn, it was a longshot with the xbox, but had to ask. Knowing that clock speeds up after handshaking is a huge help tho. The commands in that txt file I linked to should be the ones that tell the PS2 that its a dual shock 2, and then ps2 tells it to enter dual shock 2 native mode. Controller responds with a successfull response, and the ps2 kicks up the clock. It makes sense and sounds like 'The Right Way'.

Dont worry about the trigge