Presentation is loading. Please wait.

Presentation is loading. Please wait.

Playstation 2 Controller David Domanico Justin Kaput 1.

Similar presentations


Presentation on theme: "Playstation 2 Controller David Domanico Justin Kaput 1."— Presentation transcript:

1 Playstation 2 Controller David Domanico Justin Kaput 1

2 Buttons (Dual Shock 2) 2 analog sticks 12 pressure sensitive buttons o Square, triangle, circle, x, directional pad, L1, L2, R1, R2 5 digital buttons o Start, select, “analog”, L3, R3 http://en.wikipedia.org/wiki/DualShock 2

3 How Buttons Work Pressure Sensitive o Button pad has a lower resistance than the conductor in the controller o The more the button is pressed, the more current passes through, which is measured Analog Sticks o Two perpendicular potentiometers to control current o Current is measured to provide X and Y values http://www.gamesx.com/controldata/p s2pad.htm http://electronics.howstuffworks.com/p laystation3.htm 2

4 Connections Data - controller to Playstation MISO Command - Playstation to controller MOSI Vibration - motors’ power line 9V Ground - (duh) Power - 3 - 5V Attention - slave select Clock - 100kHz to 500kHz White - Unused Acknowledge - slave acknowledge http://www.scribd.com/doc/86204752/Decoding-PS2-Wired-and-Wireless-Controller-for-Interfacing-With-PIC-Micro-Controller 3

5 Communication Protocol Similar to SPI o Shared CLK, MOSI, MISO o Attention Line is similar to Slave Select in SPI o Additional ACK wire instead of ACK bit Sequence of events for data transfer: o CLK is held high until data transfer o Attention must be pulled low for the data packet transfer and set high after o Once clock starts (8 cycles) 8 bits sent and received on the data and command lines LSB first o ACK pulled low for 12 microseconds after each byte http://store.curiousinventor.com/guides/PS2/ 4

6 Data (MISO) Attention (Slave Select) Acknowledge http://nearfuturelaboratory.com/2008/06/19/play station2-logic-analysis/ Clk Command (MOSI) 5

7 Communication Protocol First three bytes – Header Following bytes – Mode Dependent Digital – 2 bytes Analog – 18 bytes Config - # bytes varies 6

8 Communication Protocol First three bytes always a header o First byte  Command: 0x01 (indicates new packet)  Data: 0xFF o Second byte  Command:Main command (poll or configure controller)  Data:Device mode Upper 4 bits: mode(4 = digital, 7 = analog, F = config) Lower 4 bits: how many 16 bit words follow the header o Third Byte  Command:0x00  Data:0x5A 7

9 Data Attention (Slave Select) Acknowledge http://nearfuturelaboratory.com/2008/06/19/play station2-logic-analysis/ Clk Command FF 79 5A 8

10 Communication Protocol Following bytes dependent on command/mode o 2 to 18 more bytes, depending on mode  Digital - 2 more bytes Each button given a bit  Analog - 18 more bytes 2 bytes for digital buttons Retrieves all analog and digital button states and pressures  Config - Depends on Command First time entering returns either analog or digital state Different commands while in config mode have different sets of response bytes 9

11 Important Commands Polling Get button states Enter/Exit Config Mode Toggle Analog/Digital (config mode only) Map Motors (config mode only) 10

12 Main Polling Command 0x42 o Data Byte #2 o if digital mode = 0x41, only up to byte 5 is transmitted o if analog mode = 0x79 o W, Y – Can be used to control power sent to vibration motors if set in config mode Byte #123456-21 (only in analog mode) Command0x010x420x00WY Data0xFFMode Dependent 0x5ADigital bitsAnalog Bytes 11

13 Data Attention (Slave Select) Acknowledge http://nearfuturelaboratory.com/2008/06/19/play station2-logic-analysis/ Clk Command Byte #123456-21 (only in analog mode) Command0x010x420x00WY Data0xFFMode0x5ADigital bitsAnalog Bytes 12

14 Button Mapping On Polls Digital Mode o Data Byte 4 o Data Byte 5 o Buttons Active Low Analog Mode o Data bytes 4 and 5 are the same o Analog Sticks range 0xFF -0x00, 0x7F is at rest o Pressure buttons range 0x00 - 0xFF, 0xFF is fully pressed Bit 01234567 ButtonSelectL3R3StartUpRightDownLeft ButtonL2R2L1R1TriangleOXSquare Byte6789101112131415161718192021 ButtonRXRYLXLYRightLeftUpDownOXL1R1L2R2 13

15 Enter/Exit Config 0x43 Command Byte #4 0x00 - exit config mode 0x01 - enter config mode Byte #123456-21 (only in analog mode) Command0x010x430x00Enter/Exit0x00 Data0xFFMode dependent 0x5ADigital bitsAnalog Bytes 14

16 Switching Modes (digital/analog) 0x 44 Config Mode only Command Byte #4 o 0x00 = set digital mode o 0x01 = set analog mode Command Byte #5 o 0x03 = mode is locked o Otherwise analog button on the controller can toggle Byte #123456-9 Command0x010x440x00D/ALock?0x00 Data0xFF0xF30x5AConfig 15

17 Mapping Motor Command Bytes 0x4D Config Mode only 0x00 - Small motor mapping location 0x01 - Large motor mapping location 0xFF - not mapped Byte #123456-9 Command0x010x4D0x00 0x010xFF Data0xFF0xF30x5ACurrent Mapping 16

18 Questions? 17

19 Sources http://store.curiousinventor.com/guides/PS2/ http://www.gamesx.com/controldata/ps2pad.htm http://en.wikipedia.org/wiki/DualShock http://www.scribd.com/doc/86204752/Decoding-PS2-Wired-and-Wireless-Controller-for-Interfacing-With-PIC- Micro-Controller http://www.scribd.com/doc/86204752/Decoding-PS2-Wired-and-Wireless-Controller-for-Interfacing-With-PIC- Micro-Controller 18


Download ppt "Playstation 2 Controller David Domanico Justin Kaput 1."

Similar presentations


Ads by Google