Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Problems connecting PS2 controller to Axon

  1. Problems connecting PS2 controller to Axon

    I followed the tutorial on the SoR site (cut and paste the code) (http://www.societyofrobots.com/membe...rials/node/200), however I can't seem to get it to work. It basically loops forever trying to confirm the controller is in analog mode (waiting for a 0x73 byte). The PS2 controller (genuine sony brand) does get put into analog mode (red led turns on), however the data received from the controller is always 0 causing the init loop to go on forever. I've tried different delays between the clock pulses, etc, but nothing helps.

    Here's the real kicker, if I turn off the Axon, I correctly get the 0x73 byte (and the 0x5a 'ready' byte) EVERY TIME, along with a few frames of valid controller data before the telnet connection, and the Axon, die out. It does not appear to be random input pin behavior when the Axon is turned off.

    Something about turning off the Axon causes the code to work, in it's last dying breaths...

    Any help would be appreciated.

  2. #2
    Join Date
    Dec 2007
    Location
    Portland, OR
    Posts
    3,198
    Images
    952
    Rep Power
    138

    Re: Problems connecting PS2 controller to Axon

    I seem to recall reading that the Axon does not run its code upon boot, rather only after a reset. Have you tried that?

  3. Re: Problems connecting PS2 controller to Axon

    The code is running, as it posts various status messages and each failure to 'connect' to the the PS2 controller in the telnet session (along with all the bytes received from the PS2 controller). It just doesn't get anything back from the PS2 controller until I turn off the power switch.

    Could turning it off, and the slow power down due to the huge capacitor, cause the speed of the processor to go down? Like normally it's running to fast to talk to the PS2 controller at 16MHz, but as it slows down/powers down, it finds a good speed to connect? I've tried increasing the delays at various points during the TX/RX to the controller, but it didn't help, so I am not sure of this theory.

    Has anyone else successfully connected a PS2 controller to an Axon, or other AVR MCU (Using C/C++)?

    (Oh, and it does immediately run the program after uploading a new .hex or turning on the power. I've added a 10 second countdown at startup so I could connect a telnet session before things get going.)
    Last edited by JadeKnight; 09-24-2009 at 12:49 PM.

  4. #4
    Join Date
    Dec 2007
    Location
    Portland, OR
    Posts
    3,198
    Images
    952
    Rep Power
    138

    Re: Problems connecting PS2 controller to Axon

    Ah okay, was worth a shot. I'll get John from SoC over here and have him take a shot at this. I haven't had time to dive into the Axon platform yet, so I'm sort of shooting in the dark.

  5. #5

    Re: Problems connecting PS2 controller to Axon

    Quote Originally Posted by Tyberius View Post
    I seem to recall reading that the Axon does not run its code upon boot, rather only after a reset. Have you tried that?
    The default is to require pressing the user button before code starts to execute. I commented that out in Axon.c (mine is called walter.c) and now code starts at power up.

    Code:
        /*********ADD YOUR CODE BELOW THIS LINE **********/
    
        //wait until user pushes button
        while(!button_pressed());  // <--- comment this line out to autostart code
    
        //reset all timers to zero
        reset_timer0();
        reset_timer1();
        reset_timer2();
        reset_timer3();
        reset_timer4();
        reset_timer5();
    
        while(1)
            {
            control();//uncomment this for your code (and use control.c only to program)
    
            //servo_controller();
    
           delay_cycles(100);//an optional small delay to prevent crazy oscillations
            }
        /*********ADD YOUR CODE ABOVE THIS LINE **********/
    8-Dale
    I can handle complexity. It's the simple things that confound me.
    Do everything in moderation, ESPECIALLY, moderation..
    Sometimes the only way to win, is not to play.. -- Stephen Falken

  6. #6
    Join Date
    Dec 2007
    Location
    Portland, OR
    Posts
    3,198
    Images
    952
    Rep Power
    138

    Re: Problems connecting PS2 controller to Axon

    Quote Originally Posted by LinuxGuy View Post
    The default is to require pressing the user button before code starts to execute. I commented that out in Axon.c (mine is called walter.c) and now code starts at power up.

    8-Dale
    Thanks for the clarification! I couldn't find that post for the life of me.

  7. Re: Problems connecting PS2 controller to Axon

    I call this multi-forum double posting
    http://www.societyofrobots.com/robot...p?topic=9155.0
    (linked for cross-reference)
    Last edited by societyofrobots; 09-24-2009 at 09:39 PM.

  8. #8
    Join Date
    Dec 2007
    Location
    Portland, OR
    Posts
    3,198
    Images
    952
    Rep Power
    138

    Re: Problems connecting PS2 controller to Axon

    Quote Originally Posted by societyofrobots View Post
    I call this multi-forum double posting
    http://forums.trossenrobotics.com/showthread.php?t=3579
    (linked for cross-reference)
    Uhh? Wrong link? :P

  9. Re: Problems connecting PS2 controller to Axon


  10. Re: Problems connecting PS2 controller to Axon


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question(s) Axon Programming Questions
    By WGhost9 in forum Robot Computers
    Replies: 20
    Last Post: 07-06-2009, 05:15 PM
  2. Control Solutions
    By MSpurk in forum Mech Warfare
    Replies: 25
    Last Post: 03-15-2009, 09:33 AM
  3. PS2 controller
    By StuartL in forum Mech Warfare
    Replies: 16
    Last Post: 01-12-2009, 07:59 PM
  4. RC & Serial Servo Controller Kit
    By Al1970 in forum Garage Sale
    Replies: 0
    Last Post: 01-10-2009, 12:39 AM
  5. Question(s) Motor controller ?'s
    By sthmck in forum Arbotix, Microcontrollers, Arduino
    Replies: 4
    Last Post: 11-06-2008, 03:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •