JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

Decoding Super Nintendo Wireless Controller IR Signal

 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - General Forum
View previous topic :: View next topic  
Author Message
ti83programmer



Joined: 13 Oct 2003
Posts: 60

                    
PostPosted: Mon Oct 27, 2003 10:05 pm    Post subject: Decoding Super Nintendo Wireless Controller IR Signal Reply with quote

I have wireless Super Nintendo controllers that use IR to communicate with their base (which connects to the Super Nintendo). I have an unextended 8811 that I used to learn some of the buttons on the controller while the switch on it was set to 1P (one player), and tested those buttons...it actually successfully learned the signals and I was using my remote to play Super Mario World. The problem is creating an upgrade for the Super Nintendo. I looked at the decode information in the Learned Signals tab of IR and it told me the protocol was Nokia, and the device and sub-device were 0, and the OBC was 0 (EFC 018) - for EVERY button, and that was that. With some buttons, like B, it said part of the signal was sent after the button was released in red. With other buttons, like Start, the signal seemed normal. I tried making an upgrade with the information it told me and it didn't work. I uploaded a configuration with these signals learned to the diagnosis folder at the Yahoo JP1 group a long time ago, but got no reply. It's called SNESprotocol.txt. I'd really appreciate it if someone could shed some light on this problem...or if no one has the time, to at least point me in the right direction of trying to figure it out myself.
Back to top
View user's profile Send private message
johnsfine
Site Admin


Joined: 10 Aug 2003
Posts: 4766
Location: Bedford, MA

                    
PostPosted: Tue Oct 28, 2003 8:22 am    Post subject: Reply with quote

I thought I replied when I first downloaded your file, but I don't remember what I said, and can't find that reply now.

It looks like it is similar to many of the keyboard protocols we've seen. I think it has a "press" command that is sent repeatedly as long as the key is pressed and a "release" command sent once at the end.

Release commands are possible, but tricky, for a JP1 custom protocol, so the first questions in this sort of situation are whether the thing that looks like a release command really is one and whether the device really needs the release command for correct behavior (The device may decently deduce that the key was realeased just from the fact that it stopped seeing the press command).

Learn a key "correctly", holding the source key until the 8811 does the double blink at the end of learning. That learned result couldn't include the release part. Learn the same original key to a different 8811 key with a short (1/4 to 1/2 second is best) press of the original key. That ought to capture the release. Compare the two learned signals in IR and (assuming the difference there is as expected) compare the behavior of the two learned signals when used with the actual device.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 21210
Location: Chicago, IL

                    
PostPosted: Tue Oct 28, 2003 1:17 pm    Post subject: Reply with quote

Here's a link to the original message: Super Nintendo Protocol and here's John's original reply.
_________________
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
Back to top
View user's profile Send private message Visit poster's website
jon_armstrong
Expert


Joined: 03 Aug 2003
Posts: 1238
Location: R.I.P. 3/25/2005

                    
PostPosted: Tue Oct 28, 2003 4:45 pm    Post subject: Reply with quote

This is a quick analysis of the protocol. It seems to have 17 bits. The problem I see using PB is that the burst pairs are backwards, but I have only spent a little while trying to get the rough protocol and not thinking of how to reproduce it. I also used D and F but it looks like all 16 bits vary so maybe it should just be F:16.

The 11 bit segment has the same command in all cases D=0x40 and the last three bits are 0's


{56.3k,msb}<-350,70|-194,230>(852,-416,0:1,D:8,F:8,-33812)+

"Once Key Released"
{56.3k,msb}<-350,70|-194,230>(852,-416,0,D:8,F:3,-33812)

D F

48 00 up
44 00 dn
42 00 left
41 00 right
50 00 sel
60 00 enter
40 40 1
40 80 2
40 20 3
40 10 4
40 08 5
40 04 6
_________________
-Jon
Back to top
View user's profile Send private message Send e-mail Visit poster's website
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 21210
Location: Chicago, IL

                    
PostPosted: Tue Oct 28, 2003 5:30 pm    Post subject: Reply with quote

If you look at the hex codes you posted in binary a pattern starts to emerge.

You'll notice that the first 2 bits are always "01". Then the remaining 14 bits appear to a sort of bitmap, where only one bit can be on for any given command.

_Hex_ ____Binary_____ OBC Function
40 00 0100000000000000 00 ???
40 01 0100000000000001 01 ???
40 02 0100000000000010 02 ???
40 04 0100000000000100 03 6
40 08 0100000000001000 04 5
40 10 0100000000010000 05 4
40 20 0100000000100000 06 3
40 40 0100000001000000 07 1
40 80 0100000010000000 08 2
41 00 0100000100000000 09 right
42 00 0100001000000000 10 left
44 00 0100010000000000 11 dn
48 00 0100100000000000 12 up
50 00 0101000000000000 13 sel
60 00 0110000000000000 14 enter

We could simply multiply the variable hex byte by 4 (and set bit14) to create the correct binary signal.

NOTE: I suspect that I have the OBCs inverted (so this list is in effect upside down) but showing them this way helps demonstrate the "multiply by 4" part.
_________________
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
Back to top
View user's profile Send private message Visit poster's website
jon_armstrong
Expert


Joined: 03 Aug 2003
Posts: 1238
Location: R.I.P. 3/25/2005

                    
PostPosted: Tue Oct 28, 2003 6:10 pm    Post subject: Reply with quote

Yes, I think you are right. I also think ti83 may have learned 1 and 2 backwards. BTW, I can do it in PB. If you consider Zero to be 0,-180 and One to be +75,-0 and it will take 48 bits in all the cases I decoded above, but it woulld be ugly.

Eight 6-bit bytes "look" the best here they are in decimal and you can definitely see the pattern again:

46 18 57 09 09 09 09 09 up
46 18 23 09 09 09 09 09 dn
46 18 18 57 09 09 09 09 left
46 18 18 23 09 09 09 09 right
46 23 09 09 09 09 09 09 sel
46 57 09 09 09 09 09 09 enter
46 18 18 18 23 09 09 09 1
46 18 18 18 57 09 09 09 2
46 18 18 18 18 57 09 09 3
46 18 18 18 18 23 09 09 4
46 18 18 18 18 18 57 09 5
46 18 18 18 18 18 23 09 6




ti83, are there any more commands? And would you repeat the learn on 1 and 2 (for my sanity)

-
_________________
-Jon
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ti83programmer



Joined: 13 Oct 2003
Posts: 60

                    
PostPosted: Tue Oct 28, 2003 7:29 pm    Post subject: Reply with quote

I apologize for my wording...I meant no reply as to what to do next. I posted it to the Diagnosis Area and that was the last I heard of it. I should give a better description of the latest file I've uploaded (SNESprotocol2.txt):

On the wireless controller, there are several buttons that configure the controller itself, and there is a switch to switch between 1P, 2P, (one player, two player) and off. There are also the usual SNES buttons, which are Select, Start, A, B, X, Y, L, and R. All buttons were learned while switch was on 1P. The layout is this:

1 = A
2 = B
3 = X
4 = Y
5 = L
6 = R
Select = Select
Enter = Start

I apologize for my rudeness lately and the late reply. I appreciate all of you taking the time to look at this for me. I'd do it myself but I don't know anything about protocol specifics.
Back to top
View user's profile Send private message
jon_armstrong
Expert


Joined: 03 Aug 2003
Posts: 1238
Location: R.I.P. 3/25/2005

                    
PostPosted: Wed Oct 29, 2003 1:24 pm    Post subject: Reply with quote

Some questions:

SNESprotocol2.txt is the same commands that you posted before but you deleted button's 1 and 2 and re-learned those commands, right?

Regarding the commands that you have learned to the cursor buttons, are those the Joy Stick commands? While we are at it, could you learn Off, 1P and 2P. Or, are those hardware switches on the controller so you can use multiple controllers in the same game. If it is the latter, could you learn a few commands in 2P mode. I would like to see what that does, if anything, to the IR commands.
_________________
-Jon
Back to top
View user's profile Send private message Send e-mail Visit poster's website
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 21210
Location: Chicago, IL

                    
PostPosted: Wed Oct 29, 2003 1:40 pm    Post subject: Reply with quote

Jon, once you get the rest of the info from ti83, go ahead and create a 2-byte protocol using PB, then I'll modify it to be a 1-byte protocol by adding the "multiply by 4" logic.
_________________
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
Back to top
View user's profile Send private message Visit poster's website
jon_armstrong
Expert


Joined: 03 Aug 2003
Posts: 1238
Location: R.I.P. 3/25/2005

                    
PostPosted: Wed Oct 29, 2003 5:54 pm    Post subject: Reply with quote

Rob,

There is one other issue.

The definition in John's new format is:

{56.3k,msb}<-350,70|-194,230>(852,-416,0:1,D:8,F:8,-33812)+

The "<-350,70|-194,230>" is the Zero and One definition in this case expressed in uSec is reversed from the normal convention. PB can reverse the burst for one pair but not for both to do bi-phase.

I have seen one other keyboard that uses this kind of bust pair so perhaps it's a feature that John can add to PB.

Otherwise, to use PB, I would have to define Zero= 0,-180 and One = +75,-0 and a "true" Zero would be 001 and a "true" One would be 0111 and it will take 48 bits.
_________________
-Jon
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ti83programmer



Joined: 13 Oct 2003
Posts: 60

                    
PostPosted: Sat Nov 01, 2003 3:47 pm    Post subject: Reply with quote

I'm really sorry, it's been a hectic past couple of days.
Yes, SNESprotocol2.txt is the same commands, only 1 and 2 are re-learned. And yes, the arrow keys correspond to the keypad on the remote.The 1P/Off/2P thing is just a switch that changes the already existing buttons. I'm learning commands right now and I'm going to upload a new file called SNESprotocol2P.txt which should be the same as SNESprotocol2.txt, only for the 2P mode. I'm sorry for all the uploads, but I'm a little stupid when it comes to Yahoo! Groups. I'm amazed you guys can make an upgrade for this! Thank you very much!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - General Forum All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

Powered by phpBB © 2001, 2005 phpBB Group
Top 7 Advantages of Playing Online Slots The Evolution of Remote Control