Download presentation
Presentation is loading. Please wait.
Published byStephanie Ashlynn Mosley Modified over 9 years ago
1
64 CONTROLLER 64 CONTROLLER AARON RIDENOUR, RYAN WOOSTER, ALEX JAECKEL
2
CONTROLLER Inputs: A, B, L, R, Z, start, C-up C-down, C-left, C-right, D-Pad(up, down, left, right), Joystick Options: Rumble Pak, Memory Pak http://conker.wikia.com/wiki/Nintendo_64_Controller http://electronics.howstuffworks.com/n643.htm
3
ACTION BUTTONS Each buttons sits atop a metal plate. When the button is pressed, the metal plate contacts two strips of conductive material attached to the circuit board, creating a current. The controller senses this current, and sends a logical 1 if the button is pressed, and a logical 0 if the button is not pressed. http://electronics.howstuffworks.com/n643.htm
4
JOYSTICK Two wheels positioned at right angles to each other, one for the x-axis, one for the y-axis. http://electronics.howstuffworks.com/n643.htm
5
JOYSTICK Incremental Encoding Each wheel has slits around the perimeter Controller counts how many times the light sensors see the LED through the slits, and uses that to determine position. One wheel for each axis. http://www.eecs.umich.edu/courses/eecs461/lecture/Lecture3.pdf
6
JOYSTICK The controller knows which way the joystick is moving by looking at which sensor sees the LED first. http://en.wikipedia.org/wiki/File:Quadrature_Diagram.svg
7
CONNECTION TO N64 http:// afermiano.com/index.php/n64-controller-protocol Vcc = 3.3V Data line is bidirectional A pull up-resistor is needed to read the line
8
OPEN COLLECTOR Pull-up resistor keeps the line high while idle. To send 0, the output line is pulled low and connected to ground. To send 1, nothing should be sent. Do not drive the line high. http://www-inst.eecs.berkeley.edu/~cs150/fa04/Lab/Checkpoint1.PDF
9
OPEN COLLECTOR Sending a logical 0: http://www-inst.eecs.berkeley.edu/~cs150/fa04/Lab/Checkpoint1.PDF 0 0 1 1
10
OPEN COLLECTOR Sending a logical 1: http://www-inst.eecs.berkeley.edu/~cs150/fa04/Lab/Checkpoint1.PDF 11 0 1
11
CONTROLLER ENCODING Logical 0: Logical 1: http://www.pieter-jan.com/node/10
12
CONTROLLER ENCODING http://inst.eecs.berkeley.edu/~cs150/sp01/Labs/lablecckpt1.ppt
13
COMMUNICATION PROTOCOL When a Command byte is sent to the controller, it sends a response depending on which command was sent. Check Controller Command: 0x00 The controller responds with 3 bytes. The first two bytes are always 0x0500 Last byte is determined by: 0x01: If a controller pack is connected. 0x02: If no controller pack is connected. 0x04: If a previous command resulted in an error.
14
Reset Controller Command: 0xFF First resets the controller, including resetting the joystick calibration Controller then responds as in the Check Controller Command COMMUNICATION PROTOCOL
15
Input Polling Command: 0x01 The controller responds with 4 bytes, encoding the button and joystick values The controller responds with 4 bytes, encoding the button and joystick values ByteData[7]Data[6]Data[5]Data[4]Data[3]Data[2]Data[1]Data[0] 1ABZStartD-UpD-DownD-LeftD-Right 2Joystick Reset 0LRC-UpC-DownC-LeftC-Right 3Signed joystick x-axis coordinate 4Signed joystick y-axis coordinate The joystick values range between -128 and 127, but the controller physically can only use from -81 to 81.
16
EXAMPLE DATA WAVEFORM |----Command (console) 0x01-----||----Data1 (controller) 0x00----||-----Data2 (controller) 0x00----| |--------Data3 (controller) 0x00----------| |---------Data4 (controller) 0x01---------| ABZ St reset 0 L R Joystick x-coordinateJoystick y-coordinate start bit stop bit Images taken from: http://afermiano.com/index.php/n64-controller-protocol
17
COMMUNICATION PROTOCOL Controller Pack Read: 0x02 Used to read from the controller pack. Used to read from the controller pack. The command is followed by 2 bytes which indicate the address being read from and a CRC to verify the address. The command is followed by 2 bytes which indicate the address being read from and a CRC to verify the address. The controller responds with 32 bytes of data from that address, followed by the data CRC. The controller responds with 32 bytes of data from that address, followed by the data CRC.
18
Controller Pack Write: 0x03 Used to write to the controller pack. Used to write to the controller pack. The command is followed by 2 bytes which indicate the address being written to, a CRC to verify the address and the 32 bytes of data to write. The command is followed by 2 bytes which indicate the address being written to, a CRC to verify the address and the 32 bytes of data to write. The controller responds with the data CRC. The controller responds with the data CRC. COMMUNICATION PROTOCOL
19
CRC: Used to verify that data was sent correctly. Used to verify that data was sent correctly. Outside scope of this presentation. Outside scope of this presentation. https://code.google.com/p/micro-64-controller/wiki/CRC
20
RUMBLE PAK Use the 0x03 command. Use the 0x03 command. To initialize: To initialize: Send to address 0x8001. Send to address 0x8001. Send 0x80 (repeated 34 times) as the data. Send 0x80 (repeated 34 times) as the data. To run the Rumble Pak: To run the Rumble Pak: Send to address 0xc01b. Send 0x01 (repeated 32 times) as the data to start the Pak. Send 0x00 (repeated 32 times) as the data to stop the Pak. http://upload.wikimedia.org/wikipedia/commons/3/34/N64-Rumble-Pak.jpg
21
REFERENCES http://www.pieter-jan.com/node/10 http://afermiano.com/index.php/n64-controller-protocol https://code.google.com/p/micro-64-controller/wiki/Protocol http://www-inst.eecs.berkeley.edu/~cs150/fa04/Lab/Checkpoint1.PDF http://www.mixdown.ca/n64dev/ http://svn.navi.cx/misc/trunk/wasabi/devices/cube64/firmware/n64gc_com m.inc http://svn.navi.cx/misc/trunk/wasabi/devices/cube64/firmware/n64gc_com m.inc
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.