Shop OBEX P1 Docs P2 Docs Learn Events
BS2 and Sony Playstation Joypad communication — Parallax Forums

BS2 and Sony Playstation Joypad communication

ArchiverArchiver Posts: 46,084
edited 2002-09-14 21:51 in General Discussion
Hello everybody,
I need to stablish a communication between a BS2 and a PS1
Joypad. In the PS1 Joypad Tech Docs it says that all transmission
are 8 bit serial LSB First. And all timing in the PSX (BS2)
controller bus is syncronous to the falling edge of the clock. The
clock is generated by the PSX ( in this case the BS2 ). The BS2
sends two bytes to the Joykey and then the joykey sends two bytes
with the info of the buttons. I think it's a perfect situation to
use Shiftout and ShiftIn. But I have some little problems with what
mode is the appropiate to use with Shiftin and Shiftout.

I would appreciate your help very much, because I don't
have experience using Shiftin and Shiftout. Thank you in advance.

Aceto, Ezequiel Leonardo
Bernal, Argentina.

Here are the time diagrams:
When the PSX (PIC) wants to read information from a controller it
pulls that devices ATT line low and issues a start command (0x01).
The Controller Will then reply with its ID (0x41=Digital). At the
same time as the controller is sending this ID byte the PSX
(PICmicro) is transmitting 0x42 to request the data. Following this
the COMMAND line goes idle and the controller transmits 0x5A to
say "here comes the data".
As I cannot receive the ID (0x41) and send 0x42 to request the data.
I only send 0x42 and skip the ID from the Joykey.

This would look like this for a digital controller

ATT -____________________________________________________________
| Byte 1 | | Byte 2 | | Byte 3 |
CLOCK ---_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_
_-_-_-_-_-_-_-_----
0xFF 0x41 0x5A
DATA
__________--__----__--__----__--__---
0x01 0x42
CMND
_____________
__--________--__

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-09-12 16:25
    --- acetoel <nik@i...> wrote:
    > Hello everybody,
    > I need to stablish a communication between a
    > BS2 and a PS1
    > Joypad. In the PS1 Joypad Tech Docs it says that all

    Aceto,

    How is your progress coming on this? Have you
    figured it out yet?



    =====
    Chris Savage
    Knight Designs
    324 West Main Street
    Montour Falls, NY 14865
    (607) 535-6777

    http://www.knightdesigns.com

    __________________________________________________
    Do you Yahoo!?
    Yahoo! News - Today's headlines
    http://news.yahoo.com
  • ArchiverArchiver Posts: 46,084
    edited 2002-09-12 18:04
    a long while ago i hacked a super nintendo pad and
    posted it to the list. it is not a ps1 joypad, but it
    will definetly substitute for it. i imagine that the
    method used is identical. here is my post from long
    ago:

    original message:
    Greetings stampers!Does anyone
    have any experience interfacing a nintendo or similar
    style game controller with a stamp (thinking robotics
    applications here). The newer ones only have 3 wires
    but a ton of buttons so it has to be serial, does
    anyone know where to find information on the protocol?


    my message:
    It just so happens that i am using a SNES controller
    in a robotics project myself. a good place to
    research all types of controllers, pinouts, voltage
    levels etc., is Gamestationx.com. anyway i just
    pulled the codes out of the SNES controller the other
    day and they go like this[noparse]:([/noparse]correct to the best of my
    knowledge, checked over 2 times)
    binary hex
    nopress:1111111111111111 ffff
    up: 1111011111111111 f7ff
    down: 1111101111111111 fbff
    left: 1111110111111111 fdff
    right: 1111111011111111 feff
    select: 1101111111111111 dfff
    start: 1110111111111111 efff
    y: 1011111111111111 bfff
    x: 1111111110111111 fbff
    b: 1111111111111110 7fff
    a: 1111111101111111 ff7f
    Top rt: 1111111111101111 ffef
    top lft:1111111111011111 ffdf

    this gives 2^12 combinations or 4096
    As you can see, a zero represents the button being
    pressed, and a one is a "no press". To use this, just
    set the correct bit from the chart above, and have
    your controller jump on the correct combination.

    The SNES controller pinouts[noparse]:([/noparse]from gamestation X)
    ____________________________
    / 7 6 5 | 4 3 2 1 |
    ( o o o | o o o o |
    \___________|________________|
    pin description wire color
    1 +5v white
    2 data clock yellow
    3 data latch orange
    4 data line red
    5 N/A
    6 N/A
    7 ground brown

    To use this, just hit the data latch w/ a 12us pulse
    to latch the parallel bits, and then reel them in on
    the data line using SHIFTIN on the BSII, and its as
    easy as that. The mode that I used to real in the
    bits for the chart above was: mode 0, or MSBPRE.
    You can also check out Al Williams's book,
    Microcontroller Projects w/ Basic Stamps, page 179,
    Expanding I/O. I hope all of that will help!!!!







    --- Chris Savage <knight_designs@y...> wrote:
    > --- acetoel <nik@i...> wrote:
    > > Hello everybody,
    > > I need to stablish a communication between
    > a
    > > BS2 and a PS1
    > > Joypad. In the PS1 Joypad Tech Docs it says that
    > all
    >
    > Aceto,
    >
    > How is your progress coming on this? Have you
    > figured it out yet?
    >
    >
    >
    > =====
    > Chris Savage
    > Knight Designs
    > 324 West Main Street
    > Montour Falls, NY 14865
    > (607) 535-6777
    >
    > http://www.knightdesigns.com
    >
    > __________________________________________________
    > Do you Yahoo!?
    > Yahoo! News - Today's headlines
    > http://news.yahoo.com
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed.
    > Text in the Subject and Body of the message will be
    > ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do you Yahoo!?
    Yahoo! News - Today's headlines
    http://news.yahoo.com
  • ArchiverArchiver Posts: 46,084
    edited 2002-09-12 20:31
    --- Klutch <klutch66@y...> wrote:
    > a long while ago i hacked a super nintendo pad and
    > posted it to the list. it is not a ps1 joypad, but
    > it
    > will definetly substitute for it. i imagine that
    > the
    > method used is identical. here is my post from long
    > ago:

    Very detailed. Thank you! I happen to have a few of
    those lying around the house! ;-)



    =====
    Chris Savage
    Knight Designs
    324 West Main Street
    Montour Falls, NY 14865
    (607) 535-6777

    http://www.knightdesigns.com

    __________________________________________________
    Do you Yahoo!?
    Yahoo! News - Today's headlines
    http://news.yahoo.com
  • ArchiverArchiver Posts: 46,084
    edited 2002-09-13 18:41
    Hello,
    The proyect is working okey. I have the interfase ready, and now I'm
    optimizing the code. In a very near future, two weeks I'm starting to
    develop an interfase between a BS2 and a Sony Playstation Memory Card. It
    uses the same protocol as the Controller, and you have more than 128KBytes
    to storage data.
    I though nobody remembered my proyect.
    If you want the code, let me know that
    Ezequiel
    Original Message
    From: "Chris Savage" <knight_designs@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, September 12, 2002 12:25 PM
    Subject: Re: [noparse][[/noparse]basicstamps] BS2 and Sony Playstation Joypad communication


    > --- acetoel <nik@i...> wrote:
    > > Hello everybody,
    > > I need to stablish a communication between a
    > > BS2 and a PS1
    > > Joypad. In the PS1 Joypad Tech Docs it says that all
    >
    > Aceto,
    >
    > How is your progress coming on this? Have you
    > figured it out yet?
    >
    >
    >
    > =====
    > Chris Savage
    > Knight Designs
    > 324 West Main Street
    > Montour Falls, NY 14865
    > (607) 535-6777
    >
    > http://www.knightdesigns.com
    >
    > __________________________________________________
    > Do you Yahoo!?
    > Yahoo! News - Today's headlines
    > http://news.yahoo.com
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-09-14 21:51
    --- Ezequiel Leonardo Aceto <Nik@i...> wrote:
    > Hello,
    > The proyect is working okey. I have the
    > interfase ready, and now I'm
    > optimizing the code. In a very near future, two
    > weeks I'm starting to
    > develop an interfase between a BS2 and a Sony
    > Playstation Memory Card. It
    > uses the same protocol as the Controller, and you
    > have more than 128KBytes
    > to storage data.
    > I though nobody remembered my proyect.
    > If you want the code, let me know that

    Yes Ezequiel, I would be interested in seeing the code
    for how you have accomplished this interface with the
    memory card. And what you have for the controller
    too, if you don't mind sharing. I am interested for
    NON-Commercial use.



    =====
    Chris Savage
    Knight Designs
    324 West Main Street
    Montour Falls, NY 14865
    (607) 535-6777

    http://www.knightdesigns.com

    __________________________________________________
    Do you Yahoo!?
    Yahoo! News - Today's headlines
    http://news.yahoo.com
Sign In or Register to comment.