Playstation2 controller interface problem

mountaineermountaineer Posts: 27
edited 2005-02-15 - 06:29:01 in Robotics
I am trying to interface a Sony DualShock2 Playstation controller to my Basic Stamp 2 OEM. I am using the Adapter cable from LynxMotion to interface the two together. I got my information from the PlayStation Control Redux article, which is #101 in the Nuts & Volts Stamp App Articles section under Documentation in the July 2004 version of the Parralax CD. I built the interface circuit between the lynxmotion cable and the Basic Stamp on a perf board from radio shack. The only variation I had in the ciruit was that I changed the 2N3904 transistor to a 2N4400. I then downloaded the [url=ftp://www.nutsvolts.com/PSX_Demo.BS2]program[/url] from the Nuts and Volts FTP Library. When I downloaded the program it downloaded fine but the debug console said that the controller could not be found even though it appears to be hooked up correctly. With the program still running I pressed the "Analog" button on the controller and it lit up, signifying power to the controller. Tbe only changes I made to the program was that I replaced the IO line definitions with the following code:

PsxDat PIN 4
PsxCmd PIN PsxDat+1
PsxAtt PIN PsxCmd+1
PsxClk PIN PsxAtt+1

And made the corrisponding changes to the physical setup. I am still getting the controller not found message. I tested the inverter with my volt meter and it appears to work. I have no clue as to go about debugging this problem since lynxmotion cable and the code are not mine and should theoretically work. The controller s new and should work, even though I have never tested it. Any help would be greatly appriciated.[url=http://][/url]

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-02-14 - 11:37:40
    You cannot use operators in the PIN defition; you must declare each pin specifically.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • mountaineermountaineer Posts: 27
    edited 2005-02-14 - 20:31:03
    I changed the code so that the pin definitions are constants and it still doesn't work. I tried to operate the program without the inverter by useing the bitbanging portition of the code with the same results. Each time the Stamp recieves all '1's on its ports, due to the pull up resistor. It almost seems like the controller isn't attached even thought it is.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-02-14 - 21:24:34
    I wish I could offer more help -- a customer called me a few weeks ago with the same complaint after working on the circuit for five days; turns out he had a broken connection. If you've got a 'scope you should have a look at the signals to see what's happening. I know it's little comfort, but the code and circuit I designed do in fact work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • mountaineermountaineer Posts: 27
    edited 2005-02-15 - 00:33:34
    I checked the physical integrity of the wires and they are all intact. I retested the inverter and it works fine. I tried the controller again and I got '1's for everything except the very first byte displayed, psxID, for which I got 'E1' for digital mode and 'F3' for analog mode. Do you know why this is? Thanks for your help so far.
  • mountaineermountaineer Posts: 27
    edited 2005-02-15 - 06:29:01
    I got it to work. Turns out the controller was defective. Thank you for your help.
Sign In or Register to comment.