Shop OBEX P1 Docs P2 Docs Learn Events
Keyboard... — Parallax Forums

Keyboard...

Kaos KiddKaos Kidd Posts: 614
edited 2006-05-26 02:15 in Propeller 1
Ok, I've read it time and time again.. Keyboard support..·
I believe it was PS2 keyboard support.· This is great for inputing.
Can it 'duplicate' the keyboard, ie·provide the input to a computer?

TO further explain my question:
A·user interface & a PS2 keyboard interfaced with a Propeller chip.· This can do lots of neat stuf.
The output of the Propeller user interface & PS2 keyboard are connected to and replace the keyboard of a PC.


Just exploring some ideas..





▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Just tossing my two bits worth into the bit bucket
KK


Post Edited (Kaos Kidd) : 2/28/2006 5:02:28 PM GMT

Comments

  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-02-28 16:41
    I don't see why not, but even better IMHO is the mouse support or being able to replicate a mouse. Think of making specialized mouse devices for disabled, for gaming, or other specialized needs.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    Perform a Survey of Electronic Technology Employers - Click here!
    Personal Links with plenty of BASIC Stamp info
    and SelmaWare Solutions - StampPlot - Graphical Data Acquisition and Control
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-02-28 17:11
    Martin:
    I agree, but again the ever elusive question is: Can it directly support it, or will it need special hardware to connect.
    I'm fairly sure a USB connection could be made, and the various commands required supported.
    I know for sure a USB connection for "custom" hardware can be made, and it's drivers created for the PC side of things,
    I'm looking for how one would impliment a standord input device implimented on the Propeller.
    Any special hardware, or programming that might be needed. Input doesn't seem the problem
    There are products that can connect and give the BS2+ uP's the PS2 input, and I believe the Propeller supports a much easier input connection
    However, duplicating it's output to the PC becomes an issue.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Just tossing my two bits worth into the bit bucket
    KK
    ·
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-02-28 17:19
    The Demo board has a connector for Mouse/Keyboard directly in, the only extra HW on the board are resistors. If software in the Propeller can be written to directly read these devices, I don't see why it wouldn't as easily be able to replicate these devices, but I am talking non-USB style - PS2. Once we get into USB, I'd think the Propeller is fast enough to act as a USB 1.0 Device (not host, though maybe.

    Others will chime in I'm sure [noparse]:)[/noparse]
    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    Perform a Survey of Electronic Technology Employers - Click here!
    Personal Links with plenty of BASIC Stamp info
    and SelmaWare Solutions - StampPlot - Graphical Data Acquisition and Control
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-02-28 17:23
    Exactly Martin.
    If this proves to be true (ie the propeller can be programmed and hooked up to act as a PC keyboard on it's PS2 port), then I've got 5 or 6 projects that will launch within budgatory issues for a few people....
    A keyboard is a USB 1.0 device, it's speed isn't that important.
    The issue for a USB keyboard (or mouse) here is how to code for what commands in what format.
    Man, I can't wait...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Just tossing my two bits worth into the bit bucket
    KK
    ·
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-02-28 19:13
    Martin -

    It would seem to me that a quadrature encoder object, and a mouse object would really be variations on the same theme, and might be incorporated into one slightly more flexible, or parameter driven generalized object. Perhaps something like this (pls ignore syntax, as I haven't a clue!):

    OBJ quadrature.spin mode=input|output, type=encoder|mouse, resdpi=nn, phaseA,phaseB

    or something along those lines. Just a thought to reduce the numbers of similar objects.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-02-28 20:00
    Bruce Bates said...
    Martin -

    It would seem to me that a quadrature encoder object, and a mouse object would really be variations on the same theme, and might be incorporated into one slightly more flexible, or parameter driven generalized object. Perhaps something like this (pls ignore syntax, as I haven't a clue!):

    Hey Bruce,
    It depends how you look at it.· A standard mouse, of course,·uses two quadrature encoders and momentary buttons, and then is manipulated into bit-data that the PC (or Propeller!) understands.· So when acting as a receiver, the propeller or PC ·does not get the raw quadrature counts or button presses.

    If we talk about duplicating a mouse's output to a PC, we wouldn't need to use anything similar to a mouse.· It could be a some kind of resistive or capacitive array or (fill in your ideas here)·which the propeller would take that input, and send data out which would mimic a mouse to the PC for a more interesting·input/control device.·

    -Martin


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    Perform a Survey of Electronic Technology Employers - Click here!
    Personal Links with plenty of BASIC Stamp info
    and SelmaWare Solutions - StampPlot - Graphical Data Acquisition and Control
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-03-01 15:12
    Ummm, Propeller Grueus?
    Can the propeller emulate a PS2 Keyboard device?
    I have tried, in vain I'll add, to find out how to code a keyboard.
    I know I can read a keyboard, but how would one go about replacing the keyboard ?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Just tossing my two bits worth into the bit bucket
    KK
    ·
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-03-01 15:24
    "Can the propeller emulate a PS2 Keyboard device?"
    ·
    The short answer is yes, but there won't be any immediate object released to do this.· The
    code that will·"read" a keyboard will be available to anyone.· It should be trivial to analyze
    the code required to read the keyboard and come·up with code that will emulate a keyboard.
    The same principle also applies to the mouse.
    ·
    Google is your friend, the information as far as timing, pinouts, even example code in some
    situations is available for keyboard, mouse, etc.
    ·
    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-03-01 16:10
    Beau:
    Thanks a lot for the answer. I did google (for most of an hour anyway), and the best items I came up with was the connection (ok, the docs from the propeller will show me that...) and key scan codes (again, I'm sure the propeller code will give me that.) So, I guess I could deduce the inverse, and send the codes, again using the propeller code to determine the timing and such. But, what about responding to commands? The PS2 is a bidirectional connection, with commands being sent for a few things, I know there are several commands sent. Blaaa, I'll wait for the chip and go... [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Just tossing my two bits worth into the bit bucket
    KK
    ·
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-03-01 17:19
    I am looking forward to this. It will be extremely useful to all.
    I have been trying to code my own Keyboard to RS-232 adapter via an SX-18 as a study project.

    Compactly moving AT keyboard keycodes into ASCII code format is a bit of a challenge. It is much easier to pass through raw key codes to a PC.

    While the serial output is something like I2C, it is asymetrical [noparse][[/noparse]it uses an Acknowledge in only one direction], totals 11 bits wide output and 12 bits wide input, it requires 8bit with ODD parity, requires 275ma to the keyboard, and a lookup table to sort keycodes into ASCII for data, for control, and cursor movement. The BAUD rate is a bit odd too at somewhere between 10K to 16.6K in Sychronous serial.· Keycodes are transmitted for both make and break.

    The mouse, while having similar serial format is much easier as it does not buffer and repeat codes that go unverified and it merely reports a few directions and a few toggles. It doesn't have Shift, Escape, and Control to manage either.

    I suspect it will be one of the tougher objects to get done unless someone who has been there and done that is reviving old work.

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

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 3/1/2006 5:23:38 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-03-01 17:58
    Kaos Kidd,

    When I worked for National Semiconductor, I had two workstations.... A PC and a UNIX box. I got tired of having two keyboards and two mice.
    On a PIC (<-I know bad word) , I essentially made an AB switch so that I could use one keyboard and one mouse. The UNIX keyboard was
    straight RS232 (1200 Baud) relatively easy to interface, and so was the UNIX mouse, so I used these as my input sources. After many hours
    of hooking my keyboard up to a scope (in-line tap between keyboard and PC), I manually/visually decoded the patterns generated from my
    keyboard, and simply re-mapped what I was getting from the UNIX keyboard so that the corresponding PC keyboard code was generated. Even
    some of the "special" PC keyboard keys were utilized, which were really just a MACRO series of ordinary keystrokes. Most of the communication
    back to the keyboard, was simply telling which LED to turn on (This info could be seen on the scope as well) such as NumLock, CapsLock, etc.
    The keyboard itself does not manage this.

    Anyway, point is... It might take some doing, and clever ingenuity, but it ALL boils down to interfacing. With the Propeller, the speed is there,
    so it becomes a matter of just wiggling the pins the right way.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-03-01 19:37
    Beau and Kramer
    Thanks!
    I think I'm getting the jist of it.
    I've some ideas for the interm to try...
    THanks, and thanks alot. I've a lot more info now then before!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-04-04 15:02
    Just an update:· I was able to find this web page, http://maven.smith.edu/~thiebaut/ArtOfAssembly/CH20/CH20-2.html·which shows both the incoming·and outgoing commands / data.· And, once again Beau was right; Google is your friend.· The·code for the actual keyboard wedge will be short and simple.· Coding·the "features" of this keyboard is going to be·be fun.· The funny thing I discovered is the USB slave side of a keyboard simply responds to the commands sent.· Meaning, once I get the wedge code working correctly with the PS2 connector, I·should beable to wire it into·a USB slave connector and it should work, but I have more research to do in this (the USB) side of it all..·

    KK



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • Oliver H. BaileyOliver H. Bailey Posts: 107
    edited 2006-05-26 01:31
    Here is a link to the engineering information needed to interface a PS/2 Keyboard.

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

    I'm working on this over the next couple of weeks. I'm also working on a PS/2 Mouse interface and a USB chip that will interface the Propeller as an HID device. I'm very busy right now so this probably won't be completed until late summer.

    Oliver
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-05-26 02:15
    Thanks Oliver..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
Sign In or Register to comment.