Presentation is loading. Please wait.

Presentation is loading. Please wait.

PlayStation 2 DualShock 2 Controller Ryan O’Keefe, Kabir Singh and Adrian Padin 1.

Similar presentations


Presentation on theme: "PlayStation 2 DualShock 2 Controller Ryan O’Keefe, Kabir Singh and Adrian Padin 1."— Presentation transcript:

1 PlayStation 2 DualShock 2 Controller Ryan O’Keefe, Kabir Singh and Adrian Padin 1

2 PlayStation 2 Controller - Overview I. Previous Methods NES Controller, N64 II. DualShock 2: Input Types Twelve analog buttons Five digital buttons Analog directional sticks III. DualShock 2: Communication Interface SPI Communication Transfer up to 21 bytes of data 2 https://upload.wikimedia.org/wikipedia/commons/f/f9/P SX-Original-Controller.jpg

3 Previous Methods - NES Controller Remember Lab 7 from EECS 270? Four Digital Buttons and the Directional Joypad Only 1 bit precision for each button Communicates with console using shift registers Console initiates by sending a pulse on the latch wire Controller sends 8 pulses and the status of each button 3 https://upload.wikimedia.org/wikipedia/c ommons/8/83/NES-controller.jpg http://www.eecs.umich.edu/courses/eecs270/270lab/270_docs/lab7.html

4 Previous Methods - N64 Controller Fourteen Digital Buttons and the “Analog” Joystick N64 was first controller to have a motor for vibration feedback Had “Analog” joystick which was essentially a digital counter What makes PS2 different? 4 http://static.giantbomb.com/uploads/origi nal/0/7465/968375-n64_controller.jpg

5 PlayStation 2 - DualShock 2 Features Increase number of buttons and other options: Twelve analog buttons 8 bits of precision for each button Five digital buttons Full analog directional sticks 2 Bytes of precision, 8 bits for X position and 8 bits for each Y position Variable Force-feedback Weighted motors cause controller to vibrate 5 http://s.hswstatic.com/gif/ps2-controller.jpg

6 DualShock 2 - Force Feedback DualShock - Two vibration motors One of the first controllers with this feature Left motor provides stronger feedback than right Variable feedback for better game immersion 6 http://images.dailytech.com/nimage/4096 _ps2b240.jpg

7 DualShock 2 - Analog Sticks Two perpendicular potentiometers per stick Two byte precision One byte each for X and Y axis Completely analog signal Variable resistance changes voltage levels 7 http://i.ebayimg.com/images/g/8pAAAOxygPtS -PX~/s-l500.jpg

8 All buttons except ‘Start’, ‘Select’, ‘L3’, ‘R3’, and ‘Analog’ are analog Each button has 8 bit encoding Harder press => higher value (0-255) Achieved through variable parallel resistance 8 DualShock 2 - Analog Buttons http://i.ebayimg.com/images/g/CmkAAOSwDk5T-U9b/s-l1600.jpg https://d3nevzfk7ii3be.cloudfront.net/igi/6IKeCIbrpwrVqm6q.huge Resistor

9 Basic premise is SPI (Serial Peripheral Interface):  One master (PS2 console) and many slaves (controllers)  All devices use the same bus (open collector scheme)  Master and slave communicate at the same time using shift registers  As the master sends data, it receives incoming data from the slave Communicating with the PlayStation 2 9 http://operationrainfall.com/http://ecx.images-amazon.com/

10 Controller Interface - SPI Overview Four wires to remember: 1. MOSI (Master Out Slave In) - data from the console to the controller 2. MISO (Master In Slave Out) - data from the controller to the console 3. Clock - both units must be timed to the same clock 4. Select - pick which device to read from 10 Master (PS2 Console) Slave (Controller) Clock Select (Attention) MOSI MISO Shift Register

11 DualShock 2 - Communication Hardware http://store.curiousinventor.com/guides/PS2  Brown (controller->console) - Data sent to console (buttons, analog sticks)  Orange (console->controller) - Data sent to controller (vibration)  Yellow (attention) - slave select  Blue (clock) - generated by master  Green (acknowledge) - controller must respond within 100 µs  Red (power) - 3.3 V  Grey (motor power) - usually 7.4 V  Black (ground) 11

12 DualShock 2 - Sample Transaction 12 http://store.curiousinventor.com/guides/PS2

13 DualShock 2 - Sample Transaction 1. Console pulls clock down to initiate transaction 13 http://store.curiousinventor.com/guides/PS2

14 DualShock 2 - Sample Transaction 1. Console pulls clock down to initiate transaction 2. Controller changes data line to reflect status 14

15 http://store.curiousinventor.com/guides/PS2 DualShock 2 - Sample Transaction 1. Console pulls clock down to initiate transaction 2. Controller changes data line to reflect status 3. On each rising edge the data is shifted from controller into console 15

16 http://store.curiousinventor.com/guides/PS2 DualShock 2 - Sample Transaction 1. Console pulls clock down to initiate transaction 2. Controller changes data line to reflect status 3. On each rising edge the data is shifted from controller into console 4. After eight rising edges, clock remains high to signal end of transaction. A single byte has now been transferred 16

17 DualShock 2 - Transfer Protocol Start with 3-byte Header 1st Byte: Initiate the transaction *This is the same every time. 17 Byte NumberMasterControllerInformation Type 10x010xFFInitiate 20x420x79Controller Mode 30x000x5AHandshake 2nd Byte: The console specifies which mode it wants: 0x41 = digital mode (no analog stick or analog button data) 0x42 = analog mode (full 21 bytes of data) 3rd Byte: Handshake to indicate that the controller is ready to transmit data

18 4th byte: 0xNN is state of buttons select, L3, R3, start, up, right, down, and left. 0xLL is vibration data for left motor 5th byte: 0xNN is state of buttons L2, R2, L1, R1, triangle, circle, X, square 0xRR is vibration data for right motor DualShock 2 - Transfer Protocol Bytes 4 and 5 are the digital states of every button (similar to NES controller): 0 - the button is pressed 1 - the button is not pressed 18 Byte NumberMasterControllerInformation Type 10x010xFFInitiate 20x420x79Controller Mode 30x000x5AHandshake 40xLL0xNNDigital Buttons 50xRR0xNNDigital Buttons

19 DualShock 2 If Analog Mode is specified (0x42), the controller sends another 16 bytes of data  X and Y position of the left and right analog sticks  Analog position of every button except start and select  Each button has 8 bits of precision (256 possible states) 19 ByteMasterControllerInformation Type 10x010xFFHeader (initiate transaction) 20x420x79Header (transaction mode) 30x000x5AHeader (sort of handshake) 40xLL0xNNDigital (select, L3, R3, start, up, right, down, left) 50xRR0xNNDigital (L2, R2, L1, R1, triangle, circle, X, square) 60x000xNNRight Analog Stick X 70x000xNNRight Analog Stick Y 80x000xNNLeft Analog Stick X 90x000xNNLeft Analog Stick Y 100x000xNNRight Button Analog 110x000xNNLeft Button Analog 120x000xNNUp Button Analog 130x000xNNDown Button Analog 140x000xNNTriangle Button Analog 150x000xNNCircle Button Analog 160x000xNNX Button Analog 170x000xNNSquare Button Analog 180x000xNNL1 Button Analog 190x000xNNR1 Button Analog 200x000xNNL2 Button Analog 210x000xNNR2 Button Analog

20 20 Demonstration Interfacing a PS2 Controller with an Arduino

21 PlayStation 2 Controller - Summary I. Improvements from Previous Methods Adds versatility to control system Reduces lag because it is not being constantly polled II. Analog Sticks and Buttons 12 buttons each with 8 bits of precision 2 analog sticks with 16 bits of precision 5 digital buttons III. Communication and Transfer Protocol Modified form of SPI Sends 8 bits at once on open-collector bus Digital mode is 5 bytes, Analog mode is 21 bytes 21

22 Bibliography NES Controller Background: http://www.eecs.umich.edu/courses/eecs270/270lab/270_docs/lab7.html N64 Controller Background: https://www.eecs.umich.edu/courses/eecs373/Lec/W16_talks/The%20N64%20Controller.pdf Transfer Protocol: http://www.gamesx.com/wiki/doku.php?do=&id=controls%3Aplaystation2_controller Interfacing to a PS2 Controller (this site was the most helpful): http://store.curiousinventor.com/guides/PS2 Using a PS2 controller with an Arduino: http://www.billporter.info/2010/06/05/playstation-2-controller-arduino-library-v1-0/ 22


Download ppt "PlayStation 2 DualShock 2 Controller Ryan O’Keefe, Kabir Singh and Adrian Padin 1."

Similar presentations


Ads by Google