Shop OBEX P1 Docs P2 Docs Learn Events
Sending data through PS/2 keyboard port — Parallax Forums

Sending data through PS/2 keyboard port

bTalcottbTalcott Posts: 1
edited 2006-05-27 16:58 in General Discussion
I'm totally new to stamps.

I'm looking for an example of how I could send data through a PS/2 style cable to my computer's keyboard port.

Looking to send info on timed events as well as from environmental input to the stamp (doorswitch open and close).

Any leads?

Thanks,

~ B

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-05-27 16:58
    The interface is a bit complex. It is synchronous serial, 8bits with 1 parity bit into the computer, but to the keyboard it adds an acknowledge bit. Everything is in keyboard codes, not ASCII. The keyboard driver in the computer's BIOS converts the information to ASCII. And, there are signals for two events: when a key is pressed and when a key is released.

    If you can juggle and filter all that, you have excellent programing skills.

    With the Stamps you have a bit of a snag. The 8bits of information has a pairty bit, a start bit, and a stop bit. So each byte is 11 bits long when going into the computer and 12 bits long when going into the keyboard or your BasicStamp in this case [noparse][[/noparse]don't forget the acknowledge bit].

    For using a keyboard with a BasicStamp,
    Most of us just give up and buy an adapter from either Al Williams [noparse][[/noparse]at about $25] with complete board or a single DIP [noparse][[/noparse]$6] from another outfit. Al William's product gives both the raw keyboard codes or the converted to ASCII.

    Sending to a computer,
    I suppose you could possilby do the send, but there is a problem in that the computer will want to pull the clock line high to tell you to wait until it is ready for more data. You could ignore it, but that would lose input.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Sign In or Register to comment.