Playstation controler connected to the Propeller
Klap
Posts: 65
I got the PS2 controller working for the Basic Stamp but I was wondering if anyone has got it working with the Propeller yet. All I could find was a PS2 emulator which plugs into a PlayStation 2, but I would like to connect the PS2 controller to the Propeller. Has anyone done this yet?
Comments
obex.parallax.com/objects/203/
I remember trying this a while back but could not get it to work. Has anyone else been able to get this code to work?
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
Yep.. I had it working. I did not want to dedicate a cog to it though so I re-wrote it in SPIN so it can be polled from a main loop
I've attached a modified version of the original demo code for VGA also.. it's been _ages_ since I did it but it worked at the time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"VOOM"?!? Mate, this bird wouldn't "voom" if you put four million volts through it! 'E's bleedin' demised!
I know some other ways ive seen to interface a PS2 controller to a micro controller used an adapter of some kind.
Does this need that or could you directly connect it to the prop?
-Tom
I am using the PS2 driver in the obex library, I believe the url posted earlier is the correct one. I had to change the initialization of the serial library, (just a name change) after that all was good.
The code does not turn on analog mode on my controller, that has to be done by hand, I am sure it could be changed to do this.
I am using the controller to steer a robot car.
The code I posted above has the details of how to switch on (and lock on) analogue mode.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"VOOM"?!? Mate, this bird wouldn't "voom" if you put four million volts through it! 'E's bleedin' demised!
Okay, thanks.
I totally missed that.
Not needing to use a cog is also nice.
Why don't you put your code into OBEX?
I was not completely sure about the wire connections so I am including a schematic of the circuit I built. I am using a propeller spin stamp which operates with a built in external 10,000,000 clock freq instead of the 5,000,000 clock so I changed that and also the halved the pll from 16x to 8x. (I did this for both the main program and the sub program)
Except for that small change I didn't alter a single line of code.
So the way I see it there is only two options; either everybody else is wrong and the code is fundamentally flawed or my circuit is not hooked up correctly.
Please help.
I used an actual connector so I didn't splice the lines.
(Sorry, as a result I don't know the color codes.)
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
I bought a PS2 extension cable and cut it in half and then wired the half that the controller plugs into to a ribbon cable (and ribbon cable end), I then plug it into my board.
The colours were not correct in my extension cable, I figured out the colours with a voltmeter and wrote them down before I made the connections.
The site above has some useful rule of thumb methods to see if things are working. In my case, a controller I bought did not work, I had to use another one.
I have it working right now without any trouble, I can try and help you debug things if you wish.
I cannot verify their colours though, because I used an extension cable that used a different colour scheme.
I would maybe try by counting the pins on the connector, because the pin numbers from the site above worked for me.
Do you have an oscilloscope or logic probe?
http://www.lynxmotion.com/Product.aspx?productID=73&CategoryID=46
John Abshier
Eliminates the current limiting resistors anyway.
Still need the pullup for the data pin (1). 10k is fine.
Here is what it says:
Play Station 2 Controller driver v1.0
Author: Juan Carlos Orozco
Copyright (c) 2007 Juan Carlos Orozco ACELAB LLC
http://www.acelab.com
Industrial Automation
License: See end of file for terms of use.
Use the Sony Playstation Controller Cable (adapter) from LynxMotion
http://www.lynxmotion.com/Product.aspx?productID=73&CategoryID=
Connect DAT, CMD, SEL, CLK signals to four consecutive pins of the propeller
DAT should be the lowest pin. Use this pin when calling Start(first_pin)
DAT (Brown), CMD (Orange), SEL (Blue) and CLK (Black or White)
Use a 1K resistor from Propeller output to each controller pin.
Use a 10K pullup to 5V for DAT pin.
Conect Power 5V (Yellow) and Gnd (Red covered with black)
I followed this exactly. The only problem is that there is no wiring diagram, which makes this a little ambiguous. Has anyone made a wiring diagram using the LynxMotion adapter? (mine should be dead on unless I am doing something wrong). Better yet can anyone look at my wiring diagram and see if it is correct? (see picture). The code I am using is exactly the same as the code located at http://obex.parallax.com/objects/203/ (except for the clock).
Are you able to change the diagram to also show what pins on the connector each thing is going to? I can then verify it against my working setup.
In terms of DAT, CMD,SEL,CLK you are doing it in the same order as me (I start at P0), so that should be the same as you.
If you plug in the controller, I assume the analog light is not on, if you push the button, does it turn on? It seems that if the controller is powered, then pushing the analog button turns the light on and off (I also switches modes [noparse]:)[/noparse] ). I had one controller that I bought that was bad, and it failed this test. My good controller worked with that test. At least if the LED works, you know you have the power connected correctly.