Hardware Projects‎ > ‎N64‎ > ‎

N64 Controller

Joystick encoder


Pinout:

Pin 1 on the left(marked with a white wire)
P1: Y1
P2: Y0
P3: X1
P4: Gnd
P5: Vcc
P6: X0


Waveforms


Legend

D0: X0
D1: X1
D2: Y0
D3: Y1

X-



X+




Y+



Y-



I don't have any way of measuring whether or not the quadrature encoder is linear relative to the joystick's physical position, but by removing the joystick and manually sending quadrature pulses to the controller, then polling via command 0x01, I was able to confirm that the relationship between quadrature pulses and reported joystick position IS linear.  A single pulse increments/decrements the position by a value of 4.  The position is reported as a signed (two's complement) 8-bit integer.  The OEM controller is capable of reporting values ranging from 0x80-0x7F, but the actual joystick does not cover the entire range.  In my testing, the joystick appears to report approximately +/- 18 steps (shown above in the logic analyzer screenshots), for a range of 0xD0-0x48, but that may vary from one joystick to the next, depending on wear.

On power-on, the X-axis initializes to 0xFE, while the Y-axis initializes to 0x00.  After resetting via command 0xFF, both axes report 0x00.  The reported value does not wrap around, i.e.  0x00, 0x04, 0x08, . . . 0x7C, 0x7F, 0x7F, 0x7F and 0x00, 0xFC, 0xF8, . . . 0x84, 0x80, 0x80, 0x80.