]>
Commit | Line | Data |
---|---|---|
4c10034e UH |
1 | ------------------------------------------------------------------------------- |
2 | Nintendo Wii Nunchuk controller | |
3 | ------------------------------------------------------------------------------- | |
4 | ||
5 | This is a collection of example captures of I2C traffic from/to a Nintendo | |
6 | Wii Nunchuk game controller. | |
7 | ||
8 | A Dangerous Prototypes Buspirate (v4) was used as I2C master to talk to the | |
9 | Nunchuk controller. | |
10 | ||
11 | Details: | |
12 | https://en.wikipedia.org/wiki/Wiimote#Nunchuk | |
13 | http://wiibrew.org/wiki/Wiimote/Extension_Controllers/Nunchuck | |
14 | http://dangerousprototypes.com/docs/Bus_Pirate | |
15 | http://dangerousprototypes.com/2009/08/19/bus-pirate-wii-nunchuck-quick-guide/ | |
16 | ||
17 | ||
18 | Logic analyzer setup | |
19 | -------------------- | |
20 | ||
21 | The logic analyzer used was a Saleae Logic (at 1MHz): | |
22 | ||
23 | Probe I2C pin | |
24 | ------------------- | |
25 | 3 (red) SCL | |
26 | 7 (blue) SDA | |
27 | ||
28 | ||
29 | Buspirate setup | |
30 | --------------- | |
31 | ||
32 | Connections: | |
33 | ||
34 | Buspirate Nunchuk I2C breakout adapter | |
35 | ---------------------------------------- | |
36 | GND - (GND) | |
37 | +3.3 + (VCC) | |
38 | MOSI d (SDA) | |
39 | CLK c (SCL) | |
40 | ||
41 | The basic setup after connecting to the Buspirate on /dev/ttyACM0 | |
42 | (115200, 8n1) via minicom was: | |
43 | ||
44 | HiZ>m (mode) | |
45 | (1)>4 (I2C) | |
46 | (1)>2 (I2C mode: hardware) | |
47 | (1)>1 (speed: 100kHz) | |
48 | I2C>W (enable Buspirate power supplies) | |
49 | ||
50 | See below for further per-file I2C commands used. | |
51 | ||
52 | ||
53 | sigrok | |
54 | ------ | |
55 | ||
56 | The sigrok command line used was: | |
57 | ||
58 | sigrok-cli -d fx2lafw:samplerate=1mhz --time <ms> \ | |
59 | -p '3=SCL,7=SDA' -o <filename> | |
60 | ||
61 | The <ms> and <filename> parameters vary depending on the file. | |
62 | ||
63 | ||
64 | wii_nunchuk_init.sr | |
65 | ------------------- | |
66 | ||
67 | I2C>[0xa4 0x40 0x00] | |
68 | I2C START BIT | |
69 | WRITE: 0xA4 ACK | |
70 | WRITE: 0x40 ACK | |
71 | WRITE: 0x00 ACK | |
72 | I2C STOP BIT | |
73 | ||
74 | ||
75 | wii_nunchuk_set_reg.sr | |
76 | ---------------------- | |
77 | ||
78 | I2C>[0xa4 0x00] | |
79 | I2C START BIT | |
80 | WRITE: 0xA4 ACK | |
81 | WRITE: 0x00 ACK | |
82 | I2C STOP BIT | |
83 | ||
84 | ||
85 | wii_nunchuk_data_idle.sr | |
86 | ------------------------ | |
87 | ||
88 | No buttons were pressed, the analog stick was not moved. | |
89 | ||
90 | I2C>[0xa5 r:6] | |
91 | I2C START BIT | |
92 | WRITE: 0xA5 ACK | |
93 | READ: 0x74 ACK 0x7F ACK 0x7B ACK 0x20 ACK 0x7D ACK 0xC7 | |
94 | NACK | |
95 | ||
96 | ||
97 | wii_nunchuk_data_left.sr | |
98 | ------------------------ | |
99 | ||
100 | No buttons were pressed, the analog stick was moved to the left. | |
101 | ||
102 | I2C>[0xa5 r:6] | |
103 | I2C START BIT | |
104 | WRITE: 0xA5 ACK | |
105 | READ: 0x12 ACK 0x7C ACK 0x48 ACK 0x2C ACK 0x97 ACK 0x2F | |
106 | NACK | |
107 | I2C STOP BIT | |
108 | ||
109 | ||
110 | wii_nunchuk_data_right.sr | |
111 | ------------------------- | |
112 | ||
113 | No buttons were pressed, the analog stick was moved to the right. | |
114 | ||
115 | I2C>[0xa5 r:6] | |
116 | I2C START BIT | |
117 | WRITE: 0xA5 ACK | |
118 | READ: 0xD6 ACK 0x61 ACK 0x4E ACK 0x28 ACK 0x93 ACK 0x2B | |
119 | NACK | |
120 | I2C STOP BIT | |
121 | ||
122 | ||
123 | wii_nunchuk_data_top.sr | |
124 | ----------------------- | |
125 | ||
126 | No buttons were pressed, the analog stick was moved to the top. | |
127 | ||
128 | I2C>[0xa5 r:6] | |
129 | I2C START BIT | |
130 | WRITE: 0xA5 ACK | |
131 | READ: 0x74 ACK 0x7E ACK 0x8E ACK 0x70 ACK 0x48 ACK 0x97 | |
132 | NACK | |
133 | I2C STOP BIT | |
134 | ||
135 | ||
136 | wii_nunchuk_data_bottom.sr | |
137 | -------------------------- | |
138 | ||
139 | No buttons were pressed, the analog stick was moved to the bottom. | |
140 | ||
141 | I2C>[0xa5 r:6] | |
142 | I2C START BIT | |
143 | WRITE: 0xA5 ACK | |
144 | READ: 0x75 ACK 0x19 ACK 0x43 ACK 0x2F ACK 0x65 ACK 0xA3 | |
145 | NACK | |
146 | I2C STOP BIT | |
147 | ||
148 | ||
149 | wii_nunchuk_button_c.sr | |
150 | ----------------------- | |
151 | ||
152 | The C button was pressed. | |
153 | ||
154 | I2C>[0xa5 r:6] | |
155 | I2C START BIT | |
156 | WRITE: 0xA5 ACK | |
157 | READ: 0x75 ACK 0x7F ACK 0x70 ACK 0x56 ACK 0x9F ACK 0xED | |
158 | NACK | |
159 | I2C STOP BIT | |
160 | ||
161 | ||
162 | wii_nunchuk_button_z.sr | |
163 | ----------------------- | |
164 | ||
165 | The Z button was pressed. | |
166 | ||
167 | I2C>[0xa5 r:6] | |
168 | I2C START BIT | |
169 | WRITE: 0xA5 ACK | |
170 | READ: 0x75 ACK 0x7F ACK 0x80 ACK 0x78 ACK 0x64 ACK 0x6C | |
171 | NACK | |
172 | I2C STOP BIT | |
173 | ||
174 | ||
175 | wii_nunchuk_orientation_vertical_top.sr | |
176 | --------------------------------------- | |
177 | ||
178 | The Nunchuk was in vertical ("normal") position. | |
179 | ||
180 | I2C>[0xa5 r:6] | |
181 | I2C START BIT | |
182 | WRITE: 0xA5 ACK | |
183 | READ: 0x75 ACK 0x7F ACK 0x81 ACK 0x78 ACK 0x63 ACK 0x5F | |
184 | NACK | |
185 | I2C STOP BIT | |
186 | ||
187 | ||
188 | wii_nunchuk_orientation_vertical_bottom.sr | |
189 | ------------------------------------------ | |
190 | ||
191 | The Nunchuk was in vertical position, help upside-down. | |
192 | ||
193 | I2C>[0xa5 r:6] | |
194 | I2C START BIT | |
195 | WRITE: 0xA5 ACK | |
196 | READ: 0x75 ACK 0x7F ACK 0x71 ACK 0x83 ACK 0x5D ACK 0xD3 | |
197 | NACK | |
198 | I2C STOP BIT | |
199 | ||
200 | ||
201 | wii_nunchuk_orientation_horizontal_left.sr | |
202 | ------------------------------------------ | |
203 | ||
204 | The Nunchuk was in horizontal position, pointing to the left. | |
205 | ||
206 | I2C>[0xa5 r:6] | |
207 | I2C START BIT | |
208 | WRITE: 0xA5 ACK | |
209 | READ: 0x75 ACK 0x7F ACK 0x25 ACK 0x7E ACK 0x7B ACK 0xEB | |
210 | NACK | |
211 | I2C STOP BIT | |
212 | ||
213 | ||
214 | wii_nunchuk_orientation_horizontal_right.sr | |
215 | ------------------------------------------- | |
216 | ||
217 | The Nunchuk was in horizontal position, pointing to the right. | |
218 | ||
219 | I2C>[0xa5 r:6] | |
220 | I2C START BIT | |
221 | WRITE: 0xA5 ACK | |
222 | READ: 0x75 ACK 0x7F ACK 0x8F ACK 0x7E ACK 0x75 ACK 0x4B | |
223 | NACK | |
224 | I2C STOP BIT | |
225 | ||
226 | ||
227 | wii_nunchuk_init_reg_3xdata.sr | |
228 | ------------------------------ | |
229 | ||
230 | I2C>[0xa4 0x40 0x00] | |
231 | I2C START BIT | |
232 | WRITE: 0xA4 ACK | |
233 | WRITE: 0x40 ACK | |
234 | WRITE: 0x00 ACK | |
235 | I2C STOP BIT | |
236 | ||
237 | I2C>[0xa4 0x00] | |
238 | I2C START BIT | |
239 | WRITE: 0xA4 ACK | |
240 | WRITE: 0x00 ACK | |
241 | I2C STOP BIT | |
242 | ||
243 | I2C>[0xa5 r:6] | |
244 | I2C START BIT | |
245 | WRITE: 0xA5 ACK | |
246 | READ: 0x75 ACK 0x7F ACK 0x77 ACK 0x4F ACK 0x82 ACK 0x3B | |
247 | NACK | |
248 | I2C STOP BIT | |
249 | ||
250 | (for the above values, no button was pressed) | |
251 | ||
252 | I2C>[0xa4 0x00] | |
253 | I2C START BIT | |
254 | WRITE: 0xA4 ACK | |
255 | WRITE: 0x00 ACK | |
256 | I2C STOP BIT | |
257 | ||
258 | I2C>[0xa5 r:6] | |
259 | I2C START BIT | |
260 | WRITE: 0xA5 ACK | |
261 | READ: 0x75 ACK 0x7F ACK 0x75 ACK 0x44 ACK 0x82 ACK 0x34 | |
262 | NACK | |
263 | I2C STOP BIT | |
264 | ||
265 | (for the above values, the Z button was pressed) | |
266 | ||
267 | I2C>[0xa4 0x00] | |
268 | I2C START BIT | |
269 | WRITE: 0xA4 ACK | |
270 | WRITE: 0x00 ACK | |
271 | I2C STOP BIT | |
272 | I2C>[0xa5 r:6] | |
273 | I2C START BIT | |
274 | WRITE: 0xA5 ACK | |
275 | READ: 0x75 ACK 0x7F ACK 0x77 ACK 0x43 ACK 0x83 ACK 0x5D | |
276 | NACK | |
277 | I2C STOP BIT | |
278 | ||
279 | (for the above values, the C button was pressed) | |
280 |