Shop OBEX P1 Docs P2 Docs Learn Events
Propeller to simulate playstation 2 controller. SPI 4us clock period 250-500KHz — Parallax Forums

Propeller to simulate playstation 2 controller. SPI 4us clock period 250-500KHz

MahhariMahhari Posts: 3
edited 2009-11-18 06:24 in Propeller 1
Hi guys!

I've been looking for a microcontroller to simulate a playstation 2 controller. I've tried 3 other microcontrollers including the Basic Stamp 2px, and they have all been too slow.· The playstation outputs a 250-500KHz clock signal to the playstation controller (or microcontroller in my case), and the controller has to send data back at the same rate.· Here is a logic analyzer screenshot of the playstation and controller communicating i took directly from my ps2 controller: http://www.tinkerjunkies.com/Sample1.html. I need the Propeller to send the Data and ACK signals back to the playstation.

each clock period is 4us and the pause inbetween cycles is 16us. Can the Propeller communicate at this speed? other microcontrollers couldn't get the next data byte in time (it took longer than 16us).

Also I looked throught the Propeller command list and didn't see any SPI serial command, does one exist? Can the Propeller do this?

Thanks a lot for your help!

Comments

  • LeonLeon Posts: 7,620
    edited 2009-11-17 23:25
    It can do SPI in software - see the Obex.

    I thought you were using an AVR:

    www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=86446&postdays=0&postorder=asc&start=0

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM

    Post Edited (Leon) : 11/17/2009 11:34:19 PM GMT
  • mikedivmikediv Posts: 825
    edited 2009-11-18 01:39
    Mahhari I read some of the other posts, interesting. Anyway maybe I am wrong but isn't the bigger question what programing language are you trying to do this in? I would think a Pic could easily handle this and an AVR or even a prop but if you are doing some kind of hardware
    interpretation with say Basic then you are correct an 8 bit PIC would be to slow a Prop in ASM would suite you just fine. But maybe I a missing something ????
  • MahhariMahhari Posts: 3
    edited 2009-11-18 02:10
    Hi mikediv,

    I'm not sure I understand your question about programming language? If you've read some of the other posts then you might have seen that i'm using a pc to send that data information.

    So i'm using Csharp for PC code, Basic for Picaxe (middle-man controller), and whatever will be the third microcontroller to send the bytes to the playstation 2.

    PC --> Picaxe --> AVR, PIC, or Propeller --> Playstation



    But you've said either a AVR or PIC should be able to handle these speeds, so I think I have my answer.· The propeller is sold out everywhere [noparse]:([/noparse]
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-11-18 03:06
    I could get you a DIP Propeller, but they will be in stock in less then a month.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Computers are microcontrolled.

    Robots are microcontrolled.
    I am microcontrolled.

    But you·can·call me micro.

    Want to·experiment with the SX or just put together a cool project?
    SX Spinning light display·
    Want cheap wholesale electronic parts?
    Transistor parts wholesale
  • whickerwhicker Posts: 749
    edited 2009-11-18 04:25
    Mahhari said...


    But you've said either a AVR or PIC should be able to handle these speeds, so I think I have my answer. The propeller is sold out everywhere [noparse]:([/noparse]
    Only the DIP version is.

    Arguably to me, the protoboards are more useful, because it is just a matter of interfacing to the I/O pins, and not have to worry about crystal, decoupling, regulation, loose wires. Additionally, I end up using the demoboard for the video, vga, sound, keyboard, or mouse things sometimes posted on here. Yeah, most of the pins are used up, but they go a long way when just adding in a SD card, sensor, controller, shift register, or whatever, and have everything else in a more or less standard place.
  • TimmooreTimmoore Posts: 1,031
    edited 2009-11-18 04:58
    I assume you are trying to simulate a PS2 controller. There are a couple of objects around that do the reverse i.e. talk to a PS2 controller, it would be pretty straight forward to modify them to simulate a controller instead.
  • MahhariMahhari Posts: 3
    edited 2009-11-18 05:58
    Hi Timmoore,

    How to simulate isn't the problem, yorue right there are many sites you can reverse engineer. The question is how chip is fast enough to keep up with the playstation. [noparse]:([/noparse]
  • TimmooreTimmoore Posts: 1,031
    edited 2009-11-18 06:24
    The prop should be more than fast enough to keep up with the playstation, when talking to the PS2 controller it needs to be slowed down.
Sign In or Register to comment.