Shop OBEX P1 Docs P2 Docs Learn Events
interfacing a computer keyboard with a bs2 — Parallax Forums

interfacing a computer keyboard with a bs2

crackticus potscrackticus pots Posts: 34
edited 2005-09-16 15:33 in BASIC Stamp
hello out there·I am new to this form and havn't quite got the hang of it yet.
but i think this is how i post a message, but any way on to my problem.

I have been trying to find a way to connect a keyboard to a basic stamp 2.
with out any components that·I couldn't find at the·near by·radio shack·and·I have tried google for·the pin configuration of a Ps2 (not play station) plug.

my application is a home-automation system with wireless keyboard control
using a bs2 for input/control/output(eg.alarms) and a bs2p for sensers (eg.door,break-beam,motion,sensing light-
levels and more) and output(eg.X10,computer,sound,et center and more).
if any one has any other suggestions that would be helpful


thanks·· smile.gif

Post Edited (tin man) : 9/2/2005 9:00:08 PM GMT

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-09-02 20:03
    http://www.multilabs.net/ezKEY.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-02 21:14
    There's also http://www.awce.com/pak6.htm, the PAK6 from Al Williams.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • crackticus potscrackticus pots Posts: 34
    edited 2005-09-06 17:38
    thank you
  • Ryan FinleyRyan Finley Posts: 4
    edited 2005-09-06 20:13
    Hey, I was wondering...
    ··· I·saw you were trying to interface the Basic Stamp with a keyboard and, as it turns out, I was trying to do the same with a PS2 mouse. After reading a little, I found that·mice (like the keyboard) use a sencrous serial interface. The Basic Stamp's SHIFTOUT command is pretty cool but the SHIFTIN is almost totally useless. SHIFTOUT outputs a clock pulse and data (this is great). Shiftin inputs data but still outputs the clock pulse. What's the point in that? Shouldn't it input the clock. That's the only way it·would work with a mouse or keyboard (or even another Basic Stamp for that matter). What's up with this. Even if you can't interface with mice or keyboards, I'd·hope the·SHIFTIN and SHIFTOUT would at the least be compadible with each other. Am I missing somthing? confused.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If freedom becomes outlawed, only outlaws will have freedom."

    Post Edited (Ryan Finley) : 9/6/2005 8:18:52 PM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-09-06 20:31
    The basic stamp doesn't operate fast enough to capture all the mickeys of a mouse (a mickey is the unit of measure in a mouse, and some engineer's idea of a cute joke). Multilabs also has the ezMOUSE, specifically designed to interface microcontrollers such as the stamp with a PS2 mouse (they even have a document on how to interface the product with a stamp, and it uses SEROUT and SERIN). http://www.multilabs.net/ezMOUSE.html

    The reason the SHIFTIN outputs the clock is that the stamp is a master only device, it cannot without some seriously tortured coding and huge limitations operate as a slave device. SERIN and SEROUT is typically used in stamp to stamp communications because it is a masterless communication method.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10

    Post Edited (Paul Baker) : 9/6/2005 8:32:40 PM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-09-06 21:23
    What Paul said is correct. If you want to input data from a serial shift register (like a 74HCT165) then you need the BS2 to act as a 'master' device, output the clock to the '165, which then shifts the data into the BS2. That's the purpose of the SHIFTIN command.

    And it works really well, by the way. This is also called the "SPI" interface, and works with "SPI" slave devices like eeproms and the DS1307 RealTimeClock.

    Talking between BS2's is done with a single wire (plus ground) using SERIN/SEROUT commands.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-06 22:45
    Ryan,

    ·· Backing up to my post above, you'll see a link to Al Williams PAK chip, which handles both the PS/2 keyboard as well as a PS/2 mouse.· As for SHIFTIN being useless, many of the chips which require SHIFTOUT, also require SHIFTIN to get the data back into the Stamp.· For example, when you SHIFTOUT the command byte to the DS1620 to get the temp, you then need to SHIFTIN the temp.· In this case, SHIFTIN is absolutely required, and it must generate the clock.··Same goes for the DS1302 and many other SPI devices...SHIFTOUT will only send data to them.· You still need SHIFTIN to get it back.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com


    Post Edited (Chris Savage (Parallax)) : 9/7/2005 12:15:31 AM GMT
  • Ryan FinleyRyan Finley Posts: 4
    edited 2005-09-06 23:54
    Thank you everyone. As you can see, I'm no expert on·clocked serial communication. Sorry to "insult" the SHIFTIN command like that. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If freedom becomes outlawed, only outlaws will have freedom."
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-07 00:16
    Ryan,

    ·· Now you know!· =)· If you learned something today then it was worth the misunderstanding.· And now you can talk to those SPI devices with confidence!· Take care!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • crackticus potscrackticus pots Posts: 34
    edited 2005-09-09 00:51
    Thank you all for helping me with my problemsmile.gif

    although I don't like shopping online because I don't have a easy payment method (I am only 15)
    I·decided to use the EZ key mod. (because it·is EZ tongue.gif) because the device itself
    is simple,easy,fast and it is inexpensive!
    the stamp has alot to handle at 1 refresh per second including things like
    high speed serial between stamps, serial to and from a computer, a lcd display (2wire)
    serial to a text to video mod,·4 buttons and a I/R reciver.
    so you see that I needed somthing that moves quickly so the stamp can get on to other things
    and that module will work nicely.


    Thank you.


    Post Edited (Tinman) : 9/9/2005 12:51:08 AM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-09-09 16:18
    Let us know how it works out for you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • crackticus potscrackticus pots Posts: 34
    edited 2005-09-16 15:33
    very nicely (simply put)
Sign In or Register to comment.