Shop OBEX P1 Docs P2 Docs Learn Events
PS2 keyboard emulator — Parallax Forums

PS2 keyboard emulator

RobertgRobertg Posts: 3
edited 2007-04-16 14:11 in BASIC Stamp
Hi All,

Seen plenty of threads on this subject but can't find any sample code...
Does anyone have basic code to interface a PIC to a PC?

Thanks,

Rob.
·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-15 22:47
    It ought to be possible to do this (have a Stamp take the place of a PS/2 keyboard), but I've never seen sample code posted.
    The issue comes up from time to time, most recently about a Propeller being used in place of a PS/2 keyboard.
    If you want sample code for a PIC processor, you will have to search elsewhere since this is a support forum for the Parallax Stamp
    and, although some of these are made from PICs, they're not the same thing.
  • RobertgRobertg Posts: 3
    edited 2007-04-15 23:46
    Hi Mike,

    I'm sure someone has done it, but thanks for your help anyway.

    Rob.
  • Harrison.Harrison. Posts: 484
    edited 2007-04-16 01:53
    There is a somewhat usable example on how to send data to a pc using the ps2 port. I have attatched the zip file that contains text documentation and example source code.

    I have posted this a few times on this forum but for some reason it doesn't appear when people search for it.
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-04-16 08:20
    Robertg,
    I posted something similar -This may be an option.. a routine which runs on a pc waiting for data on a serial port - when it receives data - it injects the data into the keyboard buffer as if it were typed on the p.c. - i have attached a link to it here ...

    http://forums.parallax.com/attachment.php?attachmentid=45863

    the thread is here:
    http://forums.parallax.com/showthread.php?p=633364

    so if you send data from the stamp with 'Serout' to a p.c. running this application it is injected into the keyboard buffer on the p.c. as if it were typed...

    Regards,
    Quattro.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
  • RobertgRobertg Posts: 3
    edited 2007-04-16 10:26
    Thanks Quattro/Harrison,



    For your reference, In my search XP also does something similar in allowing external serial devices to emulate keyboard strokes. http://www.microsoft.com/windowsxp/using/accessibility/serialkeys.mspx

    I will probably head down this path for a quick and easy solution, the challenge is not many pcs now have serial ports these days...yes I could use a USB to serial converter but it's starting to become a messy solution.

    Harrison' suggestion is great, but it misses the keyboard init function that is required by windows XP to recognise that a keyboard is plugged in.

    So still looking for the ideal solution, if anyone is interested in working it out would be willing to shed some cash for the solution.

    Thanks all.

    Rob.
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2007-04-16 14:11
    Take a look at this post. It has been done on a BS2 to a PS2 keyboard. I built it and know it works.



    http://forums.parallax.com/showthread.php?p=629467
Sign In or Register to comment.