interfacing a computer keyboard with a bs2
crackticus pots
Posts: 34
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··
Post Edited (tin man) : 9/2/2005 9:00:08 PM GMT
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··
Post Edited (tin man) : 9/2/2005 9:00:08 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
··· 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?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If freedom becomes outlawed, only outlaws will have freedom."
Post Edited (Ryan Finley) : 9/6/2005 8:18:52 PM GMT
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
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.
·· 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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If freedom becomes outlawed, only outlaws will have freedom."
·· 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
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 ) 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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10