This is more or less a proof of concept in reading the Data from the controller's than a full blown breakdown of the controller's protocol.
The GameCube controllers, much like their N64 predecessor, use a 1 wire type of communication.
Looking at the plug on the controller, with the flat side on top.
DOL-003
1- 5v (only for Rumble)
2- Ground
3- Data
4- Not Used
5- Ground
6- 3.3v (3.43v)
DOL-005, Wavebird Receiver
1- Not Used
2- Not Used
3- Data
4- Not Used
5- Ground
6- 3.3v (3.43v)
The GC polls for the controller roughly every 16.6ms with an 8 bit Command, plus a Stop bit, so 00000000-1. A 0 is Lo for roughly 4us, then Hi for 1us. A 1 is Lo for roughly 1us and Hi for 4us. This timing is different when the controller is returning Data, and is also different between the DOL-003 and DOL-004 controllers as well.
So the 8 bit Polling Command and Stop bit, 00000000-1, that is looking for a controller, on the Logic Analyzer, looks like this. 8 Lo bits followed by the 1 Hi Stop bit.
When a controller is first connected, there is some 'back and forth' between the controller and GC before it starts requesting the Data from the controller over and over. For just reading the button/stick values from the controller all of the 'back and forth' can be skipped and the 24 bit Command can just be be sent to request the Data.
On the DOL-003, after it's all connected up, the GC requests Data twice every 15ms with a 600us pause between each request, so it goes request/Data, 600us pause, request/Data, 15ms pause, repeat it all again. This is only the observation while on the menu screen (no game in the console) so it may be different during actual game play.
The DOL-005 (Receiver) is the same, but has a 16ms pause instead of a 15ms one.
Once everything is connected up, the Command changes from the 8 bit Polling Command to a 24 bit Command to request Data, turn the Rumble on/off and probably a slew of other things as that's more than enough bits to do more than a few things.
The 24 Bit Command to request the controller Data is 01000000-00000011-0000000(0)-1
The last bit (0) before the Stop bit, turns the Rumble on/off. A 1 there turns the Rumble on, while a 0 turns it off.
This makes for a 90 bit long string of Data, the 24 bit Command plus Stop bit sent to the controller, then 64 bits of Data plus a Stop bit is returned from the controller.
The Data is returned MSB first.
* The first 3 bits of Byte0, so far anyway, I've always seen as 001 on both the DOL-003 controller and 005 Receiver.
** For bit 7 of Byte1, this is always a 1 on the DOL-003, but is a 0 on the DOL-005, everything else remains the same except for the timing.
The DOL-003 returns Data with a 4us timing. A 0 is 3us Lo and 1us Hi, then a 1 is 1us Lo and 3us Hi.
The DOL-005 returns Data with a closer to 4.45us timing (4.4167 / 4.4583) with a 0 being 3.3750 / 3.3333 Lo and 1.0833us Hi, then a 1 being 1.1us Lo and 3.33us Hi.
Test rig for reading the controller's Data is a PIC16F1516. The connector on the right is going to the PIC, while the one on the left is just a pass thru that goes to the GC for seeing what was going on there. The GC is not turned on for any of this, it's all powered from the PicKit 3 and done with the PIC.
I've only shown the first 2 Bytes of Data being read here from both the DOL-003 and DOL-004 controllers, which are all of the Digital buttons, ST, Y, X, B, A, L, R, Z and the D-pad.
http://s50.beta.photobucket.com/user/RD ... 6.mp4.html
The GameCube controllers, much like their N64 predecessor, use a 1 wire type of communication.
Looking at the plug on the controller, with the flat side on top.
DOL-003
Code:
-----------
| 5 3 1 |
| 6 4 2 |
\ /
\_______/
1- 5v (only for Rumble)
2- Ground
3- Data
4- Not Used
5- Ground
6- 3.3v (3.43v)
DOL-005, Wavebird Receiver
Code:
-----------
| 5 3 1 |
| 6 4 2 |
\ /
\_______/
1- Not Used
2- Not Used
3- Data
4- Not Used
5- Ground
6- 3.3v (3.43v)
The GC polls for the controller roughly every 16.6ms with an 8 bit Command, plus a Stop bit, so 00000000-1. A 0 is Lo for roughly 4us, then Hi for 1us. A 1 is Lo for roughly 1us and Hi for 4us. This timing is different when the controller is returning Data, and is also different between the DOL-003 and DOL-004 controllers as well.
So the 8 bit Polling Command and Stop bit, 00000000-1, that is looking for a controller, on the Logic Analyzer, looks like this. 8 Lo bits followed by the 1 Hi Stop bit.

When a controller is first connected, there is some 'back and forth' between the controller and GC before it starts requesting the Data from the controller over and over. For just reading the button/stick values from the controller all of the 'back and forth' can be skipped and the 24 bit Command can just be be sent to request the Data.
On the DOL-003, after it's all connected up, the GC requests Data twice every 15ms with a 600us pause between each request, so it goes request/Data, 600us pause, request/Data, 15ms pause, repeat it all again. This is only the observation while on the menu screen (no game in the console) so it may be different during actual game play.

The DOL-005 (Receiver) is the same, but has a 16ms pause instead of a 15ms one.
Once everything is connected up, the Command changes from the 8 bit Polling Command to a 24 bit Command to request Data, turn the Rumble on/off and probably a slew of other things as that's more than enough bits to do more than a few things.
The 24 Bit Command to request the controller Data is 01000000-00000011-0000000(0)-1
The last bit (0) before the Stop bit, turns the Rumble on/off. A 1 there turns the Rumble on, while a 0 turns it off.
This makes for a 90 bit long string of Data, the 24 bit Command plus Stop bit sent to the controller, then 64 bits of Data plus a Stop bit is returned from the controller.

The Data is returned MSB first.
Code:
Bit 7 6 5 4 3 2 1 0
BYTE0* 0 0 1 ST Y X B A
BYTE1** 1 L R Z DU DD DR DL
BYTE2 LSX Value
BYTE3 LSY Value
BYTE4 CSX Value
BYTE5 CSY Value
BYTE6 LTR Value
BYTE7 RTR Value
* The first 3 bits of Byte0, so far anyway, I've always seen as 001 on both the DOL-003 controller and 005 Receiver.
** For bit 7 of Byte1, this is always a 1 on the DOL-003, but is a 0 on the DOL-005, everything else remains the same except for the timing.
The DOL-003 returns Data with a 4us timing. A 0 is 3us Lo and 1us Hi, then a 1 is 1us Lo and 3us Hi.
The DOL-005 returns Data with a closer to 4.45us timing (4.4167 / 4.4583) with a 0 being 3.3750 / 3.3333 Lo and 1.0833us Hi, then a 1 being 1.1us Lo and 3.33us Hi.
Test rig for reading the controller's Data is a PIC16F1516. The connector on the right is going to the PIC, while the one on the left is just a pass thru that goes to the GC for seeing what was going on there. The GC is not turned on for any of this, it's all powered from the PicKit 3 and done with the PIC.

I've only shown the first 2 Bytes of Data being read here from both the DOL-003 and DOL-004 controllers, which are all of the Digital buttons, ST, Y, X, B, A, L, R, Z and the D-pad.
http://s50.beta.photobucket.com/user/RD ... 6.mp4.html