PS3 Controller Firmware

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
bencao74
Posts: 4
Joined: Tue Jul 07, 2009 11:58 am

PS3 Controller Firmware

Post by bencao74 » Fri Oct 09, 2009 10:42 am

Hi all,

this is my first post in this forum. I'm quite a beginner in using this great piece of hw/sw.

Some month before I found a USB gamepad implemenation based on V-usb and adapted it for my needs in building an arcade stick.

http://bencao74.blogspot.com/2009/09/lulu-source-released.html

It was easy and straight forward to adapt the source. I've extended the source to use 10 Buttons and a stick. Then I wanted to use my arcade stick on the Playstation 3. I observed that the home button is not working. Since this a important function for PS3 I tried to identify it in the pc usb gamepad implementation, but no success.

I found a project called UPCB http://forums.shoryuken.com/showthread.php?t=131230 that supports the PS3 on the basis of PIC18F4550.

I tracked down the source to the PS3 descriptors (http://www.marcuspost.com/downloads/upcb/UPCB_25.zip)

I mapped the descriptors to my v-usb controller implementation. The device is recognized, but winxp setuppi.log says that my device could not be started (error 10). Here're the descriptors of the UPCB project.

Code: Select all

rom const unsigned char PS3USB_Device_Descriptor[] = {
   0x12, //size of this descriptor in bytes
   DEVICE, //descriptor type = PS3USB_Device_Descriptor
   0x10, 0x01,    //USB Spec 2.0
   0x00,       //class code
   0x00,      //subclass code
   0x00,      //protocol code
   0x40,      //EPO buffer size
    0xC4, 0x10,   //vendor ID
    0xC0, 0x82, //product ID
   //0xC5, 0x11,   //vendor ID
   //0xC1, 0x83, //product ID
   0x06, 0x00, //device release number
   0x01,       //manufacturer string index
   0x02,       //product string index
   0x00,      //device serial number string index
   0x01      //# of possible configurations
rom const unsigned char PS3USB_Configuration_Descriptor[] = {
    0x09,          //size of this desc in bytes
    CONFIGURATION, //type of desc
    0x22,    0x00,      //size of total descriptor
    0x01,          //# of interfaces
    0x01,         //index number of this config
    0x00,         //config string index
    0x80,          //attributes:Default
    0x32,         //power consumption * 2mA
   //Interface portion
    0x09,         //size of this desc in bytes
    INTERFACE,      //type of desc
    0x00,         //interface number (ordinal)
    0x00,         //alternate setting number
    0x01,         //number of endpoints (not including EP0)
    0x03,         //Interface class - HID
    0x00,         //sublass
    0x00,         //protocol code - mouse
    0x00,         //interface string index
   
    //HID portion
    0x09,         //size of this descriptor in bytes
    HID,         //type of descriptor: HID
    0x11, 0x01,   //HID spec release number
    0x00,         //country code (0x00 for not supported)
    0x01,         //number of class descriptors
    REPORT,         //Report descriptor type
    0x70, 0x00,    //size of report descriptor
   
    //endpoint portion
    0x07,      //size of desc in bytes
    ENDPOINT,   //type od desc
    0x81,      //endpoint address EP1 IN
    0x03,      //transfer style: interrupt
    0x40, 0x00,   //max packet size : 64 bytes
    0x0A,      //interval: 10ms
   
};

//HID report from VSHG; need to double check.
rom const unsigned char PS3USB_Report_Descriptor[] = {
 0x05, 0x01,               // USAGE_PAGE (Generic Desktop)
 0x09, 0x05,                 //Usage gamepad
 0xA1, 0x01,               // COLLECTION (Application)
 0x15, 0x00,               //   LOGICAL_MINIMUM (0)
 0x25, 0x01,               //   LOGICAL_MAXIMUM (1) --10
 0x35, 0x00,               //   PHYSICAL_MINIMUM (0)
 0x45, 0x01,                 //   PHYSICAL_MAXIMUM (1)
 0x75, 0x01,                //   REPORT_SIZE (1)
 0x95, 0x0d,               //   REPORT_COUNT (13)
 0x05, 0x09,               //   USAGE_PAGE (Button) --20
 0x19, 0x01,                //   USAGE_MINIMUM (Button 1)
 0x29, 0x0d,                //   USAGE_MAXIMUM (Button 13)
 0x81, 0x02,                //   INPUT (Data,Var,Abs)
 0x95, 0x03,                //     REPORT_COUNT (3)
 0x81, 0x01,                //Input something or other --30
 0x05, 0x01,               // USAGE_PAGE (Generic Desktop)
 0x25, 0x07,                //   LOGICAL_MAXIMUM (7)
 0x46, 0x3b, 0x01,             //physical maximum 315
 0x75, 0x04,                //Report size 4    --39
 0x95, 0x01,                //Report count 1
 0x65, 0x14,               //unit: English angular position
 0x09, 0x39,                //usage: hat switch
 0x81, 0x42,               // Input something or other
 0x65, 0x00,                //Unit:none    --49
 0x95, 0x01,                //report count 1
 0x81, 0x01,                //Input something or other
 0x26, 0xff, 0x00,             // LOGICAL_MAXIMUM (255)
 0x46, 0xff, 0x00,          // PHYSICAL_MAXIMUM (255)  --59
 0x09, 0x30,
 0x09,          //--62
 0x31, 0x09,
 0x32, 0x09,
 0x35, 0x75,
 0x08, 0x95,
 0x04, 0x81,   //--72
 0x02, 0x06,
 0x00, 0xff,
 0x09, 0x20,
 0x09, 0x21,
 0x09, 0x22,   //82
 0x09, 0x23,
 0x09, 0x24,
 0x09, 0x25,
 0x09, 0x26,   //90
 0x09, 0x27,
 0x09, 0x28,
 0x09, 0x29,
 0x09, 0x2a,
 0x09, 0x2b,  //100
 0x95, 0x0c,
 0x81, 0x02,
 0x0a, 0x21,
 0x26, 0x95,
 0x08, 0xb1,
 0x02, 0xc0   //--112 == 0x70
 };



Now I'm getting out of ideas. What do you think about this approach? Does the v-usb cover the requirements that UPCB PS3 implementation needs? How can I get more infos to tackle this issue?

Bye,

Bencao

mojo
Rank 1
Rank 1
Posts: 39
Joined: Tue Mar 04, 2008 3:57 pm

Re: PS3 Controller Firmware

Post by mojo » Sat Oct 10, 2009 11:23 pm

I am working on this too. So far no luck. My device is recognised by Windows and seems to be receiving HID reports, but no movement or button presses can be seen.

I think part of the problem is the HID descriptor. The one used by the UPCB is not the standard Sixaxis one. I think the best option will be to copy one from an arcade joystick for the PS3, which I am going to try doing at some point.

bencao74
Posts: 4
Joined: Tue Jul 07, 2009 11:58 am

Re: PS3 Controller Firmware

Post by bencao74 » Mon Oct 12, 2009 1:46 pm

Hi Mojo,

according to the source from UPCB Toodles has taken exactly this way.

//HID report from VSHG; need to double check.
rom const unsigned char PS3USB_Report_Descriptor[] = {


This was the VSHG http://sdtekken.com/tech-area/arcade-sticks/ps3-vshg/virtua-stick-high-grade-review/ Stick.

Hope you've better luck!

Jochen

CRP

Re: PS3 Controller Firmware

Post by CRP » Fri Jan 28, 2011 10:50 am

Hi, sorry to revive this thread, I hope somebody is still willing to follow up.

In order to emulate a PS3 controller, I am trying to use the PS3's own HID report descriptor, which should be as described here:
http://ps3.jim.sh/sixaxis/usb/lsusb.txt

I admit that I do not understand most of it, there are some portions which are really strange, such as the 13 bits right after the buttons, which maybe serve for padding. And then there are the additional collections at the end (5 times 48 bytes!!!). Anyway, if I ignore those last bits, I would end up with a 9 bytes reportBuffer, which is not acceptable for V-USB.

Does anyone have any hints on how to move on from here?

Thanks
Christian

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: PS3 Controller Firmware

Post by ulao » Wed Feb 16, 2011 8:51 pm

bencao74 was able to resolve his issue in another thread.
Last edited by ulao on Thu Apr 28, 2011 9:54 pm, edited 1 time in total.

Post Reply