PS3 Gamepad With Home Button

Teensy++ on a breakout board

It's no secret the PS3 will work with most USB HID gamepads or joysticks. However the Home button is something special. If you connect your sixaxis controller to your PC and monitor button presses, the Home button comes up as button number 13. If you then create a standard gamepad with the same button mapping, the PS3 will refuse to recognize the Home button.

After some tracing of the USB traffic from an official Madcatz Street Fighter IV FightStick I was able to come up with a solution! There are 8 bytes transfered during the enumeration phase, just after the device sends it's report descriptor. Mimicking the same exchange results in the Home button functioning correctly when button 13 is pressed.

I used the amazingly awesome Teensy++ development board after being inspired by this guys work. I also used the report descriptor from Toodles UPCB project which appears to come from the SEGA VIRTUA STICK. This descriptor is very similar to the one from the Madcatz controller, except their is one endpoint instead of two which simplifies things somewhat.

I also created a shield (pictured above) which brings several pins on the Teensy to convenient screw terminals.

Source code and Eagle files are available in a git repository. Code is licensed under the GPL v3 and the PCB design is distributed under a Creative Commons license Attribution-ShareAlike 2.5.

Terminal reference

This document can be printed onto transparency for exposing your pre-sensitized copper clad. To use this for toner transfer, be sure to mirror the image first.

And a compiled version of the code in ihex. This is for the teensy++ 2.0. The code might work with other versions of the teensy, but a re-compile will be required.

Comments 21

  1. Ricky wrote:

    Interesting, I was wondering how did you trigger the host to get HIDGETREPORT for the magic 8 bytes? Do you use the interrupt pipe? or the default end point? Basically I should send these 8 bytes right after the HID report? Do you have a USB capture showing these magic bytes being sent? I am implementing it on a V-USB firmware. The PS home button is not really working at the moment! :( Thanks for your help!

    Ricky

    Posted 09 Jun 2010 at 04:09 AM
  2. jiGGaK wrote:

    Ricky,

    I actually didn't do anything special to trigger the host to ask for the hid report. The request just seems to come in automatically on endpoint 0.

    I don't have any saved captures but if you think it will help I'm sure I could get one for you.

    A while back I tried to get the PS button working using the V-USB library on an atmega-8 but came to the conclusion that it was not possible. V-USB can support low-speed devices only and I think full-speed is required to make it work (I forget why I came to this conclusion).

    Posted 09 Jun 2010 at 05:50 AM
  3. Ricky wrote:

    Thanks for your reply! I think the only problem with the V-USB is that the interrupt pipe can only send out 8 bytes of data at once for low speed device while the full speed device can send more data. For this device, it's over 8 bytes for sure. I will go try to make work on my At90usb1287 since I got one laying around. haha

    Posted 09 Jun 2010 at 12:17 PM
  4. Ricky wrote:

    wow! I was testing my code with the V-USB using an atmega88. I was able to use the Home button using your magic bytes! turns out you can stack the interrupt end point to send 19 bytes at once. Good job on your find man! appreciate it!

    Posted 09 Jun 2010 at 01:54 PM
  5. jiGGaK wrote:

    Ricky,

    That is awesome! Any chance you could share your code? I have a few atmega 8 based boards I'd love to get working with the PS3.

    If you want I have a forum where you could post. Or send me over the code and I'll do a write up (giving you full cred of course).

    Posted 09 Jun 2010 at 01:59 PM
  6. ant.b wrote:

    Hi jiGGaK, I'm trying to compile your code on a atmega8u2 on a arduino uno. I use at90usb162 code. It seems to enumerate properly and i can see the gamepad on my computer but i can't send data. The problem is on usbgamepadsend(void): the if statement (UEINTX & (1<<RWAL)) never come true and there is a timeout. Do you know what can I check to find the error? Thanks for your help.

    Posted 02 Nov 2010 at 03:23 AM
  7. jiGGaK wrote:

    Sorry, I don't have any tips for what could be wrong there. It seems strange that you use at90usb162 as the MCU target for the the UNO's atmega8u2. Are you certain that's the right target?

    Posted 02 Nov 2010 at 05:57 AM
  8. jiGGaK wrote:

    Ignore my question about the at90usb162 target. I see now that it is binary compatible with the atmega8u2.

    Posted 02 Nov 2010 at 06:10 AM
  9. David wrote:

    Hey guys, I was trying to get running the PS button on my 18F4550, using 8 bytes report, but I'm not able to get it working, so.. can anybody help me?

    Thanks in advance!

    David.

    Posted 03 Jan 2011 at 05:15 AM
  10. jiGGaK wrote:

    David,

    I wasn't able to get the PS button to work using the v-usb library. Ricky apparently had better luck but he didn't respond to my emails regarding sharing his solution.

    Posted 03 Jan 2011 at 07:55 PM
  11. David wrote:

    Hi jiGGaK,

    Thanks for your reply. Aw that's not good if Ricky do not respond your emails.. I don't know what more to do to get PS button working.

    By the way, maybe you can hel me with another problem. I can't able to run my board with GT5, it works on menu, but when I try to play, only works "start" button. I tried to put same VID and PID as Sony and Logitech.. but nothing. Any idea? It works with other games, only I have problems in gran turismo.

    Thanks! David.

    Posted 14 Jan 2011 at 01:20 PM
  12. MaDMaLKaV wrote:

    I was looking into doing this very same thing with an Arduino Uno as a learning project. Thanks for the info!

    Posted 25 Jan 2011 at 04:03 PM
  13. CRP wrote:

    Hi, I started working on a PS2 to PS3 adapter based on this project: http://element42.org/PS3negcon/

    I got it working, but am stuck at two issues:

    1. the damn PS button: does anyone know what Ricky above means by "you can stack the interrupt end point to send 19 bytes at once"?
    2. trigger buttons: I would like to use the analog buttons on the NegCon to send analog trigger (L2 and R4 on the sixaxis) to the PS3, but I do not know how to set up the reportDescriptor. All examples I have seen treat those as digital buttons...
    Posted 27 Jan 2011 at 05:49 PM
  14. jiGGaK wrote:

    Not sure what Ricky was talking about, but regarding the analog triggers if you look at my source code the report descriptor includes all the axis definitions. The gamepad_state_t struct has the R2/L2 values as the last two bytes. 0x00 is fully depressed and 0xff is fully pressed.

    Posted 28 Jan 2011 at 07:54 AM
  15. CRP wrote:

    Hi, just wanted to let you know that I made some progress and found out what Ricky has done. Please have a look at this post if you want to use those atmega8's:

    http://www.wipeoutzone.com/forum/showpost.php?p=192480&postcount=178

    Posted 28 Jan 2011 at 05:35 PM
  16. Lyn wrote:

    Hi, Can the analog inputs be added to this?

    Posted 19 Feb 2011 at 09:35 AM
  17. jiGGaK wrote:

    I don't see why not. Have a look at the gamepad_state_t struct in usb_gamepad.h. The various inputs are labeled well and describe what values need to be sent for analog inputs.

    Posted 19 Feb 2011 at 03:49 PM
  18. John wrote:

    I used your sourcecode as a base for my SNES project. Thanks for sharing! I posted an instructable at: http://www.instructables.com/id/SNES-Teensy-USBPS3-Gamepad/

    Posted 30 Sep 2011 at 02:56 AM
  19. Ivan wrote:

    Hi, what endpoint send the magic bytes?, i send final the endpoint 0 in pic18f2550 and don't work...

    Posted 27 Nov 2011 at 01:55 PM
  20. Ivan wrote:

    I get work the PS button in a PIC18F2550, and I don't use the magic bytes, only de same descriptor...

    Posted 06 Dec 2011 at 05:04 PM
  21. Fons wrote:

    I get work the PS button in a PIC18F2550, and I don't use the magic bytes, only de same descriptor... Ivan, your .hex can work with the Mjoy16 project and has analog inputs for pots?

    I'm working with the analog axys to build my own stick.

    Posted 08 Dec 2011 at 10:28 AM

Post a Comment

Your email is never published nor shared. Required fields are marked *

Thanks! Your comment will be reviewed shortly.