GC Controller Protocol, DOL-003 and DOL-004 (DOL-005)

Includes PS2, Xbox 1, GameCube (but not the Phantom Game Console)

Moderator:Moderators

Post Reply
User avatar
RDC
Posts:349
Joined:Thu Jul 03, 2008 9:55 pm
Location:VA
Contact:
GC Controller Protocol, DOL-003 and DOL-004 (DOL-005)

Post by RDC » Fri Mar 15, 2013 3:51 am

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

Code: Select all

-----------
| 5  3  1 |
| 6  4  2 |
\         /
  \_____/
1- 5v (only for Rumble)
2- Ground
3- Data
4- Not Used
5- Ground
6- 3.43v (3.3v)


DOL-005, Wavebird Receiver

Code: Select all

-----------
| 5  3  1 |
| 6  4  2 |
\         /
  \_____/
1- Not Used
2- Not Used
3- Data
4- Not Used
5- Ground
6- 3.43v (3.3v)


The GC polls for the controller roughly every 16.6ms (NTSC) 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.

Image

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.

Image

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.
The next to last bit (1) is for the Rumble motor Brake. A t there turns the Brake on while a 0 is Brake off. The purpose of this is to stop the Rumble motor quicker so that pulses will 'feel' more sharp and when an Rumble even stops, it stops, versus fading out if the Rumble motor is just turned off and left to free spin until it stops on it's own.

xxxxxx00 = Motor off, no Rumble.
xxxxxx01 = Motor on, Rumble.
xxxxxx10 = Motor Brake on. If the Motor is turned off and the Brake turned on, this makes the Rumble stop quicker by shorting the + and - of the Motor in the controller. If the Motor is not running it does nothing.
xxxxxx11 = Motor on and Brake on. This should not be done as the Motor and Brake are both on in this case. The Motor should be turned off if the Brake is to be applied, ie; 10 should be used.

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.

Image

The Data is returned MSB first.

Code: Select all

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.

Image

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" onclick="window.open(this.href);return false;
Last edited by RDC on Thu Jan 08, 2015 2:15 am, edited 2 times in total.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.
Re-mappable Wireless 360 Controller - The CGnome

User avatar
palmertech
Senior Member
Posts:3225
Joined:Sat Feb 02, 2008 1:40 am
Location:California, land of the homeless and hippies
Contact:

Re: GC Controller Protocol, DOL-003 and DOL-004 (DOL-005)

Post by palmertech » Fri Jul 12, 2013 1:01 pm

Thanks for posting this, it has been really helpful for a project I am working on. :)
Image

Excellent

User avatar
RDC
Posts:349
Joined:Thu Jul 03, 2008 9:55 pm
Location:VA
Contact:

Re: GC Controller Protocol, DOL-003 and DOL-004 (DOL-005)

Post by RDC » Fri Jul 12, 2013 1:07 pm

Welcome. I haven't done a thing with it since then. It was mainly just something to kill some time and try too figure out. ;)
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.
Re-mappable Wireless 360 Controller - The CGnome

Post Reply