(Wireless?) PS2 Controller Interface
bulkhead
Posts: 405
I'm doing mine like the one in the Nuts & Volts article and have a few questions on wiring (see diagram)
From Jon Williams' "Playstation Control Redux" article in Nuts & Volts
Is there a reason why there is no resistor on the data line?
Would any transistor work in place of the 2n3904? Preferably, one I could pick up from RS. Edit: I found these at RS, lol.
Also wondering if anyone has tried using a wireless controller successfully? I've read about using the Madcatz wireless lynx, but I'm not sure if it requires different code to communicate.
Thanks.
Edit: Almost forgot, but what's the difference between Analog ($73) and Digital ($41) mode?
Post Edited (bulkhead) : 1/27/2006 8:55:54 PM GMT
From Jon Williams' "Playstation Control Redux" article in Nuts & Volts
Is there a reason why there is no resistor on the data line?
Would any transistor work in place of the 2n3904? Preferably, one I could pick up from RS. Edit: I found these at RS, lol.
Also wondering if anyone has tried using a wireless controller successfully? I've read about using the Madcatz wireless lynx, but I'm not sure if it requires different code to communicate.
Thanks.
Edit: Almost forgot, but what's the difference between Analog ($73) and Digital ($41) mode?
Post Edited (bulkhead) : 1/27/2006 8:55:54 PM GMT
Comments
Analog gives you joystick data, digital just the buttons.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who says you have to have knowledge to use it?
I've killed a fly with my bare mind.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
The only thing I did not do was invert the clock signal. Instead, it is connected directly to the stamp's pin through a 220 ohm resistor. I also adjusted the value in the program to read "clockMode = Direct"
My problem is that the status comes back as "ÿ" which is equivalent to "255." This means that all bits are read as 1's. Is this because there is a pullup resistor on the data line? Is that supposed to be there?
Edit: I inverted the clock signal (and changed the code back) and now it doesn't recieve the status. It does, however, retrieve the ID, which displays as either "A" which is eqiuvalent to "digital" or "ÿ" again. It will read "A" a few times, then read a few "ÿ" then more "A." Is there anything wrong with my wiring that could cause this fluctuation? It seems that the data line is read incorrectly (as all 1's) occassionally, while it works fine for other trials. This seems like a wiring issue since it does work correctly by returning "A" (if it were a programming error, it wouldn't return "A" ever).
Post Edited (bulkhead) : 1/27/2006 10:40:47 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
AAÿAAAAÿAAÿAÿAAAÿ
The only difference in wiring was that I used a 220 ohm resistor going to the transistor. After adding a 270 ohm resistor in series with the 220 (that makes 490 right?), I still get this:
AÿÿAAAAAAAAAÿAÿAAAÿAÿAA
After resetting, this sequence:
AÿÿÿÿAAÿÿAÿAAÿÿA
The A is equivalent to a 41 in dec, the ÿ is equivalent to a 255 (11111111 in binary). As you can see, this appears to be random. Although I do admit that sequence of 9 A's seems not random, all other trials have pointed to a completely random success rate. These are the only two bytes that it will recieve, either the correct one, "A" or it will read as all 1's. Any idea on what could cause this? Oh, I forgot to mention that it's connected to the +5V output on the stamp. Should it be connected to a separate power supply or is using the stamp's power okay?
Also, I already checked the code, and it seems fine. I would guess that since it can successfully read the controller's ID once (as the A's indicate) then it isn't a programming error. Also, the fact that the success rate is completely random eliminates the possibliity of a shifting or memory storage issue, since it would have a visible pattern if that were the case. This really is a mystery.