Author Topic: DataHand Upgrade Project  (Read 8881 times)

0 Members and 1 Guest are viewing this topic.

Offline gator456

  • Thread Starter
  • Posts: 29
DataHand Upgrade Project
« on: Sun, 17 October 2010, 23:48:57 »

At the beginning of this year my RSI became severe enough that I had to do something.  I tried a Kenisis contour and a Goldtouch split keyboard.  Neither of these provided the relief I was looking for.  I got lucky and found a used DataHand Personal on Ebay.  I was able to get a unit in pristine condition for half the price of a new one (at this price I could resell it for close to what I paid, if needed).  The difference with the Personal is that it has a fixed QWERTY layout whereas the professional allows reprogramming of 20 keys.  The current model also has USB whereas mine has P/S2.  

Learning the DataHand was pretty difficult.  After 20 years of touch typing you donít really think about key locations.  However, like most things in life, it was mastered with time and persistence (my RSI also kept me well motivated).  After about 4 weeks I was using the DataHand part time and after 6 months was at 45 WPM (I was at 55 WPM on a traditional keyboard before I started).  During this period I found some things with the DataHand key layout that I, personally, found sub-optimal.  At this point I had a choice.  For $180 I could have upgraded the unit to the Professional firmware to enable key reprogramming and resolved most of my issues.  Or I could build my own controller.

I have am a EE by trade with many years of software and electronics experience.  I innocently decided that designing my own controller would be a easy, quick project.  The electronics part was easy but this was my first embedded software project.  I have learned a lot and it has been fun, but writing Embedded C code was neither quick nor easy.

I searched the internet and found several keyboard projects based on the Atmel AVR platform.  Because of these examples I picked the AVR.  (I learn best from examples)

My first task was to reverse engineer the DataHand.  I found that to be a fun challenge.  The DataHand consists of 2 halves with 26 keys each.  The DataHand used optical couplers instead of physical switches.  This helps reduce the key force but also eliminates ghost keys.  The two halves combine to create a single 13x4 keyboard matrix.  The DataHand has a large 15 pin DIN cable to connect the left and right halves (The large cable is one thing I plan to streamline).  There is one good thing about the 15 pin DIN cable: it makes a great debug port.  (You see I have only one DataHand and I did not want to take it apart every time I wanted to work on my microcontroller.)  So, in the evening I would just unplug the left hand and reconnect it to the 15pin DIN on my breadboard.  This allowed me to do about 90% of my code development with the DataHand fully assembled.

My first AVR was the ATMega644 but I could never get the USB working.  I then discovered the Teensy2.0++ from pjrc.com.  

The Teensy is fantastic.  It gave me an AVR with a ton of IO in a 40 pin DIP foot print and an onboard USB connector.  Pjrc also included some debug utilities which turned out to be a real live saver.  The DataHand uses a 40 pin 8051 as the microcontroller.  



I was able to make an adapter using a 40 pin dip socket.  



With the adapter I can plug the Teensy directly into the DataHand circuit card.  

This was soooo much easier than making a new circuit card.  Right now the cable for the Teensy snakes out the top, but eventually I will run it out the back.



At this point the project has the following:
    [*]A Multi endpoint USB device that implements both a mouse and keyboard
    [*]A firmware based 3 button scroll wheol mouse
    [*]A Perl script which allows quick regeneration of the keyboard matrix
    [*]Full rearrangement of mouse/keyboard layout via the Perl script and Firmware update
    [*]A hotkey which initiates a firmware update
    [*]No special mouse or keyboard drivers required
    [/LIST]

    The new layout I have settled upon is below.  I highlighted in green the keys I moved.  This text is very close to what my Perl script reads in.



    The things that drove my new layout were:  
      [*]The default DataHand layout has non-alphanumeric characters on the same keys in NAS and NORM mode.  For example NAS+pointer_finger+east gives you underscore, whereas unshifted_pointer+east gives you single quote.  By sharing the same key I found myself hitting shift+pointer+east instead of NAS+pointer+east for the underscore.  To alleviate this I rearranged the keys to follow the shifted/unshifted relationship of the QWERTY layout as much as possible and only put special characters on the A-Z letter keys.
      [*]I wanted the mouse keys on the unshifted NORM keys
      [*]I wanted the ( and < to be on the same finger.  Having them on different fingers was confusing.
      [*]When I hit the space key, the edge of my thumb would bump the FUNC key and put me in FUNC mode.
      [*]When I would use FUNC mode keys like arrow or page down I would often forget to exit FUNC mode.
      [/LIST]

      With this problem solved I went after the only real shortcoming I have found with the DataHand: the mouse.  Donít get me wrong, the DataHand is a fantastic keyboard.  However, I tried the built in mouse keys but they did not work well for me.  It was like walking through Jell-O.  I tried adjusting the speed of the mouse keys, no luck.  I tried several things to solve the mouse problem:  I first moved my external mouse to the left side (This gave a much needed break to my right hand).  Next I purchased an ergonomictouchpad.com (recommendation from a DataHand user).  This is a good device, but I could not find a good place to put it.  The last thing has been the best.

      I mounted a trackpoint from a IBM KPD8923 just below the Ďcí key.  





      As you can see, the mounting point is over the edge of the DataHand PCB.  So, I had to create a mounting plate.  Here is how the TP is held in place on the IBM keyboard.



      I cut out the chunk to which the TP was mounted.  I then mounted this on the backside of the DataHand circuit card.




      It has been in place just a few weeks and I am really liking it.  The addition of the trackpoint makes the DataHand a comprehensive keyboard/mouse solution.  I just have to move my middle finger a small distance from the home row to access it.  I have the 3 mouse buttons assigned to the right hand.

      Some things I would like to do in the future:
        [*]2 wire cable between left and right halves (instead of the bulky 15 pin din)
        [*]Key frequency logger so I can better optimize my layout
        [*]Design a PS2 -> USB controller so I can add acceleration to the TP
        [/LIST]

        The DataHand at my desk



        [/FONT][/SIZE]
        « Last Edit: Mon, 18 October 2010, 08:07:17 by gator456 »

        Offline itlnstln

        • Posts: 13093
        DataHand Upgrade Project
        « Reply #1 on: Mon, 18 October 2010, 07:23:52 »
        Awesome!  Great job.  You have more balls than me modding something as expensive as the Datahand.  I wonder if Webwit has seen this (I think he has the upgraded one, though).


        Offline kriminal

        • Posts: 831
        DataHand Upgrade Project
        « Reply #2 on: Mon, 18 October 2010, 07:50:17 »
        yeah some pretty impressive stuff..
        way above what im currently capable of right now.
        Geekhacked Filco FKBN87M/EB modified with Brown, black and blue cherries, doubleshot keycaps
        Deck KBA-BL82 with Black cherries
        Cherry G84-4100LCMDK-0 Cherry ML switches
        Cherry G80-8200hpdus-2 Brown cherries
        IBM Lexmark 51G8572 Model M Keyboard
        Geekhacked Siig Minitouch KB1948
        IBM Model M Mini 1397681

        Offline unicomp

        • Posts: 151
        DataHand Upgrade Project
        « Reply #3 on: Mon, 18 October 2010, 08:04:33 »
        Amazing. I really want to try a DataHand but they seem fairly unavailable unless you want to spend circa $1000 on one.

        Offline Rajagra

        • Posts: 2950
        DataHand Upgrade Project
        « Reply #4 on: Mon, 18 October 2010, 09:44:35 »
        Excellent work! Getting the Trackpoint in in such a tidy way is amazing.

        Offline lowpoly

        • Posts: 2482
        DataHand Upgrade Project
        « Reply #5 on: Mon, 25 October 2010, 07:13:49 »
        Quote
        Design a PS2 -> USB controller so I can add acceleration to the TP

        In theory it should be possible to feed the TP into some unused Teensy pins. There are some libraries availabe at avrfreaks.net, IIRC.
        The Apple M0110 Today
        Miniguru thread at GH, kit preview site at guru-board.com

        Offline gator456

        • Thread Starter
        • Posts: 29
        DataHand Upgrade Project
        « Reply #6 on: Tue, 26 October 2010, 22:02:32 »
        The Teensy I already have in there could be used...  The problem is the Teensy is in the right hand box and the TP is in the left hand box.  There are some un-used wires in the 15 pin DIN but they are connected to ground.   I would have to cut traces on the the datahand.  Dont want to do any more than I have to.

        I have written some very crude Teensy code to read the PS2 and send it back out the USB.  The problem which I debugged but did not fix, was the USB host would eventually issue an interrupt while the controller was reading the TP.  Then it locked up.

        I have done some experiments with the AVR's 2wire protocol (very cool stuff).  I was able to setup a 2wire interface between a ATMEGA644 and the Teensy.  A key press on one controller would light up an LED on the other.  My thought would be to design another left hand control board that would use a 4 wire cable, like USB, to communicate between the left and right half.  Then I would have the horsepower and pins to read the TP.

        Offline lowpoly

        • Posts: 2482
        DataHand Upgrade Project
        « Reply #7 on: Fri, 29 October 2010, 05:09:30 »
        Quote from: gator456;239204
        I have written some very crude Teensy code to read the PS2 and send it back out the USB.  The problem which I debugged but did not fix, was the USB host would eventually issue an interrupt while the controller was reading the TP.  Then it locked up.

        Do you think it would be possible to fix it?

        Quote
        Show Image

        I had that same sheet metal left over from my miniguru mod. Tough stuff. Hand lever shears, however, cut it like the proverbial hot knife cuts butter.
        The Apple M0110 Today
        Miniguru thread at GH, kit preview site at guru-board.com

        Offline zefrer

        • Posts: 482
        DataHand Upgrade Project
        « Reply #8 on: Fri, 29 October 2010, 09:03:49 »
        There is some ps2 reading code for the Teensy++ here that reportedly works ok.

        In that code repository he maps the PS2(port) events to the ps3's usb controller events. You would need to map them to USB HID events instead for use with the datahand.

        Offline gator456

        • Thread Starter
        • Posts: 29
        DataHand Upgrade Project
        « Reply #9 on: Fri, 29 October 2010, 09:16:08 »
        Yes it can be fixed.  Just Software.  My skill with embedded C and timers is pretty weak.

        Offline geoffff

        • Posts: 8
        DataHand Upgrade Project
        « Reply #10 on: Fri, 28 October 2011, 13:42:14 »
        gator456, that's awesome!  I'm seriously thinking of doing this to one of my DataHand keyboards, so I can use it on a Mac.  To use it with a Mac I'd need to convert it to USB, and add a third modifier key (Control, Command, Option).

        Would you mind sharing the details of your Teensy microcontroller code?  Also, the 40-pin socket converter -- did you have to jumper-rearrange more pins than that?  It looks like you only moved GND or something.

        Offline froot

        • Posts: 1
        DataHand Upgrade Project
        « Reply #11 on: Sun, 30 October 2011, 03:58:28 »
        Geoffff,

        I am not the OP but his post inspired me too and I have built a very
        similar adapter.

        The hardware part is fairly simple. With the right orientation the 40
        pin socket converter can be used with an almost 1-1 mapping, I only
        had to use jumper wires for one of the data pins and GND. This results
        in a somewhat jumbled data pin arrangement on the teensy side but to
        me the simple hardware was worth a little ugliness in the code.

        I wrote my own firmware based on the teensy HID examples. Like you I
        also badly wanted an extra modifier so I made the F thumb shift
        non-modal and used the now free N thumb shift as the "GUI" HID
        modifier which shows up as Super under Linux.

        I made a couple other minor tweaks to the layout involving Q, DEL, ESC
        and KP_ENTER but this would be easy to change back if desired. I
        haven't implemented the numpad mode and the built in mouse controls
        because I never used them. I made some effort to ensure that the
        various key Shift/NAS press/release sequences that I tend to use
        during quick typing work right so to me at least the new firmware
        feels less glitchy than the original.

        I can't figure out how to make the forum accept the URL so just
        google for "dhteensy github"

        Offline gator456

        • Thread Starter
        • Posts: 29
        DataHand Upgrade Project
        « Reply #12 on: Mon, 12 December 2011, 11:10:18 »
        To all

        I am sorry for being silent for so long.  Work was pretty crazy for awhile and I have 4 kids.  Both get priority over the DataHand :-(

        I have a second datahand  (ebay aprox. $500).  I have now build my own circuit card for the left and right hand units.  It eliminates the bulky 15 pin cable and uses a two wire serial interface.  The firmware has progressed since my last post.  I can adjust the speed of the mouse keys and wheel.  ( still dont use DH mouse)

        I can now remap keys and record macros.  I have 2 layouts.  It has a command mode.  It can print the layout:

        Command List(case insensitive):
          L - List commmands (prints this list)
          I - Status of internal variables
          K - Reprogram a key
          O - Reflash firmware

          P - Print active matrix
          7 - Print bank 1
          8 - Print bank 2

          E - Increase mouse wheel speed
          C - Decrease mouse wheel speed
          R - Increase mouse slow speed
          v - Decrease mouse slow speed
          U - Increase mouse fast speed
          M - Decrease mouse fast speed
          . - Exit

        It seems the forum removes the spaces:

             \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
        NORM \        +----+               +----+               +----+               +----+
        NORM \        | Q  |               | W  |               | E  |               | R  |
        NORM \ +----+----+----+     +----+----+----+     +----+----+----+     +----+----+----+     +----+----+----+
        NORM \ |Del | A  | [  |     |Esc | S  | B  |     | `  | D  | T  |     | '  | F  | G  |     |Rtrn|Lshf|Tab |
        NORM \ +----+----+----+     +----+----+----+     +----+----+----+     +----+----+----+     +----+----+----+
        NORM \      | Z  |               | X  |               | C  |               | V  |          |NORM|Lshf|Lctr|
        NORM \      +----+               +----+               +----+               +----+          +----+----+----+
        NORM \
        NORM \
        NORM \
        NORM \                           +----+               +----+               +----+               +----+
        NORM \                           |MACR|               | I  |               | O  |               | P  |
        NORM \ +----+----+----+     +----+----+----+     +----+----+----+     +----+----+----+     +----+----+----+
        NORM \ |Lalt|NAS |FUNC|     | H  | J  |MB1 |     | Y  | K  |MB3 |     | N  | L  |MB2 |     | ]  |  ; | \ ?|
        NORM \ +----+----+----+     +----+----+----+     +----+----+----+     +----+----+----+     +----+----+----+
        NORM \ |Bksp|NAS |Spac|          | M  |               | ,  |               | .  |               | /  |
        NORM \ +----+----+----+          +----+               +----+               +----+               +----+
        NORM \
        NORM \  
             \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
        « Last Edit: Mon, 12 December 2011, 11:23:22 by gator456 »

        Offline Input Nirvana

        • Posts: 3372
        • Location: Somewhere in the San Francisco Bay area
        • If I tell ya, I'll hafta kill ya
        DataHand Upgrade Project
        « Reply #13 on: Mon, 12 December 2011, 12:18:32 »
        Wow. So with key remapping, 2 layers, and macros, this sounds similar to the Kinesis Advantage controller, and HumbleHacker. It also sounds like the GH-project-that-shall-not-be-done, which basically is to have a controller that can be 'added' to any keyboard and have the sophisticated functionality you have now listed. Interesting overlap...except that you are actually doing it.

        I'm thinking that your controller should be a Group Buy :)
        Kinesis Advantage | RollerMouse Free 2 | Apple Magic Trackpad | Alphagrip | Colemak | all on Mac
        Evil Screaming Flying Door Monkeys From Hell
        Thanks much, Smallfry

        Offline geoffff

        • Posts: 8
        DataHand Upgrade Project
        « Reply #14 on: Mon, 12 December 2011, 17:00:10 »
        I just now found that there's a 2nd page of comments here answering my questions -- whoops!  :)

        Thanks so much, Froot & input nirvana, for those details.  Amazing that only one pin (ground) needs to be moved.

        I think I'm well on my way now to getting this working.

        -- Geoff

        Offline bryanangler

        • Posts: 3
        DataHand Upgrade Project
        « Reply #15 on: Sat, 28 January 2012, 23:22:50 »
        So I just purchased a datahand PRO II on ebay and it doesnt appear even with the pro that you can reprogram all of the keys.  specifically, the delete, tab, control, and thumb up lever cannot be remapped.  So, it looks like the only alternative is this Teensy method gator so brilliantly pioneered.  gator can you confirm that those keys all can be customized through the teensy?  

        I have some basic experience with the teensy and manipulating the firmware c code -- I grafted a teensy-controlled microswitch to my mouse to give it an extra hotkey button.  But this datahand is in a whole different league.  gator I am wondering if you would be willing to share the teensy c code you came up with to remap the datahand so i can use it as a starting point --  I would be willing to paypal you 100 bucks for your trouble.  I dont need anything fancy or anything to do with mousing, I just want to be able to remap the keys

        Online hoggy

        • * Ergo Moderator
        • Posts: 1323
        • Location: Isle of Man
        DataHand Upgrade Project
        « Reply #16 on: Sun, 29 January 2012, 02:40:36 »
        bryanangler,  Apologies if you've already looked, but you might be able to do most of that with autohotkey (I'm pretty certain that the thumb up can't be remapped though).  Don't get me wrong, I love pics of customised keyboards.
        GH Ergonomic Guide (in progress)
        http://geekhack.org/index.php?topic=54680.0

        Offline Input Nirvana

        • Posts: 3372
        • Location: Somewhere in the San Francisco Bay area
        • If I tell ya, I'll hafta kill ya
        DataHand Upgrade Project
        « Reply #17 on: Mon, 30 January 2012, 01:06:16 »
        Quote from: bryanangler;502096
        So I just purchased a datahand PRO II on ebay ....

        Did you get the Pro II that just sold this last week?
        Kinesis Advantage | RollerMouse Free 2 | Apple Magic Trackpad | Alphagrip | Colemak | all on Mac
        Evil Screaming Flying Door Monkeys From Hell
        Thanks much, Smallfry

        Offline bryanangler

        • Posts: 3
        DataHand Upgrade Project
        « Reply #18 on: Mon, 30 January 2012, 08:29:36 »
        Quote from: input nirvana;502972
        Did you get the Pro II that just sold this last week?

        I did -- and I love this thing!  I am using it though in a pretty unconventional way -- as a one-left-handed keyboard.  Looking at my usage habits over the years I am a heavy "power mouse" user.  Specifically a Logitech MX revolution and now a G700, where i have maybe 50 common actions mapped to the mouse buttons through both direct access and chording of them.  

        Being tired of constantly moving my right hand between mouse and keyboard, i wanted to try out left-one-handed-keyboarding.  So i created a cusom standard keyboard layout based on the DVORAK left-one-handed layout, and have been using that for the last few weeks.  it has been a learning process to say the least, but i can tell i am improving on it every couple days.  still several keys are hard to reach so after learning about the existance of the datahand it occured to me that could be the ultimate one-handed device given the drastically reduced finger travel distance.

        so I pulled the trigger on a used datahand for $900, and now have it mapped to roughly mirror the DVORAK left-one-handed layout.  If i can get control of that thumb-up key for a third layer it will be complete.  My goal is to be able to type as fast with one hand on a datahand as with two on a normal qwerty keyboard.  geekhack wont let me upload a picture, so here is a link to the other thread I have about it:

        deskthority.net/viewtopic.php?f=2&t=1747&p=32442#p32442

        Offline bryanangler

        • Posts: 3
        DataHand Upgrade Project
        « Reply #19 on: Mon, 30 January 2012, 08:42:29 »
        Quote from: hoggy;502201
        bryanangler,  Apologies if you've already looked, but you might be able to do most of that with autohotkey (I'm pretty certain that the thumb up can't be remapped though).  Don't get me wrong, I love pics of customised keyboards.

        and yes i was able to do them all but the thumb up through Autohotkey -- thanks hoggy :)  another nice thing using autohotkey is i made the thumb layer buttons dual-purpose.  meaning if i just press and release the L1 thumb key, it is a period, but if i hold down the L1 thumb key and then press one of the finger keys, it spits out the L1 key and releasing L1 doesnt spit out a period (see picture in link above)

        Offline Input Nirvana

        • Posts: 3372
        • Location: Somewhere in the San Francisco Bay area
        • If I tell ya, I'll hafta kill ya
        DataHand Upgrade Project
        « Reply #20 on: Mon, 30 January 2012, 17:47:16 »
        Autohotkey equivalent for Mac?
        Kinesis Advantage | RollerMouse Free 2 | Apple Magic Trackpad | Alphagrip | Colemak | all on Mac
        Evil Screaming Flying Door Monkeys From Hell
        Thanks much, Smallfry