summaryrefslogtreecommitdiff
path: root/spi/nes_gamepad/nes_gamepad_generated/README
blob: 745149af812bf3b06deabbae9fbadad90b5dd209 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
-------------------------------------------------------------------------------
NES Gamepad signalling
-------------------------------------------------------------------------------

Synthetically generated NES gamepad signalling.

SPI settings are always:

Clock polarity = 1
Clock phase    = 0
Bit order      = msb-first
Word size      = 8

Chip-select is not used and must not be assigned to any channel.

        ___
   GND |o  \
   CUP |o o| VCC
 OUT 0 |o o| D3
    D1 |o o| D4
       -----
NES Gamepad Connector

VCC   - Power 5V
GND   - Ground
CUP   - Shift register clock (CLK)
OUT 0 - Shift register latch (optional)
D1    - Gamepad data (MISO)
D3    - Data (unused)
D4    - Data (unused)

Data pins D3 and D4 are not used by the standard game pad but by special
controllers like the Nintento Zapper light gun.


Logic analyzer setup
--------------------

The logic analyzer used was a DreamSourceLab DSLogic Plus (at 10 MHz):

  Probe       NES gamepad
  -----------------------
  0           OUT 0
  1           D1
  2           CUP


a.sr
----

Button press of button 'A'.

MISO bits: 01111111
MISO data: 7F
Button States: A


b.sr
----

Button press of button 'B'.

MISO bits: 10111111
MISO data: BF
Button States: B


select.sr
---------

Button press of button 'Select'.

MISO bits: 11011111
MISO data: DF
Button States: Select


start.sr
--------

Button press of button 'Start'.

MISO bits: 11101111
MISO data: EF
Button States: Start


north.sr
--------

Button press of button 'North'.

MISO bits: 11110111
MISO data: F7
Button States: North


south.sr
--------

Button press of button 'South'.

MISO bits: 11111011
MISO data: FB
Button States: South


west.sr
-------

Button press of button 'West'.

MISO bits: 11111101
MISO data: FD
Button States: West


east.sr
-------

Button press of button 'East'.

MISO bits: 11111110
MISO data: FE
Button States: East


a_b.sr
------

Button press of button 'A' and 'B'.

MISO bits: 00111111
MISO data: 3F
Button States: A + B


b_select_west.sr
----------------

Button press of button 'B' and 'Select' and 'West'.

MISO bits: 10011101
MISO data: 9D
Button States: B + Select + West


no_button.sr
------------

Controller connected but no button pressed.

MISO bits: 11111111
MISO data: FF
Button States: No button is pressed


unconnected.sr
--------------

Gamepad not connected.

MISO bits: 00000000
MISO data: 00
Button States: Gamepad is not connected.