Sunday, October 31, 2010

Build your own XIM1->PS3 adapter

Alright, here's the tutorial.

The first thing we'll go over is what you'll need. Of course, you'll need an original XIM. The XIM used one of two daughter cards, either the F330 or the F362. My XIM was made using an F330, but this should work with the F362 card, as well.

The second thing that you'll need is a Teensy 2.0 dev board. They're available directly from the manufacturer at PJRC.com or you can also buy one from adafruit.com. If you get it directly from PJRC, you can get it without pins and save a few dollars. I soldered pins onto the one that I bought because I'll most likely use it for other things as well. If you're interested in microcontrollers, the Teensy is a good platform to start with.

The third thing that you'll need is one of the USB cables that you charge your PS3 controllers with. You'll use this USB cable for connecting the adapter to the PS3 and also for programming the Teensy.

Lastly, you're going to need the Teensy loader software and the HEX file that we're going to program the Teensy with. The Teensy loader software can be downloaded from PJRC at this link -> Teensy Loader download. The HEX file can be downloaded from here -> USB HID Gamepad HEX file.

Now it's time for the fun stuff. The first thing you're going to need to do is figure out where to solder the wires to. The connections listed in the picture below are for the F330, so if you've got a F362 you may not be able to use this.



Once you've got all the solder connections done, connect the Teensy to your computer with the USB cable and run the Teensy loader app. In the file menu, click open HEX file and browser to the HEX file you downloaded earlier. Click the AUTO button in the menu and then press the button on the Teensy to load the HEX file onto it. In AUTO mode, the Teensy loader app will automatically program the chip and then reboot it. After being rebooted, it should show up in device manager as a HID gamepad.

The next step is to try it with the PS3. These are the steps that I have found to work best when getting the XIM/Teensy connected to the PS3. First, turn the PS3 on by pressing the power button on the face of the PS3. Next, connect the Teensy-side of the adapter to the PS3. The Teensy will power on at this point. Then you'll need to plug the other side of the XIM into the computer and run the XIM software. The number of updates should be showing somewhere around 125.

Right now there's no PS button emulation since generic HID devices "can't" have one. My initial goal with this project was to create something that could get around whatever restrictions that Sony has implemented, and I've done that without too much trouble. Now it's time to start working on the specific stuff. Also, there's always a possibility that I've managed to switch a few buttons when I'm translating the PSX into USB. If you find a problem, post in the comments and I'll get it fixed.

DIY XIM1->PS3 adapter tutorial info

In my last post I mentioned that I was evaluating two new pieces of hardware, one of which would hopefully work for the DIY XIM1->PS3 adapter. Well, I just finished a quick and dirty port of my code over to the new hardware, and it works great. The updates per second with the new hardware is running at 125 per second, and since there's other adapters out there that run that fast, I'm not going to try to slow it down any. It _might_ run a little faster once the code is cleaned up, but I won't know until I get that done.

Wednesday, October 27, 2010

Odds and ends...

Here's a few updates on several different facets of this proect:

1) I'm still working on the XBox360->PS3 adapter. My logic analyzer should be here tomorrow to help with getting the MCU talking to the USB host IC that I'm working with. I'm a little worried about latency at this point, but I have nothing to base those concerns on and won't be sure about anything until I get everything working.

2) I said a while ago that I had chosen the C8051F342 as the development platform for this project. Ever since then, I've been using an AVR development board. The code is semi-working on the F342, but I've yet to even really start porting the more critical portions of the code over. Both the F342 and the ATMega328 are more than capable for the intended purpose, but the final platform is all going to depend on latency.... which brings me to my next point.

3) I'm in the process of evaluating two new pieces of hardware. The first is an all-in-one IC that can host both the XBox 360 controller and be a slave to the PS3 all at the same time. This is the ideal platform, but it'll mean starting over on the whole project and learning a completely new architecture.

The second piece of hardware that I'm looking at will be for the original XIM users that want to have a firmware upgradable adapter that they can build themselves and who aren't interested in upgrading to XIM2 or XIM3 once I get the XBox360->PS3 adapter working to my liking. Bootloading the MCU to allow for easy firmware upgrades is something that I've given a lot of thought to, and I think that there's already great solutions out there. Once I get the new MCU and get the code ported to it, I'll make a post with all the details and a link to download the hex code needed to get everything running. The only thing that you'll need to program the hardware that I'm looking at will be a USB cable.

Unfortunately, there won't be a DIY solution for the XBox360->PS3 adapter since some custom PC boards will have to be printed up.

Monday, October 25, 2010

Another quick update

Last week I began playing around with trying to get a USB host IC to talk to the XBox 360 controller. Despite my best efforts at the time, the communication was problematic at best. Last night I decided to play around with it some more, and I'm fairly certain that I've figured out what the problem was. However, the data is being sent over a UART, and that'll never work for the finished product. The next step is to get the host IC sending and reading data via it's parallel FIFO buffer, which brings me to my next piece of news.

I just ordered a 34 channel logic analyzer. I'd been thinking that I needed one for a while, and it became even more apparent while I was working out the Playstation controller's protocol. Working with micro-controllers without some way to debug what's happening is like running through the forest with a blindfold on.... chances are you're going to hit a tree! While I'm waiting for the logic analyzer, I'm going to try to work it out on my own, but this could be tricky. Regardless, I'm hoping to have FIFO working and talking to the XBox controller by the end of the weekend, after that it'll be a trivial to get it talking to the PS3.

Friday, October 22, 2010

How far I've come, and what to do next...

For those of you following me or reading this blog, I just want to re-cap everything that's happened thus far and seek your opinion on where to take this next. What I've done is nothing especially out of the ordinary. There are others that have done similar things, and I've even linked to a site where a guy is selling adapters much like mine that used to, and may still, be able to connect to the PS3. Furthermore, the adapter that I've made is only running as a low speed USB device. That being said, it should work as well as we'd ever need it to regardless of it's speed...... in fact, that may be the one reason it never get's blocked by Sony. Despite that, this is where this project will hit a split in the road.

OBsIV and I have been emailing back and forth for a while now, and after talking to him it has become a mission of mine to make my adapter also work with XBox 360 controllers, and thus work with XIM3. I'm hoping to be able to pull this off so that PS3 users will be able to use the XIM3 via a quality X360->PS3 adapter that's fully upgradable and supported for cheaper than the other guys can. If this sounds like something that you would like to see, please leave some comments. If there's enough demand, I'll put a rush on this so as to be ready as quickly after XIM3 is released as it possible can be, otherwise it may drag out until January or February depending on exactly how complicated everything becomes.

Here's the video!

XIM working with PS3 and homebrew adapter from Nick Myers on Vimeo.


Well, the hard part of this particular project is done. There are still a few things that need to be ironed out, like easy firmware updates, but those should be relatively easy to get ironed out. I've also got a big decision to make. I'll make another post later today to discuss it, and I'll be looking for some feedback from you guys on which direction I should go.

Thursday, October 21, 2010

I'm so close I can taste it!

All buttons and timings have been handled, and I got my PC to recognize the STK500. I want to do a little more testing before calling it done, but I'm close. I'm going to go eat some Mexican food and drink a few beers and let my brain cool off for a while. I'll get back to this a bit later tonight.

Oh yeah, 180 updates per second without any data corruption!!! THINK ABOUT THAT FOR A MINUTE!

**EDIT**

I've been staying up waiting for Vimeo to finish converting my newest video, but I'm going to sleep. Check back tomorrow (10/22/2010) at about 8:00 AM CST to see what I've got to show you!