Shop OBEX P1 Docs P2 Docs Learn Events
Complatability issues. — Parallax Forums

Complatability issues.

FwissFwiss Posts: 13
edited 2009-07-28 14:56 in BASIC Stamp
This question is fairly simple. Would the PS/2 breadboard thingy work with a BASIC Stamp II?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-02 20:50
    Some PS/2 breadboard thingys might work with a Basic Stamp II and some might not. It all depends on the details of your particular thingy and what you want to do with it.
  • FwissFwiss Posts: 13
    edited 2009-04-02 21:19
    The PS/2 thingy is the one from Parallax. A keyboard is what I want to use my thingy for.
  • JDJD Posts: 570
    edited 2009-04-03 06:08
    Fwiss,

    Do you mean the PS/2 to Breadboard Adapter as your thingy reference? The Parallax PS/2 to Breadboard Adapter·was designed·to·enable someone to·connect a PS/2 mouse or keyboard to breadboards, protoboards and perfboards with 0.1-inch hole spacing. It was initially intended for a PE Kit, but I dont see why it wouldn't be able to work with any controller that could control a DATA and CLOCK pin; which the BASIC Stamp 2 can do.

    You can verify that what I'm talking about is the same PS/2 "thingy" you are refering to from·the link below, wink.gif

    PS/2 to Breadboard Adapter:
    http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/PS2/List/0/SortField/4/ProductID/513/Default.aspx

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • FwissFwiss Posts: 13
    edited 2009-04-03 21:03
    That is. Indeeedilly doo-daa-dee is. How could I make it sense keyboard inputs?
  • FranklinFranklin Posts: 4,747
    edited 2009-04-04 01:55
    You could always download the documentation and sample code FROM THE LINK ABOVE.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-04 03:09
    Franklin .. The sample code and documentation are really Propeller specific. Both a PS/2 keyboard and mouse are probably not doable directly with a Stamp because of speed limitations. I may be wrong on this, but there are some old threads discussing the use of a mouse and there's some good points about lack of speed. There are a variety of external co-processors that can interface a PS/2 keyboard like www.awce.com/pak6.htm and www.multilabs.net/ezKEY.html.
  • Josh FoureJosh Foure Posts: 5
    edited 2009-07-21 22:57
    Hi all, I just recently tried to use my BS2 to connect to a PS2 keyboard using the parallax connector and I haven't been able to get it to work either. The main issue appears to be that the SHIFTIN command (and other such commands) only let the BS2 generate the clock. However, with PS2 the keyboard will send up the clock signal. I therefore thought that I could use the PULSIN command to detect the clock changes but I can only see 1 clock high to low and another low to high clock change when a key is pressed. I would have expected 22 such changes since PS2 uses 11 bits. I thought the clock pulses were between 30-50 microseconds so I would have thought that the BS2 could detect all the pulses. But perhaps I am running into the speed limitations that Mike was referring too. I ordered a PAK VI and will reply when (if) I get it working. I found this great PS2 reference in case anyone else is interested:

    http://www.computer-engineering.org/ps2protocol/

    BTW, I know that the propeller supports PS2 out of the box but what fun is that? [noparse]:)[/noparse]
  • roadrunner3groadrunner3g Posts: 36
    edited 2009-07-22 06:25
    you will need 11 pulsin commands to read 11 bits.
  • Josh FoureJosh Foure Posts: 5
    edited 2009-07-22 12:01
    Right, the reason I stated that I would need 22 pulsins is because I first wanted to make sure that the stamp would be able to detect all 11 clock high to low and all 11 clock low to high. The idea was then to read the data line as soon as I detected the clock going from high to low ("pulsin CLK, 0, time"). However, when I run this program and I type a letter on the keyboard, I only see 1 clock high to low and 1 clock low to high:

    Main:
    golow:
    PULSIN CLK, 0, time
    IF time = 0 THEN golow
    DEBUG "L",DEC time," "

    gohigh:
    PULSIN CLK, 1, time
    IF time = 0 THEN gohigh
    DEBUG "H",DEC time," "

    GOTO MAIN

    Now that I type this, I realize that I may be running into the observer effect where my DEBUG statement is taking too long and I am missing the other clock changes while that is going on! Does anyone know how long a debug statement takes to run? I'll instead increment a counter and debug at the end to see if that alters my result.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-22 12:33
    The time needed for a DEBUG statement to execute is mostly determined by the number of characters produced. For most of the Stamps, the DEBUG statement transmits characters at 9600 Baud or roughly one character per millisecond. There's a bit of additional time needed to set up the whole statement and each character, but it's mostly the transmit time.
  • Josh FoureJosh Foure Posts: 5
    edited 2009-07-28 14:56
    Hi all, just to circle back, I was not able to read the 11 clock pulses while incrementing a counter in between each pulse. I am not sure if incrementing the counter is taking too long and I am missing the clock pulses while that is happening or what. However, I did get my PAK VI which works like a charm. The documentation on the website shows you how to connect it to a BS2 and it worked no problems the first time. If I had to do it over again, I might look into using the ezKey mentioned above first as that has both the PS2 connector and the controller bundled and is cheaper than the Parallax adapter and PAK VI together. I wonder why Parallax doesn't sell a similar chip so that newbies like myself don't have to go around hitting around for different sites.
Sign In or Register to comment.