Shop OBEX P1 Docs P2 Docs Learn Events
Project:Programmable Keybord PROPELLER style! — Parallax Forums

Project:Programmable Keybord PROPELLER style!

KaosKiddKaosKidd Posts: 296
edited 2010-11-25 16:22 in Propeller 1
Remember the old Gateway programmable keyboards? They were awesome! I was (and in most cases) so sad they stopped making them. So, here I am considering making one.

Getting the keyboard with all the extra keys is not really a problem, and neither is the actual SPIN or PSAM a problem. From what I can see, there are two issues.

#1 is how to connect to the host PC.
Options include USB, PS2 and blue tooth.
#2 is Reasonable options.
Things like Feedback, EEPROM, macro depth (such as permitting one macro to call another, and if so, how many deep?) and macro features.
#3 Would a "glide pad" be a worth while addition?

I was thinking of adding a bio finger reader to it as well, with customized "per user" macros stored on devise. Additionally I was considering adding the ability to save / load the macros from the host PC as well.

Ideas, suggestions, innovations and any features that would make this a "wow, awesome keyboard" project?

KK


Any and all opinions

Comments

  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2010-09-21 10:48
    Your main problem would be connecting to the PC. Even the pros can't seem to make a keyboard emultor that works.
  • KaosKiddKaosKidd Posts: 296
    edited 2010-09-21 11:49
    After studying the code and the schematic for the prop's keyboard object, I think a PS2 interface could be done with two pins (one clock input, one data output), some PSAM or SPIN, and a buffer. It would have to respond to the keyboard commands as any PS2 keyboard would.

    The PROP would read the keyboard matrix, encode as needed, then send the scan codes to the buffer (after processing any macros or such), waiting on the PC to ask for them. The commands are discussed Here.

    The PS2 to USB converts would handle that aspect of the conversion if need be.

    KK
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2010-09-21 13:01
    I think that the PC will send too fast of a signal for the Prop to read, but it's worth giving a shot.
  • KaosKiddKaosKidd Posts: 296
    edited 2010-09-21 14:08
    I think that the PC will send too fast of a signal for the Prop to read, but it's worth giving a shot.


    This Document states:
    Data sent from the device to the host is read on the falling edge of the clock signal; data sent from the host to the device is read on the rising edge. The clock frequency must be in the range 10 - 16.7 kHz. This means clock must be high for 30 - 50 microseconds and low for 30 - 50 microseconds.. If you're designing a keyboard, mouse, or host emulator, you should modify/sample the Data line in the middle of each cell. I.e. 15 - 25 microseconds after the appropriate clock transition. Again, the keyboard/mouse always generates the clock signal, but the host always has ultimate control over communication.

    Timing is absolutely crucial..

    I thought the Propeller could easily generate that fast of a clock on one of it's output pins. Am I wrong?
  • KyeKye Posts: 2,200
    edited 2010-09-21 16:09
    It would be much easier to have the prop just read the PS2 signal back from a keyboard. Then the prop could take those bytes and preform its own processing on them and then act as a keyboard and send that data back to the computer.
  • KaosKiddKaosKidd Posts: 296
    edited 2010-09-22 06:58
    Once I get my dev system back up and running, I'm going to do some testing.
    For starters, I plan on placing the prop between a keyboard and PC. Intercepting as needed. Eventually I plan on removing the keyboard and making my own.

    KK
  • jazzedjazzed Posts: 11,803
    edited 2010-09-22 07:40
    The PS/2 protocol is easy for the Propeller to do; Spin should be fast enough at 80MHz.

    http://www.computer-engineering.org is another resource that has more PS/2 interface details. I've been using that as a reference for my I2C keyboard/mouse project.
  • Invent-O-DocInvent-O-Doc Posts: 768
    edited 2010-09-22 18:08
    @KaosKidd. Great project idea. I remember Gateway programmable keyboards well. The prop may not be the best chip for this because of the EEPROM boot up time might be an issue unless the prop is already powered before the computer boots.

    That said, please let me know if you make an object. I could really use a PS/2 'keyboard' emulator on my MCU because I often interface with Flash programs on a PC by pretending to be a keyboard. I'd love to be able to send characters that end up in teh keyboard buffer of a pc! It gets expensive because I have to hack a keyboard or use a keyboard encoder like those used for arcade machine emulators.

    Good luck!
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2010-09-22 18:14
    Even with the latency of the EEPROM loading in the Propeller it would probably be ready before the PC finishes the POST and is ready to use it.

    Robert
  • KaosKiddKaosKidd Posts: 296
    edited 2010-09-30 09:03
    Just an update: minor progress! :)

    Steps :
    #1: 5 volt communication between the prop and host: Done!
    #2: Basic hardware requirements (output side): Done!
    #3: Basic hardware requirements (input side): Researching....
    #3: Basic application goal's and layout: Done!
    #3-A: Start PSAM Host Code with flag:KInit=True (input side is NOT monitored, but code will respond to HOST requests.)
    #3-B: Load LCD module and initialize display.
    #3-C: Load SD support for saving / loading profiles.
    #3-D: Load Default profile (keyboard map and any existing defined macros)
    #3-E: Load Keyboard programming module.
    #3-F: Preform INPUT side initialization.
    #3-G: Set KInit flag = True (input side is monitored and reported to HOST)

    Have I missed anything?
  • KaosKiddKaosKidd Posts: 296
    edited 2010-10-01 07:07
    Just an update as to what's going on with this project:

    Test Connections

    HOST <----> 5v CLK <
    > 1k res <---> Prop Pin
    HOST <----> 5v DATA <
    > 1k res <---> Prop Pin
    HOST
    > GRND
    > ----> BOARD GRND
    HOST
    > 5v Power
    > 3.5V reg ----> BOARD PWR

    For now, I'm using the Propeller Demo board's PS2 with a keyboard connected and modifying the PSAM to return the scan codes. I'm working on getting my spin code (to be converted into PASM later) to reply to the HOST via the above connection. The next step is to directly pass the retrieved scan codes to the HOST. Further steps is to scan the incoming scan codes for macros and then pass the macros. Develop the macro record and store code. When this happens, I'll be adding the microSDcard to the project. The reason for this is to permit large and numerious macros to be stored.
    Next is to incorporate the LCD into the system. This is to display to the user various information. Lastly is to develop the actual custom keyboard interface to replace the PS2 keyboard on the board.

    The final project is to have color or gray LCD under a touch screen so that you can create a totally custom keyboard that would be stored on the macroSD card for any application you want.

    Go Go Gadget Keyboard!

    KK
  • hinvhinv Posts: 1,255
    edited 2010-10-04 20:25
    it sounds very similar to another project I had in mind. If you like, I could donate an SGI onyx keyboard for the project. It is durable, has excellent feel, and has a great feel. It also has a cool granite texture, and is not PS/2.
  • edited 2010-10-06 13:27
    I am very interested to see how you do with this as well! I've wanted to connect my old Kaypro II serial keyboard to a pc for quite a while, but I lack the understanding and skills to implement the ps/2 keyboard emulator that I would need. It's already no problem to get the prop to talk to the Kaypro keyboard. Talking to the pc in a way that doesn't require a custom driver is the problem. Although perhaps that could be a solution... Maybe a kernel driver for Linux that supports taking text from a tty and using it as keyboard input. Probably something similar could be done for windows too...

    PS/2 emulation or USB HID keyboard emulation seems a more elegant solution though...
  • KaosKiddKaosKidd Posts: 296
    edited 2010-10-08 06:42
    Well, once I get the PS2 interface working, the rest is simple.
    As for progress... I'm kind of stuck (but haven't given up) on reading the signals from the PC.... I've got a timing issue... I'll get it...

    KK
  • jazzedjazzed Posts: 11,803
    edited 2010-10-08 06:59
    KaosKidd wrote: »
    Well, once I get the PS2 interface working, the rest is simple.
    Which direction is giving you trouble? PC write to keyboard?
  • kwinnkwinn Posts: 8,697
    edited 2010-10-08 07:20
    There is a keyboard driver in the obex (http://obex.parallax.com/objects/56/) for connecting a pc keyboard to a prop. I have used it with my protoboard and it works well. Perhaps looking at this code would be of help.
  • KaosKiddKaosKidd Posts: 296
    edited 2010-10-14 11:02
    jazzed wrote: »
    Which direction is giving you trouble? PC write to keyboard?

    Reading from the PC is the issue. I keep getting trash when I should be getting the init code. I know why, it's just getting my timing loops right. It appears as if I'm missing the first x bit(s) and that's offsetting the received bytes.

    I am using the keyboard.spin code as my base line code... understanding how to receive is 50% of the battle... :)

    Fun Fun Fun..
    One of these days I'll get that dev pc onto the network so I can share the code and stuff...
  • Vern GranerVern Graner Posts: 337
    edited 2010-10-15 08:22
    KaosKidd wrote: »
    Well, once I get the PS2 interface working, the rest is simple.
    As for progress... I'm kind of stuck (but haven't given up) on reading the signals from the PC.... I've got a timing issue... I'll get it...KK
    Maybe refer to this posting here:

    http://forums.parallax.com/showthread.php?t=125424

    This post in Completed Projects shows a successful implementation of sending data to a PC's PS2 port. Maybe you could examine that for some timing info..?

    Vern
  • KaosKiddKaosKidd Posts: 296
    edited 2010-10-15 09:00
    That was a "bit banged" project. No timing, brute force toggling of the pins.
    I'm getting closer. Right now I believe it's a logic issue with my code that's causing the actual first bit being received being dumped or placed into the wring bit.

    It's a fun project... to say the least...

    Once I get it so it can and will reply properly with the post coding sequence of the host, the rest is somewhat easier, just tricky. While outputting a given scan code, I have to watch to see if the clock line is pulled low by the host between clock pulses. If it does, then I'm not sending data anymore, I'm receiving a command. Some of what is posing are commands from the Host. Once I get the correct values, then I'll build the reply code.
  • hinvhinv Posts: 1,255
    edited 2010-11-14 09:58
    Has there been any progress on this?
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-11-14 12:06
    When I did my 1-pin keyboard driver (PS2 Keyboard to Prop using 1 pin) I found that many keyboards did not adhere to the standard and in particular the first bit was shorter. Could this be associated with your problem?

    I looked inside a few keyboards and found that they use a single 40pin chip and a single sided pcb. Would be quite simple to replace the pcb. Of course this does not do everything you are after.

    Once you get the PS2 comms running it may be worth a chat to scanlime who did the USB protocol.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2010-11-14 12:15
    This isn't exactly what you are intending.. (I do hope you pull it off) but there is always just using an existing keyboard chip...

    I've found that the older, white, PS2, dell labeled "Quiet Key" keyboards have a very nice DIP chip controller in them. I've saved a few as they've got to come in handy for *something*. (Or at least the freebie table at UPE)

    Most keyboards I've looked at have a stupid solder blob inside. junk..

    OBC
  • KaosKiddKaosKidd Posts: 296
    edited 2010-11-18 10:16
    hinv wrote: »
    Has there been any progress on this?

    Minor progress...
    Time has become a comical entity in my life again.
    And yes, I said comical...

    KK
  • TubularTubular Posts: 4,717
    edited 2010-11-25 16:22
    KK,

    How are you going with this? Can I help somehow?

    I have an urgent requirement (1 week to make it work, else spend $$$) that could be very neatly solved with this. My application is generating keystrokes from a touchscreen.

    Previously I have used a commercial arcade game converter that converted (RS232 or hardwired buttons) into PS2 output stream. It worked fine and if I have to I could source more of these, but a Prop based solution would be very elegant as I already have a prop available doing other tasks.

    So, I'm going to go ahead and get everything connected and also fire up that arcade converter in case it yields any helpful info regarding timing etc.

    It would be great to get even a "version 1" of this into the Obex as there is nothing at all at present.
Sign In or Register to comment.