Ok I read many posts in the past year on here about the mystery of the saturn analog pad ( 3d controller ). I never really got around to it until last night after doing a bit of research. I'm glad to present.. the protocol.
I was successfully able to design a usb converter to auto detect the digital and analog if any one is interested. the HEX is for an atmega style chip if anyone is interested in that. Also note, the protocol chart I found has confidential as a water mark on it. So my guess is its SEGA property. I will not post that link unless I'm told I can, but I can jot it down for you here. Also worth pointing our, there are two places on the net with info on this beast. One is written by a Spanish fellow attempting to type in English on a forum. If I never read that I may have saved a few brain cells. He went by SaturnAV and from what I can tell is a very bright guy. his English, as he admits, is just hard to follow. He was the one that linked the Protocol chart. The other resource was much easier to read but had some inaccuracies. I did learn from there that a delay of 7 was needed. I used the two to figure out this protocol on my own. I dont think I could have done it with out, and certainly not in one night
Ok so how does it work... Well there is a lot to it that simply does not need to be said. So I will only mention what is needed. Most of you know the pin out
1 VCC +5v (Out)
2 D1 Data 1
3 D0 Data 0
4 S0 Select 0
5 S1 Select 1
6 5v +5v (Inp)
7 D3 Data 3
8 D2 Data 2
9 GND Ground
Do not use pin 6, it is used by the console for acknowledgment ( on the analog controller ) but you do not need it! And if used wrong you could damage the controller(pulling low on it in digital mode ).
First thing is to make sure to set all data d0-d3 to input, and s1 and s0 as out. Same as you would do with a digital pad. S1 is our clock of sorts. We bring it Hi and then low , contrary to popular belief we need 7 us waits. s[zero] ( damn text.. ) is our latch of sorts, it starts the data moving by bringing it low, raised when finished. s2 could be thought of as a ack, its completely not needed as I mentioned.
set switch in this order :switch 0 0 ( used for ID data ) then delay 7us
switch 0 1 ( used for ID data ) then delay 7us
now loop 14 times alternating switch 1 ( the clock
starting with switch 0 0 , next cycle will be switch 0 1 ( this is the switching each time you get here to the opposite you did before 00, 10, 00, 10, ...)
[read your data, the 4 bits]
delay 7us ( yes delay again! )
}then finish with switch 1 1 and delay 7us
In the loop you will get the following.switch pass data
00 1 NA second part of ID data
01 2 NA //
00 3 right, left, down up ( Directional keys )
01 4 Start, A, C, B
00 5 Right shoulder, X, Y, Z
01 6 Left shoulder, 1, 1, 1 ( these 1,1,1 are some sort of analog data, I think used for the mission stick. )
00 7 X axis first 4 bits
01 8 X axis second 4 bits
00 9 Y axis first 4 bits
01 10 Y axis second 4 bits
00 11 R_shoulder first 4 bits
01 12 R_ shoulder second 4 bits
00 13 L_shoulder first 4 bits
01 14 L_shoulder second 4 bits
The analog values are in revere. for example... pass 7 is four bits hex (i.e 1110 ) but meant as 0111 you then add the next pass to it. So say you received 0x80 ( neutral) or 10000000 in binary . pass 7 would be 0001 then you revere it. next you get 0000 on pass 8 and revere that. Then put them together 10000000. The data can be FF max to 00 min and as I said 80 neutral. The triggers are the same from 0 to FF and 0 is neutral.
note: I use inline function to speed things up. but depending on your coding you may need to adjust the delays. They are consistent so make it a var so you can change it if needed )
So that is one pass, do it again to get more data; ) There we have it the protocol from the 3d controller. I hope someone will find this useful. If I learn more I will add it.
As for the mission stick as some of you are wondering, I have no idea what it does( Sorry kendrick ), but If I had one I could figure it out in no time. I think I saw a twin stick for the saturn and if so I think it just sends the second stick as the triggers, only its the same as the x,y and neutral is 0x80, but I dont have one. Some code would need to be changed but not much. Same goes for the fighting stick and gun( no idea ) I just dont have them to test with. And some are way out of my budget. If anyone wants to lone me one I'd be happy to look at it.
Thx to those on the net that provided info to make this possible, I wish I knew more about them, but the net tends to cast anonymity to us all.
UPDATE, this code work for a mission stick, but be sure to have a 15 ms delay between calls.