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

Similar documents
Introduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide

Data Sheet. Adaptive Design ltd. Arduino Dual L6470 Stepper Motor Shield V th November L6470 Stepper Motor Shield

Pmod peripheral modules are powered by the host via the interface s power and ground pins.

Implementing SPI Communication Between MSP430 G2452 and LTC ADC

Part 1. MAX BIT DAC with an Arduino Board. MIDI to Voltage Converter Part1

Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A

Web Site: Forums: forums.parallax.com Sales: Technical:

MicroMag3 3-Axis Magnetic Sensor Module

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

LOCAL INTERCONNECT NETWORK (LIN)

Hardware Connections between Arduino and IMU Nori Wilkins Apr. 5, 2013

Arduino DUE + DAC MCP4922 (SPI)

CHAPTER 11: Flip Flops

Embedded Systems Design Course Applying the mbed microcontroller

A magician showed a magic trick where he picked one card from a standard deck. Determine what the probability is that the card will be a queen card?

Lab 2.0 Thermal Camera Interface

Compressor Supreme Force Feedback User Manual

Lab 3 - DC Circuits and Ohm s Law

ARDUINO SEVERINO SERIAL SINGLE SIDED VERSION 3 S3v3 (REVISION 2) USER MANUAL

JPD-FFB- Vibration USB game pad USER MANUAL

A DIY Hardware Packet Sniffer

DC Circuits (Combination of resistances)

Using the HT46R46 I/O Ports to Implement Half-Duplex SPI Communication

Allows the user to protect against inadvertent write operations. Device select and address bytes are Acknowledged Data Bytes are not Acknowledged

WEB log. Device connection plans

UniPi technical documentation REV 1.1

Serial Communications

Note monitors controlled by analog signals CRT monitors are controlled by analog voltage. i. e. the level of analog signal delivered through the

WEB log. Device connection plans

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

Dolphin In-Circuit programming Updating Firmware in the field

SPI I2C LIN Ethernet. u Today: Wired embedded networks. u Next lecture: CAN bus u Then: wireless embedded network

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

Elettronica dei Sistemi Digitali Costantino Giaconia SERIAL I/O COMMON PROTOCOLS

AN141 SMBUS COMMUNICATION FOR SMALL FORM FACTOR DEVICE FAMILIES. 1. Introduction. 2. Overview of the SMBus Specification. 2.1.

Technical Note TN_158. What is the Camera Parallel Interface?

RS-485 Protocol Manual

8 by 8 dot matrix LED displays with Cascadable Serial driver B32CDM8 B48CDM8 B64CDM8 General Description

LIN (Local Interconnect Network):

M25P05-A. 512-Kbit, serial flash memory, 50 MHz SPI bus interface. Features

NB3H5150 I2C Programming Guide. I2C/SMBus Custom Configuration Application Note

AVR1309: Using the XMEGA SPI. 8-bit Microcontrollers. Application Note. Features. 1 Introduction SCK MOSI MISO SS

Welcome to the tutorial for the MPLAB Starter Kit for dspic DSCs

FR FAMILY MB91460 SPI - DAISY CHAIN COMMUNICATION 32-BIT MICROCONTROLLER APPLICATION NOTE. Fujitsu Microelectronics Europe Application Note

Softstarters. Type PSTX Fieldbus communication, Built-in Modbus RTU. 1SFC132089M0201 April SFC132089M0201 1

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

ZX-NUNCHUK (# )

Open vs. Closed Encoder Communication Protocols: How to Choose the Right Protocol For Your Application

Timer A (0 and 1) and PWM EE3376

2.2" TFT Display. Created by Ladyada. Last updated on :15:09 PM EDT

B Robo Claw 2 Channel 5A Motor Controller Data Sheet

SIMPLE EPROM PROGRAMMER. EPROM Programmer Design. Hardware

Arduino ADK Back. For information on using the board with the Android OS, see Google's ADK documentation.

ABB Drives. User s Manual HTL Encoder Interface FEN-31

The Programming Interface

Software Manual RS232 Laser Merge Module. Document # SU Rev A

OPERATING INSTRUCTIONS Model ST-888 DTMF ANI/ENI Display Decoder

Analog control unit for mobile robots

S88XPressNetLI v1.0. Installation, user and reference manual KDesign Electronics, PCB design by RoSoft

GTS-4E Hardware User Manual. Version: V1.1.0 Date:

AVR319: Using the USI module for SPI communication. 8-bit Microcontrollers. Application Note. Features. Introduction

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

1 x TS0861 Magnetic Swipe Card Reader. 1 x Installation Guide (this document).

Using the Siemens S65 Display

DMX-K-DRV. Integrated Step Motor Driver + (Basic Controller) Manual

Series and Parallel Resistive Circuits Physics Lab VIII

EXPERIMENT 2 TRAFFIC LIGHT CONTROL SYSTEM FOR AN INTERSECTION USING S7-300 PLC

Electronic Power Control

G.A.L. HANDS FREE EMERGENCY TELEPHONE MODEL GAL-6400

Theory and Practice of Tangible User Interfaces. Thursday Week 2: Digital Input and Output. week. Digital Input and Output. RGB LEDs fade with PWM

SyncLink GT2/GT4 Serial Adapter

SAMPLE CHAPTERS UNESCO EOLSS DIGITAL INSTRUMENTS. García J. and García D.F. University of Oviedo, Spain

SafeSPI - Serial Peripheral Interface for Automotive Safety

NHD-0420D3Z-FL-GBW-V3

I2C PRESSURE MONITORING THROUGH USB PROTOCOL.

Below is a diagram explaining the data packet and the timing related to the mouse clock while receiving a byte from the PS-2 mouse:

Internal Oscillator. I 2 C Interface. SPI Interface. Controller. Internal Registers Port Controller. Eight I/O Pins. Figure 1.

USER GUIDE EDBG. Description

Configuration app and Bluetooth interface

CAN BUS INTERFACE. Module Information

Using the AnyBus -X Gateway to Communicate between a DVT camera and a Profibus Master

LMU Hardware and Installation Guide

Servo Info and Centering

ADS9850 Signal Generator Module

[F/T] [5] [KHz] [AMP] [3] [V] 4 ) To set DC offset to -2.5V press the following keys [OFS] [+/-] [2] [.] [5] [V]

Notes Odom, Chapter 4 Flashcards Set:

APPLICATION NOTE. Atmel AT01095: Joystick Game Controller Reference Design. 8-/16-bit Atmel Microcontrollers. Features.

Serial Communications

Microcomputer Protocol Implementation at Local Interconnect Network Georgi Krastev

Definitions and Documents

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

Making a DB to RJ45 adapter.

VSCOM USB PRO Series Industrial I/O Adapters

EARTH PEOPLE TECHNOLOGY SERIAL GRAPH TOOL FOR THE ARDUINO UNO USER MANUAL

What is LOG Storm and what is it useful for?

7 OUT1 8 OUT2 9 OUT3 10 OUT4 11 OUT5 12 OUT6 13 OUT7 14 OUT8 15 OUT9 16 OUT10 17 OUT11 18 OUT12 19 OUT13 20 OUT14 21 OUT15 22 OUT16 OUT17 23 OUT18

DMX 101: A DMX 512 HANDBOOK

027,21$1'&21752/5,1* 237,&$/

MONITORING PERFORMANCE IN WINDOWS 7

Transcription:

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

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

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 http://www.eecs.umich.edu/courses/eecs270/270lab/270_docs/lab7.html https://upload.wikimedia. org/wikipedia/commons/8/83/nescontroller.jpg 3

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? http://static.giantbomb. com/uploads/original/0/7465/968375n64_controller.jpg 4

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 http://s.hswstatic.com/gif/ps2-controller.jpg Weighted motors cause controller to vibrate 5

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

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 http://i.ebayimg. com/images/g/8paaaoxygpts-px~/s-l500.jpg http://i.ebayimg. com/images/g/8paaaoxygpts-px~/s-l500.jpg 7

DualShock 2 - Analog Buttons 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 http://i.ebayimg.com/images/g/cmkaaoswdk5t-u9b/s-l1600.jpg Resistor https://d3nevzfk7ii3be.cloudfront.net/igi/6ikecibrpwrvqm6q.huge 8

Communicating with the PlayStation 2 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 http://operationrainfall.com/ http://ecx.images-amazon.com/ 9

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

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) Red (power) - 3.3 V Grey (motor power) - usually 7.4 V Black (ground) Yellow (attention) - slave select Blue (clock) - generated by master Green (acknowledge) - controller must respond within 100 µs 11

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

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

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

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 http://store.curiousinventor.com/guides/ps2 16

DualShock 2 - Transfer Protocol Start with 3-byte Header 1st Byte: Initiate the transaction *This is the same every time. Byte Number Master Controller Information Type 1 0x01 0xFF Initiate 2 0x42 0x79 Controller Mode 3 0x00 0x5A Handshake 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 17

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 Byte Number Master Controller Information Type 1 0x01 0xFF Initiate 2 0x42 0x79 Controller Mode 3 0x00 0x5A Handshake 4 0xLL Digital Buttons 5 0xRR Digital Buttons 4th byte: is state of buttons select, L3, R3, start, up, right, down, and left. 0xLL is vibration data for left motor 5th byte: is state of buttons L2, R2, L1, R1, triangle, circle, X, square 0xRR is vibration data for right motor 18

Byte 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) Master Controller Information Type 1 0x01 0xFF Header (initiate transaction) 2 0x42 0x79 Header (transaction mode) 3 0x00 0x5A Header (sort of handshake) 4 0xLL Digital (select, L3, R3, start, up, right, down, left) 5 0xRR Digital (L2, R2, L1, R1, triangle, circle, X, square) 6 0x00 Right Analog Stick X 7 0x00 Right Analog Stick Y 8 0x00 Left Analog Stick X 9 0x00 Left Analog Stick Y 10 0x00 Right Button Analog 11 0x00 Left Button Analog 12 0x00 Up Button Analog 13 0x00 Down Button Analog 14 0x00 Triangle Button Analog 15 0x00 Circle Button Analog 16 0x00 X Button Analog 17 0x00 Square Button Analog 18 0x00 L1 Button Analog 19 0x00 R1 Button Analog 20 0x00 L2 Button Analog 21 0x00 R2 Button Analog 19

Demonstration Interfacing a PS2 Controller with an Arduino 20

PlayStation 2 Controller - Summary Improvements from Previous Methods Adds versatility to control system Reduces lag because it is not being constantly polled Analog Sticks and Buttons 12 buttons each with 8 bits of precision 2 analog sticks with 16 bits of precision 5 digital buttons 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

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