Author Topic: "Open Source" Generic keyboard controller.  (Read 103225 times)

0 Members and 1 Guest are viewing this topic.

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« on: Fri, 25 September 2009, 14:28:49 »
I've been thinking about this for a while now, and figured it was worth gauging the community interest in developing an open source (open hardware / software) generic keyboard controller for custom/mod projects.

The idea won't necessarily be to make available for sale a complete mod kit (tho if someone is willing to take up this mantle, there's no reason it can't happen), rather to put together all the information for someone with some skill/knowledge to build it on their own.

Some of the main features I've been considering for this include:

* Ability to select between PS/2, USB, (other) communications protocols.
* Ability to program the matrix/layers without needing development tools/source modifications.
* Standardized matrix interface that would make it easy to interface with most current keyboards (through separate interface cards probably), or work into new custom designs.
* Simple / inexpensive to build at home using "cheap" development tools (eg no $400 ICDs to program the chips).
* Ability to small run produce the boards cheaply.
* Well documented, easily extensible, modifiable etc.

I'd like to get an idea both of who would be interested in helping with the initial development of a project like this, and who would make use of such project if it was available (easy to use, well documented etc).

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #1 on: Fri, 25 September 2009, 14:44:13 »
I'm interested.

There's also dmw's development which is supposed to be open source as well.

Miniguru thread at GH // The Apple M0110 Today

Offline wellington1869

  • Posts: 2885
"Open Source" Generic keyboard controller.
« Reply #2 on: Fri, 25 September 2009, 15:18:00 »
I think this is a fantastic idea.  While I dont have any specific skills to contribute, I'll definitely contribute my enthusiasm and "can-do" attitude! ;-D  I'll send out "positive vibes" at you guys while i'm meditating. And I'll create voodoo dolls of your opponents and stick them with pins.
I can also do the 'vision thing' really well, if you guys need to brainstorm at some point in the process ;)

"Blah blah blah grade school blah blah blah IBM PS/2s blah blah blah I like Model Ms." -- Kishy

using: ms 7000/Das 3

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #3 on: Fri, 25 September 2009, 15:28:41 »
i'm interested too :)

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #4 on: Fri, 25 September 2009, 16:27:56 »
Quote from: wellington1869;120553
I think this is a fantastic idea.  While I dont have any specific skills to contribute, I'll definitely contribute my enthusiasm and "can-do" attitude! ;-D  I'll send out "positive vibes" at you guys while i'm meditating. And I'll create voodoo dolls of your opponents and stick them with pins.
I can also do the 'vision thing' really well, if you guys need to brainstorm at some point in the process ;)


I think the only way a project like this will succeed is if it's strongly community driven (rather then driven by the whims of the core team).   By focusing only on the controller, it will allow for the building in of almost, if not all, wanted features (as opposed to a whole keyboard design that ultimately has to be a compromise between features).

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #5 on: Fri, 25 September 2009, 16:35:51 »
Quote from: talis;120569
By focusing only on the controller, it will allow for the building in of almost, if not all, wanted features


yes, a custom controller would enable many modding projects.

such as heavily modifying an ibm model f :D

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #6 on: Fri, 25 September 2009, 16:57:00 »
What's the state of the Korean controller that has been announced some time ago?

Miniguru thread at GH // The Apple M0110 Today

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #7 on: Fri, 25 September 2009, 16:58:56 »
Quote from: msiegel;120573
yes, a custom controller would enable many modding projects.

such as heavily modifying an ibm model f :D


Capacitive switches may require special electronics though.

Miniguru thread at GH // The Apple M0110 Today

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #8 on: Fri, 25 September 2009, 17:03:58 »
that's ok :)

also, here's the LIMKB keyboard controller:
http://otd.kr/bbs/board.php?bo_table=album&wr_id=11152

maybe google translate will help :(

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #9 on: Fri, 25 September 2009, 17:17:08 »
Thanks. AIKON was the new name. Couldn't remember that. Here's another page in english:

http://www.otd.kr/bbs/board.php?bo_table=aikon_manual&wr_id=10

Miniguru thread at GH // The Apple M0110 Today

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #10 on: Fri, 25 September 2009, 17:18:02 »
Quote from: lowpoly;120580
Capacitive switches may require special electronics though.


Capacitive switches would need different matrix hardware.  The idea of designing a standardized interface however can still deal with it (with an additional amount of work).  The idea would be to abstract away the actual hardware interface.  For a standard switch board, you would just need a passive interface between the matrix and the controller (basically a daughter card, or set of flywires to the matrix interface), for a capacitive one, you'd need a bit smarter interface.  One that would be capable of reading the capacitive switch state, and translating it to the standard interface of the controller (while not needing to handle protocol stacks, keycode translations etc).

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #11 on: Fri, 25 September 2009, 17:22:22 »
Quote from: lowpoly;120588
Thanks. AIKON was the new name. Couldn't remember that. Here's another page in english:

http://www.otd.kr/bbs/board.php?bo_table=aikon_manual&wr_id=10

PI Engineering makes a similar one as well; http://www.xkeys.com/custom/xkmatrix.php .

Offline dmw

  • Posts: 84
    • http://humblehacker.com
"Open Source" Generic keyboard controller.
« Reply #12 on: Fri, 25 September 2009, 17:26:48 »
As far as a keyboard controller is concerned, if anyone is interested in my work thus far, I'll post the code.  It's based on Atmel's AT90USB chip, which I've found pretty straightforward to learn to use.

Offline rdh

  • Posts: 121
"Open Source" Generic keyboard controller.
« Reply #13 on: Fri, 25 September 2009, 18:17:24 »
Quote from: dmw;120593
Atmel's AT90USB chip


Is that the same chip used in the "Teensy++" development board?  (I think so, but I'm not quite sure.)

I've been carrying around vague notions of using a Teensy or Teensy++ as a hardware key remapper.  I would guess the chips they use should be a pretty good fit for a keyboard controller project.
at home: IBM "Space Saving" Model M
at work: Topre Realforce 87UKB55


Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #14 on: Fri, 25 September 2009, 18:21:41 »
Quote from: dmw;120593
As far as a keyboard controller is concerned, if anyone is interested in my work thus far, I'll post the code.  It's based on Atmel's AT90USB chip, which I've found pretty straightforward to learn to use.

I think it would be nice to have a first look. Do you use the AT90USBKey demonstration board?

Quote
Is that the same chip used in the "Teensy++" development board? (I think so, but I'm not quite sure.)

The AT90USBKey uses an AT90USB1287, the Teensy++ a AT90USB646, the Teensy a ATMEGA32U4.

Difference between AT90USB1287 and AT90USB646:

Quote
The AT90USB1286 and AT90USB646 have an USB interface for applications communicating with a USB host. The AT90USB1287 and AT90USB647 comply with the USB On-The-Go (OTG) standard for use as Dual Role Devices (DRD) in applications operating as either host or function device. The USB host capability is key to embedded devices needing to communicate without PC intervention.

The AT90USB1286 and AT90USB1287 have 128 KBytes of In-System Programmable (ISP) Flash, 8 KBytes of RAM and 4 KBytes of EEPROM. The AT90USB646 and AT90USB647 are identical but with half the memory size. All devices have an on-chip bootloader that allows ISP through the USB bus providing unrivalled flexibility from development phase to field update.

From here.

Quote from: rdh;120601
I've been carrying around vague notions of using a Teensy or Teensy++ as a hardware key remapper.

That was here:

http://netzhansa.blogspot.com/2009/04/how-to-convert-your-symbolics-keyboard.html
« Last Edit: Fri, 25 September 2009, 18:42:12 by lowpoly »

Miniguru thread at GH // The Apple M0110 Today

Offline rdh

  • Posts: 121
"Open Source" Generic keyboard controller.
« Reply #15 on: Fri, 25 September 2009, 19:07:01 »
Thanks, lowpoly!
at home: IBM "Space Saving" Model M
at work: Topre Realforce 87UKB55


Offline abio

  • Posts: 9
"Open Source" Generic keyboard controller.
« Reply #16 on: Sat, 26 September 2009, 13:51:50 »
I'm definitely interested in helping if I can.

I'm currently doing a PhD in microelectronics and I've got some experience with MCUs ...

Offline wellington1869

  • Posts: 2885
"Open Source" Generic keyboard controller.
« Reply #17 on: Sat, 26 September 2009, 14:24:21 »
maybe a sourceforge page or a wiki is in order to start organizing needs and assets...

"Blah blah blah grade school blah blah blah IBM PS/2s blah blah blah I like Model Ms." -- Kishy

using: ms 7000/Das 3

Offline cfishy

  • Posts: 60
+1
« Reply #18 on: Sun, 27 September 2009, 20:30:33 »
I'll be happy to help.

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #19 on: Sun, 27 September 2009, 20:42:39 »
it sounds like one of the things this controller will need is a high performance debounce algorithm, that uses very little memory :)

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #20 on: Mon, 28 September 2009, 05:25:44 »
Next steps would be

  • collect wishes/requirements
  • evaluate available hardware/microcontrollers
I guess?

My first wishlist, unsorted: :-)

  • commercial use possible (= find a license we all can live with)
  • programming possible with external programmer software
  • multi-platform sdk for this programming software so I can write my own proprietary programmer
  • if software-less programming, layout should be downloadable from keyboard to pc
  • at least two additional layers
  • must support locking switches for layers (for ex. to switch between Qwerty and Colemak)
  • firmware upgradeable, must not brick
  • cheap hardware, if possible
  • if ps/2 support it should use the usb cable with a passive usb->ps/2 adapter
The last one will probably be nasty.
« Last Edit: Mon, 28 September 2009, 05:29:51 by lowpoly »

Miniguru thread at GH // The Apple M0110 Today

Offline abio

  • Posts: 9
"Open Source" Generic keyboard controller.
« Reply #21 on: Mon, 28 September 2009, 06:38:31 »
  • commercial use possible (= find a license we all can live with)
There's nothing forbidden commercial use if its an open source license. Just have to include the source...

  • programming possible with external programmer software
I suppose this is possible to do through a special USB interface.

  • multi-platform sdk for this programming software so I can write my own proprietary programmer
  • if software-less programming, layout should be downloadable from keyboard to pc
As long as the protocol is open, none of these are a problem. If there's enough demand, it will be done.

  • must support locking switches for layers (for ex. to switch between Qwerty and Colemak)
Not a bad idea, profiles... Can be already achieved through a software layer though.

  • firmware upgradeable, must not brick
Bricking is always a risk, can't avoid it. :P

  • cheap hardware, if possible
Cheap hardware only comes through mass production

  • if ps/2 support it should use the usb cable with a passive usb->ps/2 adapter
This isn't actually that difficult to do, may need some additional level-sensing circuitry to detect a PS/2 connection though.

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #22 on: Mon, 28 September 2009, 10:29:24 »
I think all of those are pretty achievable.

I envision a platform based around a uC family with a fair number of options.  For the most part, there is no reason for most people not to go gross overkill with the uC, with the ability to use a smaller (cheaper, less powerful) version in a commercial product with the associated cost savings.

The plan at this point is to include a sD/usD card reader, and allow a number of layouts to be stored at the same time, with the desired one loaded at boot time (or allow for a change with a programmable key sequence).  The files stored on the flash card would be plain text files, that can be edited in any text editor, without the need (tho not removing the possibility) for a dedicated PC side app.  This also makes it much easier to program/reprogram the keyboard in pure PS/2 environments (or on the fly).  For example, you could plug the keyboard into a PC in a computer lab, and swap layouts on the fly if you desire.

I'd like for the layout to be as dynamic as possible, with the ability to make any key on the keyboard either a locking or a non-locking modifier, with a fairly large number of allowable over-riding layers, as well as a small number of compound layers.

There's no reason not to consider doing this all through direct access either (with on board flash memory for example), but it will also require maintaining a PC side application for Windows/'nix/OSX at the minimum.  Again, in this case, being able to re-flash the base code over the same interface should be a mandatory requirement rather then a desired feature.  As well as the ability to program over both PS/2 and USB.

The uC will need a fairly basic bootloader, that will allow re-programing of the core code using the same flash card interface.  That way the end user wouldn't need any development tools to re-write the code, or upgrade (tho this feature is easily removed in a commercial version if desired).

The steps as I see them are basically :
- Gather basic requirements
- Choose a platform that seems to have the capability of meeting the majority of these requirements, while leaving a fair amount of room for flexibility.
- Develop the hardware platform.
- Develop the software platform.

One of the big requirements I'd like to stick to if possible is to use all open source/free development tools.  I'd like for the end user to be able to download the source, modify/compile, load and run without needing to spend a penny on development tools (programmer, compilers, etc).  There's a number of open source schematic capture and PCB layout tools as well, they definitely aren't as nice or as powerful as the closed source versions (orcad, altium etc) but again, they will allow anyone in the future to mess with / modify the project.
« Last Edit: Mon, 28 September 2009, 10:50:18 by talis »

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #23 on: Mon, 28 September 2009, 11:41:32 »
re: using all open source/free development tools

this is a great idea :)

also, there's a neat feature in p.i. engineering's y-mouse ps/2 to usb adapter: you open a text editor, then press a special key combination... the y-mouse "types out" a menu, and you enter choices to change settings :)

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline mech

  • Posts: 64
"Open Source" Generic keyboard controller.
« Reply #24 on: Mon, 28 September 2009, 13:52:24 »
Nice idea.  You probably want to be looking into Arduino and its variant controller boards.  I would focus on replacement controllers rather than ground-up DIY keyboard projects, although you should keep an eye on making those at least possible.

Open source keyboard controller hardware/software
+ Supported keyboard
+ Controller bypass/adapter board/guide

Would be incredible.  We could override any controller issues (Das III, for example) but also remap keys.  Gamers would love it for macros.  You can probably get a card slot for real cheap and have multiple layouts in there.

Here's a fun idea: put an R+G+B LED on the controller board and have people put an RGB value in the layout files.  Then when they switch, adjust the multicolor LED to whatever that value is.  (Bonus: have it tween to the color.)  For example, I'll set QWERTY to green and Dvorak to blue.  I press scroll lock twice within 2 seconds to shift layouts.

I can contribute software advice but I'm a hardware novice.

BS: IBM Model M 1391401 (1989) & Lexmark-made IBM Model M from 1991
Cherry MX Blue: Das Keyboard II/G80
Black ALPS: Dell AT101W (2)

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #25 on: Mon, 28 September 2009, 14:14:36 »
if there's going to be ample flash memory on the controller chip, it would be smart to have a self-calibration procedure for key debouncing.

i.e., trigger calibration mode, then press and release each key a few times to enable the chip to record maximum bounce times.

this will enable a robust debounce algorithm... and the possibility of using different kinds of switches on the same board.

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #26 on: Mon, 28 September 2009, 14:24:16 »
Quote from: CX23882;121204
(wouldn't it be cool if you could get counters from keyboards for number of key presses, as you can for backlight hours from the service menu of LCD monitors)

Statistics module!

Miniguru thread at GH // The Apple M0110 Today

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #27 on: Tue, 29 September 2009, 13:56:13 »
Hi all!

Wow, I just saw this thread, and it forced me to register on geekhack instantly. :madgrin: What you are discussing here is a bit like what I am currently working on in my spare time: a--guess what--generic open source keyboard controller! I haven't published anything yet, but maybe I should very soon...

The hardware is based on the Atmel AVR ATMEGA16 or ATMEGA32 microcontroller (most probably, some other AVRs would be possible, too). The whole project was inspired about two months ago by RUMP (http://mg8.org/rump/) and Dulcimer (http://www.schatenseite.de/index.php?id=307&L=2), two projects aiming to convert the IBM Model M to USB. Both projects are working quite well, but each has its own set of shortcomings, so I decided to hack my own. ;)

I am simply calling it Keyboard Upgrade for now (not good at inventing clever names)...

The controller is probably not as generic as suggested in this thread. I didn't plan to have a single hardware layout usable in all keyboards, but one PCB per keyboard for use as a drop-in replacement. (One reason is that there is not a lot of space available in some keyboards, and attaching the flat cables to some generic PCB might be challenging in these.) As a result, my firmware now runs on the same hardware as the one used by RUMP and Dulcimer when built for the M. Also, I didn't want One Single Firmware Image to fit them all, but model-specific, lean firmwares built from a set of common source code files, plus some model-specific glue codes. This approach seems to work quite well for me so far.

Anyway. Here are the "standard features" I have implemented already that you would expect to find on any USB keyboard:
  • Standard USB HID (using V-USB from Objective Development).
  • LEDs are supported.
  • Debouncing.
  • Good ghost key prevention.


Additional features:
  • Keyboard layouts are generated from config files, required code is generated from these.
  • Layouts can be remapped when generating them, e.g., for killing the Windows keys or for turning the pesky Caps Lock into an additional Control key; or for remapping the standard layout to Dvorak; or a combination of these--all without intervention of operating systems.
  • Flexible design that is not limited to Model M keyboards.
  • Comes with a boot loader, firmware flashing cannot brick the device (bootloadHID, also from Objective Development).
  • Built using open source development tools (gcc for AVR, Autoconf, Automake), tested on Linux. May also build on Windows with Cygwin; at least firmware flashing should not be a problem there.
  • Open source, non-commercial.


The controller can be used with various IBM Model Ms already (those that share the same keyboard matrix with the 1391401, including my trusty Space Saver).
An incarnation for the IBM M4-1 is on the way (works on my breadboard already), but without trackpoint support for now; I hope to get that supported some day, too.
In theory, the IBM RT3200 (aka Space Saver II) is ready to be supported, too, since I have made a config file describing its keyboard matrix layout already.

I also plan to add support for alternative layouts. Currently, there is only one default layout stored in the firmware ROM (standard QWERTY, unless the firmware image was built using a different layout). In the future, multiple layouts may be uploaded to the keyboard using some tool (haven't thought about that one, however), and stored in the microcontroller's EEPROM. The layout can then be chosen using DIP switches or jumpers. The default layout in the firmware ROM will still be in its place in future versions, and can serve as a fall-back in case the user managed to upload some broken layouts.

So, what do you guys think? :decision:

Offline mech

  • Posts: 64
"Open Source" Generic keyboard controller.
« Reply #28 on: Tue, 29 September 2009, 14:14:28 »
Sounds pretty awesome.  Any way you can decouple the key map from the key layout?  If you use standard codes to represent the layout, you could make generic map files that hopefully wouldn't require a recompile & firmware upload.

How do you feel about listening for character sequences for switching to a certain map?  Like if there are 9 map slots, and I hit Scroll Lock + Scroll Lock + Numpad1 all within 2 secs to switch to layout #1.  SL + SL + Numpad0 back to layout 0.  Although realistically, you're just going to need regional layout packs.

US: QWERTY, Dvorak, Colemak, Dvorak (left handed), Dvorak (right handed), Dvorak variants?
Germany: QWERTZ, International Dvorak, Colemak?

I once had an old programmable keyboard where you could reassign buttons with a certain key sequence.  Program + key + program + other key (or something like that) would flip them and permanently store the flip.  (Too bad that keyboard was domes, and it used volatile storage that would perish with the battery.)

Anyway.  Beyond certain sets of keymaps, you may be able to get clever with how you activate features.  If SL+SL rotates the layout, maybe SL+SL+left Ctrl swaps control and caps lock.  I'm just trying to think of doing this in ways that don't require firmware builds/flashes, although I guess dip switches would be fine.

Let's be realistic though.  Outside the geekhack community, the place this will be most well received is where macros are necessary.  Ever use vi/vim?  It would be awesome if I could easily program a "normal mode" for some of the development tools I have that would be portable between computers, because it's integrated into my keyboard!  Emacs users might like a sticky control key feature.

And, um, on the DL, MMO guys might like it if macro playback could have humanizing randomization added.  As in, realistic and non-constant (but random) delays between keys in the macro sequence.

Anyway, I think you've found a community of people who would be interested in that.  The Arduino boards I talked about above already use ATMEL controllers, so you're on a realistic path at least.

BS: IBM Model M 1391401 (1989) & Lexmark-made IBM Model M from 1991
Cherry MX Blue: Das Keyboard II/G80
Black ALPS: Dell AT101W (2)

Offline Shawn Stanford

  • Posts: 368
"Open Source" Generic keyboard controller.
« Reply #29 on: Tue, 29 September 2009, 15:06:43 »
Pardon my ignorance, but are we talking about an onboard controller that will augment/replace the current onboard controller, or are we talking about an inline controller that will sit between the keyboard plug and the host computer?
The Brat Prince of COBOL

Offline itlnstln

  • Posts: 7048
"Open Source" Generic keyboard controller.
« Reply #30 on: Tue, 29 September 2009, 15:25:12 »
I think it is choice A, the replacement.


Offline mech

  • Posts: 64
"Open Source" Generic keyboard controller.
« Reply #31 on: Tue, 29 September 2009, 15:37:02 »
In between would be good too, but I think the idea is to do lots of custom modding, up to and including bypassing crappy controllers.

Another upshot, the ATMEL chips are cheap.  Perhaps some good, free open source designs could be used by real manufacturers.  Then you'd know what you're getting if they say they support OpenKeyboard v. X (whatever X happens to be).  You also know you have a shot of getting it flashed if there's a problem that needs fixing, although I wouldn't expect a manufacturer to make that a user-serviceable operation.

BS: IBM Model M 1391401 (1989) & Lexmark-made IBM Model M from 1991
Cherry MX Blue: Das Keyboard II/G80
Black ALPS: Dell AT101W (2)

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #32 on: Tue, 29 September 2009, 17:31:34 »
welcome Mnemonix!

your project is very exciting :D

we will surely appreciate any experience or code you want to share

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #33 on: Tue, 29 September 2009, 17:48:52 »
Quote from: mech;121481
Sounds pretty awesome.  Any way you can decouple the key map from the key layout?  If you use standard codes to represent the layout, you could make generic map files that hopefully wouldn't require a recompile & firmware upload.


Thanks. Yes, the key map is, in principal, decoupled from the layout. By layout you mean the arrangement of switches on the physical keyboard matrix, and by map you mean the assignment of keys to switches--is that correct? In these terms, I am using a US QWERTY map as a reference to define which key is on which row/column on the layout. The codes in my config files are the standard USB keycodes.
Then, there are various key map transformations. To obtain, for instance, a Dvorak map, I am applying a transformation that tells how to swap keys on a US map in order to get Dvorak. The transformation is independent of the layout and can be reused for other layouts.

In the current version there is only a single map, and changing the map implies flashing the firmware. I'd like to change this and allow users to upload their own maps to EEPROM using some tool.

Quote from: mech;121481
How do you feel about listening for character sequences for switching to a certain map?


That's a very good idea. It would be a generalization of the Shift+ScrollLock combination that is used on the Space Saver for switching to numpad emulation. I should be well possible to implement this.

Quote from: mech;121481
US: QWERTY, Dvorak, Colemak, Dvorak (left handed), Dvorak (right handed), Dvorak variants?
Germany: QWERTZ, International Dvorak, Colemak?


Not sure if languages can be supported that way. When pressing, e.g., Shift+2 on a US keyboard, then the outcome is "@"; on a German keyboard it's """. On the USB protocol level, however, the keyboard simply sends the keycode for "2" plus the information that a shift key was held down, and it doesn't know that Shift+2 might be "@". Thus, the mapping of keys and modifiers is handled by the operating system.

On the other hand, there are certain country-specific USB keycodes that you could use in your map definitions (for instance, the key with "<>|" written on it, left from the Y key on German keyboards has its own code).

Quote from: mech;121481
I once had an old programmable keyboard where you could reassign buttons with a certain key sequence.  Program + key + program + other key (or something like that) would flip them and permanently store the flip.  (Too bad that keyboard was domes, and it used volatile storage that would perish with the battery.)


That would be harder. Not impossible, but probably not as easily implemented as simply exchanging whole keyboard layouts.

Quote from: mech;121481
Anyway.  Beyond certain sets of keymaps, you may be able to get clever with how you activate features.  If SL+SL rotates the layout, maybe SL+SL+left Ctrl swaps control and caps lock.  I'm just trying to think of doing this in ways that don't require firmware builds/flashes, although I guess dip switches would be fine.


OK, so you are imagining a set of commands that tell the keyboard what to do, a bit like command vs. edit mode in vim.
I really like the idea. :) The firmware takes only 3 kB of ROM space at the moment, 3.1 kB for the M4-1; that leaves about 11 kB on the ATMEGA16 for improvements... (2 kB are occupied by the boot loader)

Quote from: mech;121481
Ever use vi/vim?


Are there any other editors? ;)

Quote from: mech;121481
It would be awesome if I could easily program a "normal mode" for some of the development tools I have that would be portable between computers, because it's integrated into my keyboard!  Emacs users might like a sticky control key feature.


Ah, that would be another vim-like mode. Or an extension of the key map management mode. I fear the AVR's EEPROM size will not be large enough for all this, though; there are only 512 bytes on the ATMEGA16, so the macros would be rather limited in their length. Some external non-volatile memory or a bigger AVR might come handy here.
And Emacs users might want to give vim a try. :D *SCNR*

Quote from: mech;121481
And, um, on the DL, MMO guys might like it if macro playback could have humanizing randomization added.  As in, realistic and non-constant (but random) delays between keys in the macro sequence.


What would that be useful for? Turning the keyboard into a chat bot? Moving a game character around in an automated fashion, but pretending it is controlled by a human? (Hm, that *might* be useful! :eyebrows:)
Sorry, I haven't been into gaming for years, so maybe I don't quite get it.

The whole macro thing sounds interesting. Is there something I have missed during the last few years? :)

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #34 on: Tue, 29 September 2009, 18:08:55 »
Quote from: mech;121506
In between would be good too, but I think the idea is to do lots of custom modding, up to and including bypassing crappy controllers


Yes, in my case it's bypassing crappy PS/2 to USB converters on a crappy computer by replacing the whole PS/2 keyboard controller (which is not so crappy) by another one.
The converters I have tried so far to get my PS/2 keyboard working on one of my computers are either glitching all the time (key strokes missed or repeated), or don't work at all. And those that do work (glitchy so) need a USB hub in-between, probably because they are drawing too much current from the USB port...

I also think that the PS/2 port will disappear in the future, and I want to be prepared for that day. Buying a new keyboard is not an option. ;)

Offline cfishy

  • Posts: 60
"Open Source" Generic keyboard controller.
« Reply #35 on: Tue, 29 September 2009, 18:48:38 »
Before getting excited about programmability, I would like to remind everyone of this unfortunate case that we must avoid:

http://www.engadget.com/2009/08/04/apple-keyboard-gets-hacked-like-a-ripe-papaya-perp-caught-on-vi/

I don't have a lot of background in device programming, but I have been thinking about how to ensure the firmware doesn't get updated if somebody gains root on the computer it's hooked up to. I'm thinking, it needs some sort of hardware switch that switches it on to 'programming mode' and would not allow the use of keyboard until it's switched back to 'normal mode' again.

Because, if someone can get to the hardware, they can do a lot more real damage anyway.

We might also need a public key certification to ensure that the firmware people download from some site is not malicious.

The reason is two known problems:

1. unauthorized firmware update by compromised host computer.
2. I recall a wide spread problem with programmable Anykey boards where people forget to turn off programming mode and caused confusion. Some IT department to ban those keyboards altogether.

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #36 on: Tue, 29 September 2009, 19:12:26 »
a "program" switch, eh?

that sounds simple enough :)

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline cfishy

  • Posts: 60
Bluetooth
« Reply #37 on: Tue, 29 September 2009, 20:38:36 »
My wish list is Bluetooth.

Bluetooth HID specification is simply a wrapper of the USB specification, so it shouldn't be hard to hook up a Bluetooth chip if I knew how... Anyone got a clue how to do that?

Bluetooth keyboards are simply not feasible for small scale marketing because it needs FCC approval. (Although some Bluetooth chipsets are approved, supposedly simplify the process.)  An example is Filco's wireless keyboard simply deemed not feasible for marketing in the U.S.

When you brew your own, you don't need FCC's approval stamp and that's a major plus for me.

Offline skriefal

  • Posts: 235
  • Location: Utah, USA
"Open Source" Generic keyboard controller.
« Reply #38 on: Tue, 29 September 2009, 21:33:40 »
Quote from: Mnemonix;121474
As a result, my firmware now runs on the same hardware as the one used by RUMP and Dulcimer when built for the M.


So it's possible that I could flash your firmware onto my "Rump" controller board?  If so then I'll definitely considering testing this new firmware.

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #39 on: Tue, 29 September 2009, 21:39:26 »
innuendo alert :lol:

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline cfishy

  • Posts: 60
About N-key rollover
« Reply #40 on: Tue, 29 September 2009, 23:05:34 »
What's microcontroller to do with ghosting? I thought that's all done in the external circuitry.

By the way, I'm still reading about USB 3.0 specs... seems like it allows for bigger packet size, meaning possible N-key rollover for USB 3.0. But I'm not sure if that applies to HID.

Oh, I'm in the San Francisco Bay Area, too, perhaps we can have a keyboard geeks meetup event! show and tell.
« Last Edit: Tue, 29 September 2009, 23:09:53 by cfishy »

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #41 on: Tue, 29 September 2009, 23:36:43 »
Quote from: cfishy;121556
Before getting excited about programmability, I would like to remind everyone of this unfortunate case that we must avoid:

http://www.engadget.com/2009/08/04/apple-keyboard-gets-hacked-like-a-ripe-papaya-perp-caught-on-vi/

I don't have a lot of background in device programming, but I have been thinking about how to ensure the firmware doesn't get updated if somebody gains root on the computer it's hooked up to. I'm thinking, it needs some sort of hardware switch that switches it on to 'programming mode' and would not allow the use of keyboard until it's switched back to 'normal mode' again.

Because, if someone can get to the hardware, they can do a lot more real damage anyway.

We might also need a public key certification to ensure that the firmware people download from some site is not malicious.

The reason is two known problems:

1. unauthorized firmware update by compromised host computer.
2. I recall a wide spread problem with programmable Anykey boards where people forget to turn off programming mode and caused confusion. Some IT department to ban those keyboards altogether.


Easily handled by transferring firmware/layouts on a uSD card, as the card doesn't mount on the PC as a drive when in the keyboard, there's no way to directly affect the firmware.

Quote
My wish list is Bluetooth.

Bluetooth HID specification is simply a wrapper of the USB specification, so it shouldn't be hard to hook up a Bluetooth chip if I knew how... Anyone got a clue how to do that?

Bluetooth keyboards are simply not feasible for small scale marketing because it needs FCC approval. (Although some Bluetooth chipsets are approved, supposedly simplify the process.) An example is Filco's wireless keyboard simply deemed not feasible for marketing in the U.S.

When you brew your own, you don't need FCC's approval stamp and that's a major plus for me.

TI makes the CC2510 family of bluetooth controllers, the problem is, unless its a self contained module (with a fully integrated RF deck, antenna, etc) you still need FCC approval.  You can skirt around the FCC a little bit by not explicitly including Bluetooth functionality, rather making it easy for the (skilled) end user to hack it in later.

Offline Specter_57

  • Posts: 143
Some thoughts.....
« Reply #42 on: Wed, 30 September 2009, 00:02:22 »
Hello readers.....

As I have a couple-three of the IBM 122-key terminal 'M' type keyboards, I have thought of this sort of thing for some time now...and here on GH there are many threads that may/would be of use and informative in relation to this project idea.

And, no surprise...it would seem the hardware part of this thing would be rather simple to implement...but the microcontroller programming part is where the difficulty will come in.  Me...I'm still on the bottom end of the learning curve when it comes to these devices   :-(

......

I was looking at this device for a short time...but didn't like the overall cost involved in shipping, etc...although it likely would fulfill the requirements of the project as discussed here in this thread.

Take a look-see here:

Sprintek keyboard controller - SK 5100/5101

http://www.sprintek.com/products/SK5100.aspx

......

Another possibility, perhaps...is to use an 89c51/2/3 or 89s51/2/3 series microcontroller (32 I/O pins, 40 pin DIP) *with* an 89c2051/2/3 or the 89s2051/2/3 series microcontroller ( 15 I/O pins, 20 pin DIP) ;  by that I mean use two devices, serially connected...and share some functions between them ...these are standard PDIP devices, which would allow for easier breadboarding of the circuitry...and these devices are very inexpensive...a search at Avnet Express will show the 89c2051 at under one dollar US and the 89c51, in some versions under $3.00 US.

And other microcontrollers have been mentioned and are feasible.

......

And also...do not forget or overlook the Keyboard Babel projects.

See here:

http://www.kbdbabel.org/

......

anyway...enough mumbling for now.     :-)

Spec57

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #43 on: Wed, 30 September 2009, 02:25:56 »
Quote from: msiegel;121542
welcome Mnemonix! we will surely appreciate any experience or code you want to share


Thanks. I'll share all the code soon, need to clean up and pull straight a few things first.

Quote from: cfishy;121556
Before getting excited about programmability, I would like to remind everyone of this unfortunate case that we must avoid:

http://www.engadget.com/2009/08/04/apple-keyboard-gets-hacked-like-a-ripe-papaya-perp-caught-on-vi/


Agreed. The keyboard should not listen to programming requests all the time. Programming must involve explicit user intervention, and normal operation must not be allowed in programming mode so that the user cannot leave on the programming mode by accident.
I have implemented this by requiring the user to hold down a certain key while plugging in the USB cable.

Signing the firmware is definitely a good idea since a bogus firmware might still contain malicious code.

Quote from: skriefal;121579
So it's possible that I could flash your firmware onto my "Rump" controller board?  If so then I'll definitely considering testing this new firmware.


Yes, this will work. For the RUMP platform, my Keyboard Upgrade is just an alternative firmware. You will also get the LEDs working then (just needs three more resistors).

Quote from: cfishy;121588
What's microcontroller to do with ghosting? I thought that's all done in the external circuitry.


I am referring to an effect described here. It can be circumvented by adding diodes to the keyboard matrix, but that's hard.
So, alternatively, the firmware needs to detect constellations where ghosting may have occurred, and ignore those; otherwise, e.g., hitting the keys A, S, and X simultaneously on a Model M would result in a Z being registered, too. If you have a keyboard that avoids ghost keys in hardware already, then there is, of course, no need for preventing them in software.

Quote from: Specter_57;121593
As I have a couple-three of the IBM 122-key terminal 'M' type keyboards, I have thought of this sort of thing for some time now...


Hm, not sure how hard it would be to open this kind of keyboard for getting to see the matrix, but could try to find out its layout? How many columns and rows are there, which keys are attached to them? Maybe Google knows...
Maybe it's just an enhanced version of the 16x8 matrix as used on the 1391401. Supporting the terminal keyboards would be trivial then.

Offline JBert

  • Posts: 764
"Open Source" Generic keyboard controller.
« Reply #44 on: Wed, 30 September 2009, 02:27:52 »
Quote from: Mnemonix;121474
The hardware is based on the Atmel AVR ATMEGA16 or ATMEGA32 microcontroller (most probably, some other AVRs would be possible, too).
So I guess you want to use the V-USB firmware platform to run things on?
What about Atmel's USB-supported chips? Do these cost more, do these have real hardware support for USB and could they work better?

I haven't figured out the differences. Just asking if you had more information by chance.

Quote from: cfishy;121556
I don't have a lot of background in device programming, but I have been thinking about how to ensure the firmware doesn't get updated if somebody gains root on the computer it's hooked up to. I'm thinking, it needs some sort of hardware switch that switches it on to 'programming mode' and would not allow the use of keyboard until it's switched back to 'normal mode' again.
This is probably the safest way. Most µC boot loaders already do this, for examples see the AIKON and Teensy boards.

Quote from: cfishy;121556
We might also need a public key certification to ensure that the firmware people download from some site is not malicious.
I don't know whether public key certificates are really needed. After all, always check everything you download from the Internet. Even drivers might be infected, so you have to make sure you trust the web page you got it from.
PKC is only good to add "GeekHack approved" stamps.

Quote from: cfishy;121588
What's microcontroller to do with ghosting? I thought that's all done in the external circuitry.
That's not entirely right: the key matrix causes ghosting due to a "short circuit". Adding diodes resolves it.

If you do have a key matrix without diodes, you probably want the controller to detect ghosting and stop it from happening by blocking those keys.

Quote from: cfishy;121588
By the way, I'm still reading about USB 3.0 specs... seems like it allows for bigger packet size, meaning possible N-key rollover for USB 3.0. But I'm not sure if that applies to HID.

Oh, I'm in the San Francisco Bay Area, too, perhaps we can have a keyboard geeks meetup event! show and tell.
USB HID already has arbitrary packet sizes because the device tells the USB host what kind of packets it sends.

It's mainly the legacy "boot mode" which states that keyboards should use a fixed packet size when in this mode. This allows a BIOS routine to talk to a keyboard without needing to parse the packet descriptor, it can just extract the key presses from the packet because the values are always at the same locations. When not in this mode (i.e. "normal mode"), it should be possible to send more keys.

Your keyboard drivers still need to support larger packets though.
On top of that, Microsoft once recommended that all keyboards should use the legacy protocol both in boot and in normal mode because there were some computers out there where the BIOS wouldn't issue the "switch protocol" command. Those BIOSen couldn't use a keyboard which sends an altered descriptor, hence the need to push everyone in using the legacy protocol at any time.

Keyboard makers still seem to follow this guideline as if it were a rule. I don't know whether things have changed since then, but this guideline may actually be outdated.
AFAIK, Linux and BSD keyboard drivers should support more than those 6 keys. If the Das got those 12 KRO, check if it uses the default drivers or a custom one.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline cfishy

  • Posts: 60
"Open Source" Generic keyboard controller.
« Reply #45 on: Wed, 30 September 2009, 03:51:22 »
JBert,

From what I gathered, one problem with V-USB is that it hasn't been successfully ported to Arduino dev env and the like, meaning it requires a programmer. It's also picky about clock speed. Otherwise, I think it would work just fine, and cheap.

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #46 on: Wed, 30 September 2009, 04:30:08 »
Quote from: JBert;121606
So I guess you want to use the V-USB firmware platform to run things on?
What about Atmel's USB-supported chips? Do these cost more, do these have real hardware support for USB and could they work better?

I haven't figured out the differences. Just asking if you had more information by chance.


This is exactly what I am doing. V-USB is quite nice--GPL for non-commercial applications, easy to use, and a reasonable memory footprint.

I haven't checked out the USB-enabled chips either. I think they are all SMD, so they are a bit harder to work with than DIL-40 chips. I guess they are also more expensive, but it might still be worth taking a closer look at them. Getting rid of V-USB would also mean that the design could go commercial without paying licensing fees.

Quote from: cfishy;121614
From what I gathered, one problem with V-USB is that it hasn't been successfully ported to Arduino dev env and the like, meaning it requires a programmer. It's also picky about clock speed. Otherwise, I think it would work just fine, and cheap.


Don't know about Arduino, but I can tell that V-USB requires 12 MHz or more. I had no problems at 12 MHz so far, but the same setup that worked at 12 MHz failed when going to 16 MHz (just noise on the I/O ports)--after recompiling and reprogramming, of course. I didn't investigate this issue any further, though.

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #47 on: Fri, 02 October 2009, 03:51:48 »
I think we need a subforum to organize this project.

We could then proceed to split this thread into several new ones. Like

  • Wishlist
  • µController Overview
  • Hardware: Draft
  • Hardware: Development
  • Software: Draft
  • Software: µController Code
  • Software: Host/SDK
  • Related Projects


We also need a team member with mod powers to be able to split/merge threads and maybe move posts.

Miniguru thread at GH // The Apple M0110 Today

Offline InSanCen

  • Posts: 560
"Open Source" Generic keyboard controller.
« Reply #48 on: Fri, 02 October 2009, 15:39:00 »
I have some electronics knowledge, limited programming ability (Unless we're gonna control this with a Z80!), but I am willing to contribute whatever I can.
Currently Using :- IBM M13 1996, Black :
Currently Own :- 1391406 1989 & 1990 : AT Model F 1985 : Boscom 122 (Black) : G80-3000 : G80-1800 (x2) : Wang 724 : G81-8000LPBGB (Card Reader, MY) : Unitek : AT102W : TVS Gold :
Project\'s :- Wang 724 Pink-->White Clicky : USB Model M : IBM LPFK :
Pointing stuff :- Logitech MX-518 : I-One Lynx R-15 Trackball : M13 Nipple : Microsoft Basic Optical\'s
:

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #49 on: Sat, 03 October 2009, 01:05:22 »
Just need a name, and I can set up a site for the project.

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #50 on: Sat, 03 October 2009, 01:08:51 »
Geekey?

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline wellington1869

  • Posts: 2885
"Open Source" Generic keyboard controller.
« Reply #51 on: Sat, 03 October 2009, 01:10:05 »
Quote from: msiegel;122515
Geekey?


i like it ;)

"Blah blah blah grade school blah blah blah IBM PS/2s blah blah blah I like Model Ms." -- Kishy

using: ms 7000/Das 3

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #52 on: Sat, 03 October 2009, 04:47:17 »
MOAC - Mother Of All Controllers

LOL, not seriously.

Miniguru thread at GH // The Apple M0110 Today

Offline abio

  • Posts: 9
"Open Source" Generic keyboard controller.
« Reply #53 on: Sat, 03 October 2009, 14:06:37 »
Quote from: msiegel;122515
Geekey?


We have a winner, gentlemen.

Offline Xuan

  • Posts: 189
"Open Source" Generic keyboard controller.
« Reply #54 on: Sat, 03 October 2009, 16:47:34 »
I've been wanting to participate in a project like this, but I hadn't the time to propose it.
So I'd like to contribute here.

My name proposal; Jack (just another custom keyboard).

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #55 on: Sat, 03 October 2009, 16:51:34 »
welcome Xuan :)

what happened to your Lexmark?

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline Xuan

  • Posts: 189
"Open Source" Generic keyboard controller.
« Reply #56 on: Sat, 03 October 2009, 22:03:08 »
Someone spill don't know what on it. The channels where not sufficient to stop the liquid to get into the membrane. I still have to get the tool to disassemble and clean it.
For now I'm happy with the older M.

Thanks for asking ;)

Offline JBert

  • Posts: 764
"Open Source" Generic keyboard controller.
« Reply #57 on: Sun, 04 October 2009, 08:38:34 »
Quote from: talis;122514
Just need a name, and I can set up a site for the project.
I had "Rubicon" in mind.

Quote from: msiegel;122515
Geekey?
Oh dear, that sounds interesting as well.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline Shawn Stanford

  • Posts: 368
"Open Source" Generic keyboard controller.
« Reply #58 on: Sun, 04 October 2009, 08:52:53 »
Rosetta?
The Brat Prince of COBOL

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #59 on: Mon, 05 October 2009, 21:33:27 »
The Teensy miniature AVR development board is now available through Adafruit for $20.



http://www.adafruit.com/index.php?main_page=product_info&cPath=16&products_id=199

"[...] a complete USB-based microcontoller development system. Only a standard Mini-B USB cable (sold separately) is needed to connect to a PC or Macintosh"
« Last Edit: Mon, 05 October 2009, 21:37:45 by msiegel »

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #60 on: Mon, 05 October 2009, 23:17:17 »
The source code for my keyboard controller firmware is available now:
http://github.com/rhomann/kbupgrade.

I also tried to upload a tarball to Github, but it didn't work for some reason. Therefore, you'll need to have Autoconf and Automake installed on your system to build the firmware.

There are still some things to do--for instance, it is not easy to select alternative key maps right now (but it is possible); only avr-gcc is supported for building the firmware images; and a bit more documentation would also be nice to have...
I will keep on working on this one whenever I can find some spare time, so the rough edges will hopefully disappear in the future.
If you would like to contribute anything to this project, then you are, of course, very welcome to do so! Any suggestions are welcome, too.

Also, if the general plan is to make another, more generic keyboard controller, then this one could still serve as a start. All code is GPL, so take (and give back) whatever you want! :)

PS: I am typing this on my freshly modified, still open M4-1 on USB. :)  Messy stripboard, LEDs not attached yet, but works great otherwise.


Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #61 on: Mon, 05 October 2009, 23:23:08 »
Quote from: Mnemonix;123328
The source code for my keyboard controller firmware is available now:

If you would like to contribute anything to this project, then you are, of course, very welcome to do so!


thank you, and congratulations! what a cute little keyboard :D :D

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline wellington1869

  • Posts: 2885
"Open Source" Generic keyboard controller.
« Reply #62 on: Tue, 06 October 2009, 00:44:12 »
Quote from: msiegel;123299
The Teensy miniature AVR development board is now available through Adafruit for $20.

Show Image


http://www.adafruit.com/index.php?main_page=product_info&cPath=16&products_id=199

"[...] a complete USB-based microcontoller development system. Only a standard Mini-B USB cable (sold separately) is needed to connect to a PC or Macintosh"


if i were retired i would get this in a heartbeat and then spend three months getting it to control my xmas lighting. It looks like such a fun and useful thing to have in the house, and so cheap too.

"Blah blah blah grade school blah blah blah IBM PS/2s blah blah blah I like Model Ms." -- Kishy

using: ms 7000/Das 3

Offline JBert

  • Posts: 764
"Open Source" Generic keyboard controller.
« Reply #63 on: Tue, 06 October 2009, 01:50:05 »
Quote from: msiegel;123299
The Teensy miniature AVR development board is now available through Adafruit for $20.

http://adafruit.com/images/medium/teensyparts_MED.jpg

http://www.adafruit.com/index.php?main_page=product_info&cPath=16&products_id=199

"[...] a complete USB-based microcontoller development system. Only a standard Mini-B USB cable (sold separately) is needed to connect to a PC or Macintosh"
Too bad the Teensy++ isn't available from there... But the Teensy is at least a start.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #64 on: Tue, 06 October 2009, 06:45:38 »
Quote from: msiegel;123299
The Teensy miniature AVR development board is now available through Adafruit for $20.

Hey, these are sweet! More expensive than doing it yourself, but definitely worth them given the work that you can save. Only I would prefer a full-size B-type USB connecter on a keyboard because of mechanical stability, but maybe that's just me.

From what I can see, an initial port of my code to Teensy would be trivial to do as it is an ATMEGA32 with USB--or at least I assume that the ATMEGA32U4 is not much different from a ATMEGA32...
For a full port, the glue code for USB would need to be rewritten to replace V-USB by native USB support. The Teensy does, however, offer only 25 I/O pins. That's enough, e.g., for a 16x8 keyboard matrix, but add LEDs and config jumpers, and you are running out of I/O pins. On the other hand, shift registers could be used to reclaim some the the pins.

Does anyone know if the AT90USB646 as used on the Teensy++ is similar to the ATMEGA controllers? Or is it very different?

Offline JBert

  • Posts: 764
"Open Source" Generic keyboard controller.
« Reply #65 on: Tue, 06 October 2009, 07:28:47 »
Quote from: Mnemonix;123378
Hey, these are sweet! More expensive than doing it yourself, but definitely worth them given the work that you can save. Only I would prefer a full-size B-type USB connecter on a keyboard because of mechanical stability, but maybe that's just me.

From what I can see, an initial port of my code to Teensy would be trivial to do as it is an ATMEGA32 with USB--or at least I assume that the ATMEGA32U4 is not much different from a ATMEGA32...
For a full port, the glue code for USB would need to be rewritten to replace V-USB by native USB support. The Teensy does, however, offer only 25 I/O pins. That's enough, e.g., for a 16x8 keyboard matrix, but add LEDs and config jumpers, and you are running out of I/O pins. On the other hand, shift registers could be used to reclaim some the the pins.

Does anyone know if the AT90USB646 as used on the Teensy++ is similar to the ATMEGA controllers? Or is it very different?
The ATmega32U4 indeed runs Atmel's own USB stack and should have hardware support for USB. You could still use V-USB if you wanted do (although it would be a waste of the chip and even pointless on the Teensy). Another interesting thing is that this chip readily handles the voltages needed for USB, whereas general-purpose AVR chips need external circuitry.

To answer your question about differences in the Teensy and Teensy++: both the AT90USB646 and the ATmega32U4 are AVR mcu's with USB support. They should only differ in the amount of RAM, Flash memory and EEPROM. Heck, the same binary code may even be installed on both of them, given the register locations remain the same.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #66 on: Tue, 06 October 2009, 08:17:24 »
If a chip provides built-in usb support: will it be possibe to run a ps/2 protocol over the usb lines? It would be great if ps/2 support could be added for passive adapters.

As for the project name: "HIDMAN" ;-)

I like Geekey too. Talis should get the .org domain. It's fun thinking of names and playing with acronyms though. I'd like something like MOCCA, COFFEE or COCOA but couldn't find a clever acronym explanation yet.
« Last Edit: Tue, 06 October 2009, 08:21:35 by lowpoly »

Miniguru thread at GH // The Apple M0110 Today

Offline JBert

  • Posts: 764
"Open Source" Generic keyboard controller.
« Reply #67 on: Tue, 06 October 2009, 08:30:56 »
Good question. It seems that some of Atmel's microcontrollers support this, e.g. the AT90USB82 or AT90USB162 controllers. The Teensy doesn't use one of them though...

You could mod the Teensy board to have an extra port on the keyboard side (like IBM's SDL plug) which still means you'd have to make your own PS/2 implementation.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #68 on: Tue, 06 October 2009, 10:02:57 »
Quote from: lowpoly;123389
If a chip provides built-in usb support: will it be possibe to run a ps/2 protocol over the usb lines? It would be great if ps/2 support could be added for passive adapters.

The Cypress chips seem to have these capabilities out of the box.  Tho I'm not sure they are the best overall choice.

I think rather then trying to shoehorn a dev board into the project, its best to just build from the ground up.  Again the idea is to choose a family that will have mass overkill on the high end, but a pin compatible smaller/low cost version that makes it possible to commercialize.

Quote
You could mod the Teensy board to have an extra port on the keyboard side (like IBM's SDL plug) which still means you'd have to make your own PS/2 implementation.

A PS/2 implementation would be fairly trivial, as you can easily just bit bang if needed (there's not really anything special about it).

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #69 on: Tue, 06 October 2009, 12:22:22 »
Quote from: talis;123400
I think rather then trying to shoehorn a dev board into the project, its best to just build from the ground up.


well, as long as there's still a cheap dev board :)

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #70 on: Tue, 06 October 2009, 14:59:06 »
Quote from: JBert;123382
You could still use V-USB if you wanted do (although it would be a waste of the chip and even pointless on the Teensy).


Exactly. V-USB would be quite useless on that platform, which is a good thing.

Quote from: talis;123400
I think rather then trying to shoehorn a dev board into the project, its best to just build from the ground up.


OK. But wouldn't the final controller be an amalgamation of some devboard + connectors + maybe a few extra components anyway? The final PCB should, of course, not look like that, but be a streamlined, compact product. For a quick start and to see what's needed, however, a cheap devboard like Teensy(++) seems very appealing to me. OTOH, I also don't have a lot of experience in hardware development... :wink:

Independent of the concrete platform, I wonder how to solve a problem that I ran into, though: Virtually every keyboard model seems to use its own connectors for the flat cables running from the PCB to the keyboard matrix and the LEDs. There's a wide variaty of connectors, and I've learned that those FFCs are especially hard to obtain for private projects (need to buy lots of 1000, won't sell to private persons, etc.).
And--apart from the problem how to get at the FFCs--how are keyboards going to be connected to the controller?

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #71 on: Tue, 06 October 2009, 16:16:57 »
Quote from: Mnemonix;123484
Exactly. V-USB would be quite useless on that platform, which is a good thing.



OK. But wouldn't the final controller be an amalgamation of some devboard + connectors + maybe a few extra components anyway? The final PCB should, of course, not look like that, but be a streamlined, compact product. For a quick start and to see what's needed, however, a cheap devboard like Teensy(++) seems very appealing to me. OTOH, I also don't have a lot of experience in hardware development... :wink:

Independent of the concrete platform, I wonder how to solve a problem that I ran into, though: Virtually every keyboard model seems to use its own connectors for the flat cables running from the PCB to the keyboard matrix and the LEDs. There's a wide variaty of connectors, and I've learned that those FFCs are especially hard to obtain for private projects (need to buy lots of 1000, won't sell to private persons, etc.).
And--apart from the problem how to get at the FFCs--how are keyboards going to be connected to the controller?


The problem with most of the dev boards are they are missing some pretty critical components for such a project (most notably pull up/down resistors) that would need to be placed on a daughter card the dev board would plug in to (or flywired, which would end up in a mess).  At that point its much easier to just do a custom board from the ground up (none of these uC run at frequencies where you really need to worry too much about the board).  After that, it will have a standardized interface, and I invision people creating adapter boards for the standard keyboards (eg model M, Filco, Cherry, etc) as these tend to also have a fairly standard interface to the controller.  For those who aren't hardware inclined, its then a matter of plugging together controller + adapter + existing keyboard matrix => new programmable keyboard, for those who don't mind fly wiring, or hardware design you can get away with just controller + keyboard matrix

Connectors aren't as hard to source, if you have the right contacts (MOQ's only matter when you aren't asking for Engineering samples).  And in the worst case, you can remove a connector from the old controller and use it with the adapter.
« Last Edit: Tue, 06 October 2009, 16:19:37 by talis »

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #72 on: Tue, 06 October 2009, 16:27:20 »
don't avrs have built-in pull-up resistors on the i/o pins?

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #73 on: Tue, 06 October 2009, 16:32:58 »
Most micro's have some form of weak pullup on some port pins.  Tho these tend to be quite high value (and thereby quite susceptible to induced noise when you have long traces as on a keyboard PCB).  This is also just one example of what may or may not be missing (think LED drivers, PS/2 + USB capabilities with required hardware, external flash rom (if needed)) etc.

I guess the point I'm trying to make in an attempt to steer away from using a dev board over custom is, there's no real reason to constrain the design this early to get a working prototype slightly faster.  It's possible that ultimately an AVR chip will turn out to be the best, I'd just rather not choose it just because there is a dev board available, and remove that as a degree of freedom when working out requirements.
« Last Edit: Tue, 06 October 2009, 16:37:57 by talis »

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #74 on: Tue, 06 October 2009, 16:44:14 »
it sounds like we need a list of candidate microcontrollers :)

although this won't stop the software guys: the architecture and algorithms can be developed and tested while hardware is being worked out.

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #75 on: Tue, 06 October 2009, 17:05:27 »
Quote from: msiegel;123518
don't avrs have built-in pull-up resistors on the i/o pins?


Yes, they do. No problem with AVRs then.

Quote from: talis;123522
Most micro's have some form of weak pullup on some port pins.  Tho these tend to be quite high value (and thereby quite susceptible to induced noise when you have long traces as on a keyboard PCB).


Or is there a problem? Yes, the pull-ups are quite high value and AFAIR their values are specified in a rather broad range in the data sheet (20k-50k or so?). I didn't notice any glitches so far, however. Maybe my environment just isn't noisy enough, or the noise is being filtered out by the debouncing algorithm.

Quote from: talis;123515
After that, it will have a standardized interface, and I invision people creating adapter boards for the standard keyboards (eg model M, Filco, Cherry, etc) as these tend to also have a fairly standard interface to the controller.


So, in a sense, the controller takes the role of a devboard, and the adapter is used to connect it to the keyboard.
The interface would have to be designed for the "worst case" scenario then, i.e., five pins for the LEDs supported by USB (or just the three common ones), x keyboard columns and y rows, where  x >= 9 and y >= 19 (my current worst case). If trackpoints and trackballs are to be supported, then pins for at least 3 mouse buttons and the mouse axes would be required, too.

And, I agree, just because there are development boards available for some specific MCU should not be the reason for choosing it. But I don't have an overview over the MCU market, so I cannot give any recommendations here.

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #76 on: Tue, 06 October 2009, 17:32:09 »
Quote
it sounds like we need a list of candidate microcontrollers :)

although this won't stop the software guys: the architecture and algorithms can be developed and tested while hardware is being worked out.

I say we just slap an 8 core Parallax Propeller in there and call it good =P.

Really the thing that should drive the selection of MCU are :

- Ability to meet the requirements (which need to first be gathered fully).
- Availability of development tools (programmer, debugger, compiler).
- Room for growth (it meets the requirements now, but how much more room is there?).
- Smaller/Larger versions in the same family for lower cost commercialization / room to move if the project runs out of space.
- I/O space for those big mod projects (backlit keyboards, fancy Cylon blinking light chasers, specialized interfaces).

Quote
And, I agree, just because there are development boards available for some specific MCU should not be the reason for choosing it. But I don't have an overview over the MCU market, so I cannot give any recommendations here.

The big ones to look at are :

- Microchip : 24HJ/18F
- Atmel : Fairly large range
- Parallax : Propeller
- Freescale : Coldfire
- Cyprus : Lots of semi specific keyboard uCs.
- TI : MSP430
« Last Edit: Tue, 06 October 2009, 17:41:49 by talis »

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #77 on: Tue, 06 October 2009, 17:39:23 »
Quote from: talis;123539
I say we just slap an 8 core Parallax Propeller in there and call it good =P.

XD thanks, i feel less crazy now for having thought that

edit: if most/all of the candidates can be programmed in C, then moving between platforms would be a *lot* easier

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #78 on: Tue, 06 October 2009, 17:50:39 »
Quote from: msiegel;123541
XD thanks, i feel less crazy now for having thought that

I've actually strongly considered this more for the potential ability to run multiple, parallel USB stacks, and a single USB hub stack to overcome the 6+modifier key limit on USB.  The big problem seems to be more with the development tools, and language support.

Quote

edit: if most/all of the candidates can be programmed in C, then moving between platforms would be a *lot* easier


I think a free/open source C compiler is a must no matter what platform is chosen. Once the boot loader is in place (which requires some sort of programmer) the end user should be able to write, compile, and upload code to the controller without the need of any specialized tools.

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #79 on: Tue, 06 October 2009, 18:24:25 »
plus, a propeller could make the keyboard into a video terminal emulator XD
it'll be deja vu all over again

btw, i don't know about you guys, but ever since mnemonix published his controller software as open source, i'm itching to order an avr development board :p

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #80 on: Wed, 07 October 2009, 17:35:55 »
Quote from: talis;123539
I say we just slap an 8 core Parallax Propeller in there and call it good =P.


Ugh! :)  Sounds like overkill for a mere keyboard controller.

But for me the most important of all aspects is that development must be possible using solely open source tools. I would not buy and install Windows for running some proprietary compiler or crappy IDE, especially not for a fun project (= no payment). Even if nobody would have to pay for Windows and the development tools, the whole project would still not be free really because it would depend on closed-source tools and on at least two companies (MS, who make terrible operating systems, and the MCU company, who could cripple the devtools anytime for sqeezing some $$$). This might be acceptable for commercial use, but certainly not for an open source project.

Therefore, I think we should rule out any platform for which there is no open source toolchain, even if the hardware is a perfect match. I also think it must be possible to program in C; I don't have a problem with assembler languages, but C is waaaay easier and still fast.

That said, I googled a bit... ;)

Quote from: talis;123539

- Parallax : Propeller
- Cyprus : Lots of semi specific keyboard uCs.


Seems like there are no free C compilers for these, neither gcc nor llvm--at least during my quick search nothing interesting showed up (BTW, did you mean to write "Cypress"?).

Quote from: talis;123539

- Microchip : 24HJ/18F
- Atmel : Fairly large range
- Freescale : Coldfire
- TI : MSP430


There is at least some kind of gcc support for all of these. There is even an llvm backend for Atmels.
Maybe someone here could comment on how well the gcc versions perform on the various platforms? (I know the one for Atmel chips works quite well :wink:.)

Quote from: msiegel;123551
btw, i don't know about you guys, but ever since mnemonix published his controller software as open source, i'm itching to order an avr development board :p


Oh, and that's nice to hear (read)! :)

Offline cfishy

  • Posts: 60
"Open Source" Generic keyboard controller.
« Reply #81 on: Wed, 07 October 2009, 18:14:19 »
Mnemonix,

Awesome. I wanna see how you wire the board (I'm really a newbie hobbyist when it comes to electronics stuff) Can you show me a picture of the flip side?

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #82 on: Wed, 07 October 2009, 18:44:28 »
likewise...

the mysteriously strong-enough weak pullup resistors are still in the back of my mind :)

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #83 on: Wed, 07 October 2009, 18:47:14 »
Quote
But for me the most important of all aspects is that development must be possible using solely open source tools. I would not buy and install Windows for running some proprietary compiler or crappy IDE, especially not for a fun project (= no payment). Even if nobody would have to pay for Windows and the development tools, the whole project would still not be free really because it would depend on closed-source tools and on at least two companies (MS, who make terrible operating systems, and the MCU company, who could cripple the devtools anytime for sqeezing some $$$). This might be acceptable for commercial use, but certainly not for an open source project.

Therefore, I think we should rule out any platform for which there is no open source toolchain, even if the hardware is a perfect match. I also think it must be possible to program in C; I don't have a problem with assembler languages, but C is waaaay easier and still fast.

I've heard that somewhere before...

Quote from: talis;123545
I think a free/open source C compiler is a must no matter what platform is chosen. Once the boot loader is in place (which requires some sort of programmer) the end user should be able to write, compile, and upload code to the controller without the need of any specialized tools.


Reference to the Propeller was meant as a joke (hence the =p), its a very immature design, and will likely be fought with issues for a few years yet.  You know its best to steer clear of a device when the silicon arrives months before the supporting documentation, or even the basic specs or tolerances.


Quote
There is at least some kind of gcc support for all of these. There is even an llvm backend for Atmels.
Maybe someone here could comment on how well the gcc versions perform on the various platforms? (I know the one for Atmel chips works quite well .)

Gcc support for the MSP430, Atmel is pretty mature, the coldfire versions were ok last time I used them, and the PIC24 series support was poor at best (even the commercial compilers were pretty new and buggy last time I used them about a year ago).  The 8 bit PIC (12F/16F families) have much better support, but are somewhat lacking in the system resources department.
« Last Edit: Wed, 07 October 2009, 18:50:12 by talis »

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #84 on: Wed, 07 October 2009, 18:49:44 »
i vote in favor of mature tools. the last time i used immature ones, my entire neighborhood could hear me cursing ;(

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #85 on: Wed, 07 October 2009, 18:55:05 »
Quote from: msiegel;123788
likewise...

the mysteriously strong-enough weak pullup resistors are still in the back of my mind :)

The pull-up (down) resistors were just an example of limitations that you impose using a raw dev board.  The design, layout, and production of a custom PCB is pretty trivial these days at the types of frequencies these uCs run at.   The cost of small run, rapid prototypes is quite low (think <$30 for a 5"x10" board, cheaper in greater then 1-2 quantities, and paneling the design should get the per-board cost down to $10-$15 per even with very small orders).
« Last Edit: Wed, 07 October 2009, 18:57:39 by talis »

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #86 on: Wed, 07 October 2009, 18:57:45 »
Quote from: talis;123793
<$30 for a 5"x10" board

not bad :) is that one layer or two?


edit: hey, you got a domain! grrreat :D

edit 2: looks good in there, as if it's ready to receive some content :)
« Last Edit: Wed, 07 October 2009, 19:05:05 by msiegel »

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #87 on: Wed, 07 October 2009, 19:39:08 »
Quote from: msiegel;123795
not bad :) is that one layer or two?


Two, with one side silk screen, and solder mask both sides.

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #88 on: Wed, 07 October 2009, 20:01:33 »
Quote from: cfishy;123777
Awesome. I wanna see how you wire the board (I'm really a newbie hobbyist when it comes to electronics stuff) Can you show me a picture of the flip side?


Hm, not now since the keyboard is in my office right now (I guess you refer to the M4-1?). It works on a SunRay, too. :)

Somewhere I have a picture of the empty stripboard with the cuts applied already. I'll color it a bit, add a few labels, and post it here. I really should have taken more pictures... I think I can shoot some tomorrow.
In the meantime, I can show these to you, taken shortly after I had assembled the board and put it into its place (but forgot the plastic foil underneath... :doh:):



The green one is the original PCB. Mine doesn't look so well with all these cables. ;)
A PDF of the circuit diagram is in my Git repository, by the way. No pull-ups, just some diodes to protect the shift registers from themselves. You don't need Git to view the PDF, just go to http://github.com/rhomann/kbupgrade, browse to /circuits/IBM_M4-1/, and download the (misnamed) pcb.pdf.

And here is a temporary setup with a 0.5m USB cable going straight into the monitor in my home office:


Offline Xuan

  • Posts: 189
"Open Source" Generic keyboard controller.
« Reply #89 on: Wed, 07 October 2009, 22:06:01 »
Quote from: talis;123790
Gcc support for the MSP430, Atmel is pretty mature, the coldfire versions were ok last time I used them, and the PIC24 series support was poor at best (even the commercial compilers were pretty new and buggy last time I used them about a year ago).  The 8 bit PIC (12F/16F families) have much better support, but are somewhat lacking in the system resources department.


Pics are very cheap and easy to find I believe, that's a good thing, but Atmels are very common to, right? And if they also have good gcc support, I'd say they seem to be nice candidates.

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #90 on: Wed, 07 October 2009, 22:15:11 »
Quote from: Xuan;123811
Pics are very cheap and easy to find I believe, that's a good thing, but Atmels are very common to, right? And if they also have good gcc support, I'd say they seem to be nice candidates.

They are all pretty easy to get, and all around the same price per chip (<$15).  Digikey is a excellent resource for all of them.

The goal is to first gather the community requirements, then from there choose which uC best fits those requirements (see link below).  In that way the requirements (including things like tool availability, platform, cost etc) will drive the decision.
« Last Edit: Wed, 07 October 2009, 22:24:03 by talis »

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #91 on: Thu, 08 October 2009, 11:24:54 »
I'm not sure if this is really going to be useful, but for your entertainment, here are the pictures.
If you know of a good method for drawing this kind of circuitry with a computer program, please let me know (I designed this one with pencil and paper...).

As you can see, I had to use two pieces of stripboard because I didn't have one that was wide enough. I also made some stupid mistakes, like drilling one of the holes next to the USB connector at the wrong position at first, drilling the hole underneath one of the 74164 after soldering it in (duh), putting components into the wrong places... :mmph:
A real PCB would have been a lot easier to solder on. If someone of you would like to design one, then please don't hesitate to permute the assignment of I/O pins to row or column connectors if it helps. It is trivial to permute them back later (as long as you permute within rows/columns).

On this first picture, blueish means: drill or file here. Red means: cut traces here.
The spare area reserved for jumpers (or maybe rather DIP switches) is located where there is a hole in the back of the case now.



Here is the board complete with all components as it is in use now. The red dots mean that you need to connect two neighboring traces there.



And here is the top view. You can see I used an ATMEGA16 clocked at 12 MHz, two 8-bit serial-in parallel-out shift registers to drive the keyboard matrix rows, and a lot of wires...
Surprisingly, I managed to put the connectors for the keyboard matrix and LEDs into the same locations as they are in on the original board. :)


Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #92 on: Thu, 08 October 2009, 11:38:16 »
that's excellent! you're getting this project off to a great start :D

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline AndrewZorn

  • Posts: 1086
"Open Source" Generic keyboard controller.
« Reply #93 on: Thu, 08 October 2009, 11:40:38 »
i backtracked a couple pages
but you are saying that right now this WORKS???

EDIT i used to use some KDE-based diagram software that i really liked, if you happen to be on linux

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #94 on: Thu, 08 October 2009, 11:42:05 »
Quote from: AndrewZorn;123882
i backtracked a couple pages
but you are saying that right now this WORKS???


Yes sir, seems unbelievable, but it does! :)

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #95 on: Thu, 08 October 2009, 11:43:46 »
that's what's so cool about this project, Mnemonix already has a working prototype! :D

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #96 on: Thu, 08 October 2009, 11:56:37 »
Quote from: AndrewZorn;123882
EDIT i used to use some KDE-based diagram software that i really liked, if you happen to be on linux


Yes, I'm on Linux. Do you refer to KiCad? Looks like Eagle, but feels worse. ;)
I used KiCad to draw the circuit diagram, and it also has a PCB designing component. I didn't use it, however. Is it easy to make stripboard designs with it?

Offline AndrewZorn

  • Posts: 1086
"Open Source" Generic keyboard controller.
« Reply #97 on: Thu, 08 October 2009, 12:10:02 »
nah thats not it
i have no idea what it was called
i guess i realize now how useless all the 'information' has been

and yeah i do think this is pretty amazing, it went from idea to something that works pretty fast, makes me wonder if i will ever have a hardware colemak keyboard just to have
« Last Edit: Thu, 08 October 2009, 12:15:18 by AndrewZorn »

Offline InSanCen

  • Posts: 560
"Open Source" Generic keyboard controller.
« Reply #98 on: Sat, 10 October 2009, 01:41:23 »
Mnemonix

If you care to post the schematic, I can get that into a colour-shaded form (Colour blocks for pin groupings etc), pretty quickly. Probably into a downloadable PCB layout as well (I work for an electronics Retailer... handy sometimes!)

I do have an older copy of Eagle somewhere, but I am using Win7 (If there is a *nix binary, I don't have it), so not sure if it works.  But I'll dig it out and see what happens.
Currently Using :- IBM M13 1996, Black :
Currently Own :- 1391406 1989 & 1990 : AT Model F 1985 : Boscom 122 (Black) : G80-3000 : G80-1800 (x2) : Wang 724 : G81-8000LPBGB (Card Reader, MY) : Unitek : AT102W : TVS Gold :
Project\'s :- Wang 724 Pink-->White Clicky : USB Model M : IBM LPFK :
Pointing stuff :- Logitech MX-518 : I-One Lynx R-15 Trackball : M13 Nipple : Microsoft Basic Optical\'s
:

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #99 on: Sat, 10 October 2009, 01:52:07 »
Quote from: InSanCen;124253
Mnemonix

If you care to post the schematic, I can get that into a colour-shaded form (Colour blocks for pin groupings etc), pretty quickly. Probably into a downloadable PCB layout as well (I work for an electronics Retailer... handy sometimes!)

I do have an older copy of Eagle somewhere, but I am using Win7 (If there is a *nix binary, I don't have it), so not sure if it works.  But I'll dig it out and see what happens.


are these what you're looking for?
http://github.com/rhomann/kbupgrade/tree/master/circuits/IBM_M4-1/

mnemonix posted quite a bit more stuff farther up the tree :)

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #100 on: Sat, 10 October 2009, 09:55:26 »
Quote from: AndrewZorn;123889
and yeah i do think this is pretty amazing, it went from idea to something that works pretty fast, makes me wonder if i will ever have a hardware colemak keyboard just to have


To be fair, it went fast because I had two other projects to look at (see my first post here). They gave me a good jump start into AVR programming and also came with working circuit diagrams to learn from.

Quote from: InSanCen;124253
If you care to post the schematic, I can get that into a colour-shaded form (Colour blocks for pin groupings etc), pretty quickly. Probably into a downloadable PCB layout as well (I work for an electronics Retailer... handy sometimes!)


As msiegel wrote already, the schematic is on Github in PDF format, ready for direct download.

A PCB layout would be awesome! But keep in mind that this circuit does not support the trackpoint yet (that's why port A is completely unutilized in my version), so it may need to be extended later. I also didn't include jumper headers for config in the schematic. Still, a PCB layout for this schematic would be useful for those who don't need/want a trackpoint.

If you like, you can perhaps make a simplified version designed not to support trackpoints, by removing one of the shift registers and corresponding diodes, and routing the corresponding 8 pins to port A on the ATMEGA. A proper firmware could be made quickly. :wink:  Such a controller would also be useful for an IBM M4 (the version without a trackpoint).

Quote from: InSanCen;124253
I do have an older copy of Eagle somewhere, but I am using Win7 (If there is a *nix binary, I don't have it), so not sure if it works.  But I'll dig it out and see what happens.


There is Eagle for Linux. Haven't tried it in a long time, so I don't know how badly crippled the current test version is. Last time I checked, it had a limit on the maximum PCB size in the unregistered version, I think.

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #101 on: Sat, 10 October 2009, 15:33:19 »
Quote from: Mnemonix;124291
But keep in mind that this circuit does not support the trackpoint yet
What kind of trackpoint support do you plan (most if not all come as a ps/2 device)?

Miniguru thread at GH // The Apple M0110 Today

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #102 on: Sun, 11 October 2009, 09:58:26 »
Quote from: lowpoly;124350
What kind of trackpoint support do you plan (most if not all come as a ps/2 device)?


I'll try to do both, keyboard and mouse, over the same USB port. I know it's possible, but I don't know yet if the V-USB driver that I am using will be good enough. In case it's not, a dedicated MCU driving another USB port just for the mouse could be used, but I'd like to avoid that.

On the hardware side, a trackpoint is just a stick with four strain gauges attached. The resistance of the strain gauges need to be measured and transformed into mouse motions. On the original controller, there is a digital potentiometer that, presumably, is used to calibrate a Wheatstone bridge. I hope to be able to make a similar circuit and take meaningful measurements using the ATMEGA's A/D converters, but that will take a bit of experimentation.

Any hints are appreciated! :)

Offline JBert

  • Posts: 764
"Open Source" Generic keyboard controller.
« Reply #103 on: Sun, 11 October 2009, 14:54:32 »
For the trackpoint: automatic (re)calibration and acceleration would be extremely nice. These are probably the most wanted features for non-IBM trackpoints.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline quadibloc

  • Posts: 770
  • Location: Edmonton, Alberta, Canada
  • Layout Fanatic
    • John Savard's Home Page
"Open Source" Generic keyboard controller.
« Reply #104 on: Mon, 12 October 2009, 18:57:52 »
Quote from: lowpoly;120588
Thanks. AIKON was the new name. Couldn't remember that. Here's another page in english:

http://www.otd.kr/bbs/board.php?bo_table=aikon_manual&wr_id=10

The first thing I noticed was the statement that client software for the keyboard doesn't work on 64-bit Windows. Client software?

Well, it is true that if the keyboard is programmable, it probably is desired to program it from the computer, and this is a special function which requires additional software. But that makes me think the keyboard might not be an exact plug-in replacement for an ordinary USB keyboard.

EDIT: Ah, I see. It's designed to be used with any keyboard, so because different keyboards have different matrices, it has to be programmed to start with.
« Last Edit: Mon, 12 October 2009, 19:03:40 by quadibloc »

Offline quadibloc

  • Posts: 770
  • Location: Edmonton, Alberta, Canada
  • Layout Fanatic
    • John Savard's Home Page
"Open Source" Generic keyboard controller.
« Reply #105 on: Mon, 12 October 2009, 19:31:45 »
Quote from: talis;123539
I say we just slap an 8 core Parallax Propeller in there and call it good =P.


While the development board is $80, the chip itself - available in a 40-pin DIP version for convenient old-fashioned interfacing at the same price - is $7.99 in single-unit quantities ($7.49 if you buy 20).

Eight cores for eight dollars!!!

We live in amazing times...

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #106 on: Mon, 12 October 2009, 20:18:04 »
propeller also requires an external eprom :-/

edit: for the code
« Last Edit: Mon, 12 October 2009, 22:14:26 by msiegel »

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline inornate

  • Posts: 25
"Open Source" Generic keyboard controller.
« Reply #107 on: Tue, 13 October 2009, 19:38:00 »
Quote from: lowpoly;120588
Thanks. AIKON was the new name. Couldn't remember that. Here's another page in english:

http://www.otd.kr/bbs/board.php?bo_table=aikon_manual&wr_id=10


The manual page is not completed yet.

The full circuit is also available, -
http://www.otd.kr/data/file/pj_LIMKB/1964092542_24157b90_Aikon28LIMKB29-SMD_Schematic.PNG

means, you can always build your own with relatively little budget - maybe under $5. (Anyway it needs ISP loader but it costs under 10$ if you try Serial port one. USB version is bit more expensive I think)

Aikon is totally reconfigurable and firmwares are still in progress.

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #108 on: Tue, 13 October 2009, 19:45:09 »
Quote from: inornate;125137
The manual page is not completed yet.

The full circuit is also available, -
http://www.otd.kr/data/file/pj_LIMKB/1964092542_24157b90_Aikon28LIMKB29-SMD_Schematic.PNG

means, you can always build your own with relatively little budget - maybe under $5. (Anyway it needs ISP loader but it costs under 10$ if you try Serial port one. USB version is bit more expensive I think)

Aikon is totally reconfigurable and firmwares are still in progress.

great! :D
the circuit is surprisingly simple.

edit: no pull-up resistors on this one either, guys. do we really not need them, or are they just being omitted for clarity because the circuit is all digital logic?
« Last Edit: Tue, 13 October 2009, 19:50:37 by msiegel »

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline inornate

  • Posts: 25
"Open Source" Generic keyboard controller.
« Reply #109 on: Tue, 13 October 2009, 19:51:23 »




Super-simple version, Thanks to Aqua.

Offline inornate

  • Posts: 25
"Open Source" Generic keyboard controller.
« Reply #110 on: Tue, 13 October 2009, 19:54:28 »
Quote from: quadibloc;124840
The first thing I noticed was the statement that client software for the keyboard doesn't work on 64-bit Windows. Client software?

Well, it is true that if the keyboard is programmable, it probably is desired to program it from the computer, and this is a special function which requires additional software. But that makes me think the keyboard might not be an exact plug-in replacement for an ordinary USB keyboard.

EDIT: Ah, I see. It's designed to be used with any keyboard, so because different keyboards have different matrices, it has to be programmed to start with.

Client only needs for configure its matrix.(means you need 32-bit XP(or vista) machine for its configuration NOTE : ONLY IN CONFIGURATION STEP)

After configuration, you can use Aikon-implemented keyboard in any computer environment.(Tested in Linux, Apple(with firmware beta 1.0.3), XP, Vista, 7, includes 64bit version)

Offline inornate

  • Posts: 25
"Open Source" Generic keyboard controller.
« Reply #111 on: Tue, 13 October 2009, 19:56:57 »
Quote from: msiegel;125140
great! :D
the circuit is surprisingly simple.

edit: no pull-up resistors on this one either, guys. do we really not need them, or are they just being omitted for clarity because the circuit is all digital logic?


Aikon uses internal pull-up registers integrated in AtMega chip.

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #112 on: Tue, 13 October 2009, 20:01:13 »
Quote from: inornate;125149
Aikon uses internal pull-up registers integrated in AtMega chip.


thank you :)

we've been discussing whether the internal pull-up resistors are strong enough. apparently, they are :D

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #113 on: Wed, 14 October 2009, 02:49:57 »
Quote from: inornate;125144
Super-simple version, Thanks to Aqua.


Ah, these circuits look familiar to me. :)  Looks a lot like what is used in Rump or Dulcimer. I guess then there are not too many ways to do this right on an AVR. ;)
It won't work for an M4, though (19x9 matrix, but apparently AIKON offers 18x8 only).

Isn't AIKON going a lot into the direction that Talis had in mind when starting this thread?

Quote from: inornate;125148
Client only needs for configure its matrix.(means you need 32-bit XP(or vista) machine for its configuration NOTE : ONLY IN CONFIGURATION STEP)


Oh, so I couldn't even configure that thing. :(

Do they have source code for download somewhere? I tried downloading their 1.0.4 Beta firmware to have a look, but failed for the following reason:



Huh? Sorry, no Korean here... ;)
They should really translate their site to English to get a broader audience; I've never stumbled across that project while googling for related stuff.

Offline inornate

  • Posts: 25
"Open Source" Generic keyboard controller.
« Reply #114 on: Wed, 14 October 2009, 04:48:07 »
Quote from: Mnemonix;125213
Ah, these circuits look familiar to me. :)  Looks a lot like what is used in Rump or Dulcimer. I guess then there are not too many ways to do this right on an AVR. ;)
It won't work for an M4, though (19x9 matrix, but apparently AIKON offers 18x8 only).

Isn't AIKON going a lot into the direction that Talis had in mind when starting this thread?



Oh, so I couldn't even configure that thing. :(

Do they have source code for download somewhere? I tried downloading their 1.0.4 Beta firmware to have a look, but failed for the following reason:



Huh? Sorry, no Korean here... ;)
They should really translate their site to English to get a broader audience; I've never stumbled across that project while googling for related stuff.

OOPS? I can download it normally.. That message is "Invalid operation".

I tried to give you as much as information in english (a least about Aikon) :(

Key informations(manual, download section) is offered in Eng (not all information-not completed. sorry. It needs really hard work. but I'm still trying)

anyway it's not offered as open source and we bought the V-USB license (so it's not need to be distributed as GPL). I'm really sorry about that but I'm second author of the its firmware and client and original author doesn't want its source be opened.

Anyway if you want the keyboard controller, and if you want the problem be simple(who don't care about authoring source code), Aikon can be a good alternative - key matrix is reconfigurable during use, 3 layers offered(FN key, Numlock key), and super easy keymapping sequence.

You can refer this video (about how easy to mapping it is)
http://www.youtube.com/watch?v=3qAIEpUoJjU

I'm still trying to make another version of keyboard controller (PS/2, supports true N-key rollover / or also offered with blocking algorithm, 4-layer selected by dip switch, 17*8 matrix). This will be opened to you guys. I promise.
« Last Edit: Wed, 14 October 2009, 04:52:08 by inornate »

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #115 on: Wed, 14 October 2009, 05:34:42 »
Quote from: inornate;125224
OOPS? I can download it normally.. That message is "Invalid operation".

Nevermind, seems to be a proxy problem. I can download the firmware by bypassing the proxy. Not much to see there, though! ;)

Quote from: inornate;125224
anyway it's not offered as open source and we bought the V-USB license (so it's not need to be distributed as GPL).

What a pity. :(
Of course, it's your decision to keep the code closed and secret, and I am not intending to talk this out of you, but personally, I found it a lot easier to open up. It's just so convenient that people can point at problems and even fix them for you.

Quote from: inornate;125224
I'm really sorry about that but I'm second author of the its firmware and client and original author doesn't want its source be opened.

In this case, please s/they/you/g in my previous post. ;) I didn't realize you are involved in the Aikon project.

Edit: By the way, is there a specific meaning to the word "Aikon"?

Quote from: inornate;125224
I'm still trying to make another version of keyboard controller (PS/2, supports true N-key rollover / or also offered with blocking algorithm, 4-layer selected by dip switch, 17*8 matrix). This will be opened to you guys. I promise.

Sounds great! I'm looking forward to see it then! :)

Offline Xichekolas

  • Posts: 17
"Open Source" Generic keyboard controller.
« Reply #116 on: Wed, 14 October 2009, 21:09:05 »
Been following this thread closely the last few days.

I'm mainly interested because I'd love to experiment with different layouts, and having a drop in controller that I can just wire my switches to would be great.

I'm more of a programming guy, so I'll have to let you guys do all the difficult hardware stuff, but I was thinking about ways to make it easy for the end user to program.

My thought is that keyboards lend themselves naturally to an event-based model. You call each key an 'event' and define an action to be executed when that event happens. The actions come from a nice clean API of stuff the keyboard can do. An example:

Code: [Select]
esc :key11
alt :key18, :key811
shift :key15, :key85

capslock :key14 do
  toggle_led 1 # toggle first LED from on to off or vice versa
end

# shortcut for normal acting letter keys
q :key23
w :key24
e :key25

# or you can really remap things

# first create a new layer and key to activate it
create_layer :fn
fn :key31 do
  toggle_led_while_down 2
end

# now do some complicated mapping for this key
set :key42 do |key|
  # ever seen programmers dvorak?
  key = :!           # no modifiers
  key.shift = :1    # shift key is down
  key.shift.alt = :print_screen # shift and alt down

  # fn key is down (and we are in the fn layer)
  key.fn = :ctrl, :alt, :delete
end

I gather our little microcontroller isn't going to have enough memory/power to process something like this on the fly, but it would be trivial to generate whatever format was needed from a description like this (including binary formats). Using this single representation, you could generate mappings for various controllers, or xmodmap files, or whatever else.

So anyway, I have no idea if this is helpful or just redundant, since I haven't really seen how existing keyboard programming models work... but if there is any interest in creating something like this, I'd be happy to work on it. I'd just need some samples of whatever target code I need to generate. It shouldn't take too long... this is the kind of stuff I do for my paychecks. ;)

As for getting what I generate onto the board, someone suggested putting some kind of microSD reader or something on the controller. That sounds good to me. Create a config like above, generate microcontroller code, put on microSD card, hit a button on bottom of keyboard to make it read new settings... something like that.
« Last Edit: Wed, 14 October 2009, 21:13:31 by Xichekolas »

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #117 on: Thu, 15 October 2009, 11:51:43 »
Quote from: msiegel;125150
thank you :)

we've been discussing whether the internal pull-up resistors are strong enough. apparently, they are :D

In some applications they will be, in some they may not.  There's really no reason not to include pads for them (or even include them at the cost of maybe $0.08 total) in case someone finds an application where they are necessary.  The actual hardware design will ultimately be fairly simple, with most of the complexity coming in the software design.

I'd like for anyone with any form of requirement to start adding them on the project page, so we can start on the process of uC selection (then everything will proceed from there).  The requirements really should be thought of as a wish list at this point (eg.  If I could have any controller, it would do x, y, and z).

Again, I'm not saying the Atmel chips aren't the right choice, I'd just like to go through the formal process of requirements gathering -> selection -> development to make sure nothing is missed.   It may turn out that some other device better meets the requirements, or some trade off between them.

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #118 on: Thu, 15 October 2009, 12:01:48 »
Quote from: talis;125671
I'd just like to go through the formal process of requirements gathering -> selection -> development to make sure nothing is missed.   It may turn out that some other device better meets the requirements, or some trade off between them.


sounds good to me :)

i'll be working from the other end, using a teensy avr dev board and modifying mnemonix code to develop a capacitive-matrix version of the controller

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #119 on: Thu, 15 October 2009, 12:08:59 »
Quote from: talis;125671
I'd like for anyone with any form of requirement to start adding them on the project page

Done.

I just figured out that you have to be logged in to see the forum.

Miniguru thread at GH // The Apple M0110 Today

Offline JBert

  • Posts: 764
"Open Source" Generic keyboard controller.
« Reply #120 on: Thu, 15 October 2009, 13:34:06 »
Quote from: talis;125671
I'd like for anyone with any form of requirement to start adding them on the project page.
Where? I don't see anything special on this mod's wiki page.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #121 on: Thu, 15 October 2009, 13:34:48 »
Quote from: JBert;125721
Where?


http://geekey.org/

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline JBert

  • Posts: 764
"Open Source" Generic keyboard controller.
« Reply #122 on: Thu, 15 October 2009, 13:47:36 »
Heh, I just noticed it was in his signature...
Seems I was getting so disillusioned by reading people's signatures that I stopped reading them.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #123 on: Thu, 15 October 2009, 16:03:34 »
Quote from: msiegel;125680
i'll be working from the other end, using a teensy avr dev board and modifying mnemonix code to develop a capacitive-matrix version of the controller


Cool! Did you order the older or the ++ version?
And do you think it will be hard interfacing with a capacitive matrix? What extra parts would you need for this?

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #124 on: Thu, 15 October 2009, 16:17:22 »
Quote from: Mnemonix;125778
Cool! Did you order the older or the ++ version?
And do you think it will be hard interfacing with a capacitive matrix? What extra parts would you need for this?


i ordered the regular less expensive version, with 22 contacts... and also ordered an rgb led :)

i'm pretty sure it will require an oscillator, to generate an em field on the pads... possibly an op-amp to read the signal back (don't know how strong the signal is yet)... then either use on the on-chip adc or figure out some fast, simple way to measure the field strength.

calibration will be an interesting area :)

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline talis

  • Thread Starter
  • Posts: 195
"Open Source" Generic keyboard controller.
« Reply #125 on: Thu, 15 October 2009, 21:44:53 »
Quote from: msiegel;125784
i ordered the regular less expensive version, with 22 contacts... and also ordered an rgb led :)

i'm pretty sure it will require an oscillator, to generate an em field on the pads... possibly an op-amp to read the signal back (don't know how strong the signal is yet)... then either use on the on-chip adc or figure out some fast, simple way to measure the field strength.

calibration will be an interesting area :)


This is probably the best place to start : http://www.cypress.com/?docID=2192

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #126 on: Thu, 15 October 2009, 21:49:28 »
Quote from: talis;125880
This is probably the best place to start : http://www.cypress.com/?docID=2192


thanks talis, that's great! :D

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #127 on: Fri, 16 October 2009, 06:02:11 »
Quote from: Xichekolas;125480
My thought is that keyboards lend themselves naturally to an event-based model. You call each key an 'event' and define an action to be executed when that event happens. The actions come from a nice clean API of stuff the keyboard can do. An example:


OK, so this would be for the user defining key maps, macros, and so on?
I can see some inconsistencies in the example, but I suppose this is just an idea for how it could be written down, right? Maybe the forum on http://geekey.org/ is a more appropriate place for discussing the details, though...

Quote from: Xichekolas;125480
I gather our little microcontroller isn't going to have enough memory/power to process something like this on the fly, but it would be trivial to generate whatever format was needed from a description like this (including binary formats). Using this single representation, you could generate mappings for various controllers, or xmodmap files, or whatever else.


Basically, this is what I am doing in my own firmware already, but in a more limited way (e.g., no macros). There is a config file describing the keyboard (row/column-to-key assignments), and there are files that describe how to transform from the generic QWERTY map to anything else. A Python script takes these and produces a C structure that is used in the microcontroller program for processing the keystrokes.
At the moment, this key map structure is hardcoded into the firmware, but reading alternative key maps from EEPROM can be done easily. Maybe I can do that over the weekend... ;)

Quote from: Xichekolas;125480
So anyway, I have no idea if this is helpful or just redundant, since I haven't really seen how existing keyboard programming models work...


I haven't seen those either, but I guess you are supposed to use some GUI program for programming them. I wouldn't want that. ;)

Quote from: Xichekolas;125480
As for getting what I generate onto the board, someone suggested putting some kind of microSD reader or something on the controller. That sounds good to me. Create a config like above, generate microcontroller code, put on microSD card, hit a button on bottom of keyboard to make it read new settings... something like that.


Generating MCU code might not work since not all MCUs can execute code from RAM, but only from their flash memories. Therefore, the generated code would have to be some bytecode for a virtual machine to be interpreted by the MCU, so the MCU needs to run a virtual machine interpreter.
This is doable, provided the VM is kept simple.

Offline Shawn Stanford

  • Posts: 368
"Open Source" Generic keyboard controller.
« Reply #128 on: Fri, 16 October 2009, 09:25:22 »
Oh, man: this stuff sounds so cool! I wish I had the background and time to get involved...
The Brat Prince of COBOL

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #129 on: Mon, 19 October 2009, 00:12:43 »
another source for development components -- preprogrammed avr microcontrollers from Evil Mad Science

$5

http://evilmadscience.com/partsmenu/132


Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #130 on: Tue, 27 October 2009, 12:38:03 »
For the record: I have added support for user-defined key maps to my keyboard controller firmware.
You can generate key map files from keyboard definition files + transformation files, and upload the result to the keyboard's EEPROM using a small command line tool.
Key maps can be selected via jumpers: up to 4 user-defined maps in 512 bytes of EEPROM, plus the default QWERTY map in the firmware image.

Basically, this gives you Colemak, Dvorak, etc. in hardware. :smile:

Offline DreymaR

  • Posts: 184
  • Location: Norway
  • Colemak forum guy
    • DreymaR's Big Bag of Kbd Tricks
"Open Source" Generic keyboard controller.
« Reply #131 on: Wed, 28 October 2009, 03:59:05 »
Sounds nice.

Maybe it's been covered somewhere in the previous pages that I didn't see, but: Could you make a QIDO-type adapter with this (preferably USB-to-USB these days, but there are of course other options)? Because that's what I'd love to have, without paying the full QIDO price (and there's no 'QICO' for colemak yet that I'm aware of).
Better burden you cannot carry than man-wisdom much ~ Hávamál

Offline JBert

  • Posts: 764
"Open Source" Generic keyboard controller.
« Reply #132 on: Wed, 28 October 2009, 14:18:34 »
A custom "QICO" would only work when your keyboard doesn't contain an USB hub, otherwise it might be hard but possible to make it with only bit-stuffing.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #133 on: Wed, 28 October 2009, 14:58:10 »
Quote from: DreymaR;128716
Could you make a QIDO-type adapter with this (preferably USB-to-USB these days, but there are of course other options)?


I thought a bit about this idea... Unfortunately, I think USB-to-USB cannot be done using a single ATMEGA, at least not in software.

The task of such an adapter seems trivial: forward any traffic between computer and keyboard, just rewrite the packets containing the keystrokes. This, however, requires the adapter to operate as a USB hub (or, as a hack, some kind of invisible bridge), and this is what makes it non-trivial. The keycode translation itself would be embarrassingly easy, but I don't think an ATMEGA has enough compute power to act as a USB device and a host at the same time.
A way out might be to use an external USB host controller chip, hook it up to the microcontroller, and use it to interface with the keyboard. But I am not really an expert on this field, so I don't have any idea which chip to choose. :)

On the other hand, a PS/2-to-USB converter with built-in keycode translation seems more feasible since PS/2 is a lot simpler than USB. Then again, there must be something hard about designing such a converter, given all those crap converters that you can buy today. ;)

I guess the quickest way to get a QICO would be to ask the QIDO guys to make one. All they would have to do is to exchange the key maps in their firmware. Maybe they are not aware of Colemak?

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #134 on: Wed, 28 October 2009, 15:02:32 »
Quote from: JBert;128868
A custom "QICO" would only work when your keyboard doesn't contain an USB hub, otherwise it might be hard but possible to make it with only bit-stuffing.


Hm, that's right. A USB hub on the keyboard would make things even more complicated.

Offline DreymaR

  • Posts: 184
  • Location: Norway
  • Colemak forum guy
    • DreymaR's Big Bag of Kbd Tricks
"Open Source" Generic keyboard controller.
« Reply #135 on: Thu, 29 October 2009, 03:56:51 »
Mnemonix: Thanks for the answers - a bit clearer now.

Stuff USB hubs. I won't need one, and a lot of boards don't have them so I'm not going to make that into a problem.

The USB controller thing is worse I guess. However, even if the current PS/2-to-USB adapters are of varying quality I think I could live with using one. So a PS/2-to-USB piece would do the job. I could then just hook up any USB boards with one of those crappy USB-to-PS/2 thingys and plug that into the converter and it'd work well enough for my uses. I also have a lot of PS/2 boards so in fact it'd be very useful in that respect!

However, couldn't the USB controller inside the USB keyboard handle all the USB device stuff and the converter only intercept the scan codes and let the rest pass through?

Sure, the QIDO people know about Colemak from several people and they may well be on their way to making a QICO... if they think it'll pay off. But did you see the price tag on that QIDO? Making your own might cost as much but then at least I'd have the new knowledge and pride to show for it!
Better burden you cannot carry than man-wisdom much ~ Hávamál

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #136 on: Thu, 29 October 2009, 06:02:26 »
Quote from: DreymaR;129004
The USB controller thing is worse I guess. However, even if the current PS/2-to-USB adapters are of varying quality I think I could live with using one. So a PS/2-to-USB piece would do the job. I could then just hook up any USB boards with one of those crappy USB-to-PS/2 thingys and plug that into the converter and it'd work well enough for my uses. I also have a lot of PS/2 boards so in fact it'd be very useful in that respect!


USB-to-PS/2 converters? Never had to use one of those, but this is probably the cheapest way to go then.

Quote from: DreymaR;129004
However, couldn't the USB controller inside the USB keyboard handle all the USB device stuff and the converter only intercept the scan codes and let the rest pass through?


I guess you have something like a USB protocol sniffer in mind, which is what I had in mind when writing "some kind of invisible bridge". It would have to capture all communication between host and keyboard and repeat all it sees. But it would also need to decode the USB protocol, filter out the reports sent by the keyboard, modify those, encode the packet back to USB, etc.

Such a device could actually work, but I doubt it would be easy. It would be half device, half host, but invisible on the bus. Being invisible makes it also difficult to communicate with it, for instance, for updating its firmware. It would also introduce delays not expected by neither host nor keyboard, probably causing some extra trouble.

Quote from: DreymaR;129004
Sure, the QIDO people know about Colemak from several people and they may well be on their way to making a QICO... if they think it'll pay off. But did you see the price tag on that QIDO? Making your own might cost as much but then at least I'd have the new knowledge and pride to show for it!


It would be cool if they could make a QIAO ("anything-out") which allows the user to define his own mappings. The high price may then be a bit more acceptable.
They could still use some competition... :wink:

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #137 on: Mon, 02 November 2009, 16:12:25 »
Upgraded my firmware once again... There is a command mode now, activated by hitting Scroll Lock.
Key maps are not selected by jumper anymore, but by pressing a number key between 0 and 9 in command mode. Thus, key maps can be exchanged quickly at any time now. The selection of the key map is stored in EEPROM so that it is not lost during power cycles.

Offline inornate

  • Posts: 25
"Open Source" Generic keyboard controller.
« Reply #138 on: Mon, 14 December 2009, 11:04:56 »
I'm glad to introduce my project - ps2avr.

It's available now at
https://sourceforge.net/projects/ps2avr/

Also some movies at
* LED Fading action
http://www.youtube.com/watch?v=qMCEfqjF7LY

* Rollover support
http://www.youtube.com/watch?v=GjPz_o9pHXI

* repeat rate
http://www.youtube.com/watch?v=I7puVuMktzk

Have fun & any collaboration will be appreciated.

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #139 on: Mon, 14 December 2009, 14:43:14 »
Quote from: inornate;142215
I'm glad to introduce my project - ps2avr.

It's available now at
https://sourceforge.net/projects/ps2avr/


Nice, thanks for sharing!

It is hard to tell from the videos (for me it is, at least): which keyboard do you use your firmware with?

Offline inornate

  • Posts: 25
"Open Source" Generic keyboard controller.
« Reply #140 on: Mon, 14 December 2009, 22:43:40 »
Quote from: Mnemonix;142289

It is hard to tell from the videos (for me it is, at least): which keyboard do you use your firmware with?


356CL Dark Gray Edition, full-custom built keyboard from OTD, Korea. (not commercial one)

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #141 on: Wed, 16 December 2009, 15:42:35 »
Good work, inornate. Is this your own project you mentioned on page 8?

Unrelated, beside two personal projects that were or are being run independently (Mnemonix, inornate) this project looks stalled. Before we could go to the next step (uC family selection), someone had to go through all the requirements posted here and on geekey.org and collect and condense them. Which I did.

I posted a new thread on geekey.org with the collected requirments here:

http://geekey.org/forum/viewthread.php?thread_id=3

Let me add the personal opinion that the traffic on geekey.org is too little ATM which may have added to the stalling situation we're in. I'm sure we will need it soon, it may just be too early yet. So I'll post the requirements here too and invite everybody to post here as well. If my time allows it I'll go through both threads again and do another summary.

Here are the collected requirments (yes, I may have added one or two things while doing this :-) ):

Hardware (core):
  • capacitive switch support
  • must not require special OS drivers
  • ability to operate with only power supplied over the selected bus interface
  • hardware switch for programming (to avoid hacking)
  • generally large device family (to allow simplification for commercialization, or expansion for big projects)
  • minimum number of rows and columns: 19x9
  • the hardware output of this project should also be relatively easy to hook up to archaic hardware (e.g. Commodore 64/128)
  • re-flashing of program ROM with no specialized tools
  • cheap hardware possible for volume production
  • while most keyboards are enclosed by a single piece of plastic, the developed solution should be designed to allow multi-piece keyboards, e.g.completely separate left half, right half, and ten-key modules that can be placed as desired
  • standardized matrix interface that would make it easy to interface with most current keyboards (through separate interface cards probably), or work into new custom designs

Hardware (extended):
  • a sD/usD card reader to store layouts
  • LED support, including RGB LEDs and one LED per switch
  • ability to drive up to 6 groups of backlight LEDs
  • ability to drive standard keyboard LEDs
  • some sort of visual feedback interface provided, i.e. LED/LCD segment display
  • PS/2 pass through, that can be used for onboard PS/2 based pointing devices, or separate keyboards if controller is used in a macro pad application
  • ability for PS/2 pass through to operate with USB host interface (basically built in PS/2 -> USB conversion)
  • trackpoint support, at least 3 mouse buttons
  • USB hub


Protocols:
  • ability to select between PS/2, USB, (other) communications protocols
  • ps/2 support should use the usb cable with a passive usb->ps/2 adapter, auto selection of connection
  • Bluetooth / Bluetooth HID interface / Bluetooth wireless


Layers:
  • at least five layers (for ex. Qwerty, Colemak, cursor movement, frequent words, special characters)
  • must support both hardware and software locking switches for layers (for ex. to switch between Qwerty and Colemak)
  • ability to make any key (or key combo) on the keyboard either a locking or a non-locking modifier
  • fairly large number of allowable over-riding layers, as well as a small number of compound layers
  • ability to build up to 3 compound layers (x, y, or x+y), and any number of non-compound layers with the ability to set priorities on layers
  • encrypted layer storage with master password to unlock a layer


Programming:
  • programming possible without external programmer software
  • if software-less programming, layout should be downloadable from keyboard to pc and restorable (for ex. through SD card storage)
  • programming possible with external programmer software
  • multi-platform sdk for this programming software so it's possible to write a proprietary programmer
  • firmware upgradeable, must not brick
  • ability to program over both PS/2 and USB
  • fairly basic bootloader, that will allow re-programing of the core code using the flash card interface
  • public key certification to ensure that the firmware people download from some site is not malicious
  • ability to re-program ROM, key layouts, macros, and overall behavior under any host operating system
  • anti-ghosting optional (some 'boards may have diodes)
  • if possible: emulate a mouse interface to send scroll wheel or even mouse movement events. (Only feasible with USB interface. You can add an extra endpoint which appears to the PC as a regular mouse)
  • firmware features should not rely on specific keys (tenkeyless keyboards for ex.!)
  • decoupling of key map and layout map possible
  • if there's going to be ample flash memory on the controller chip, it would be smart to have a self-calibration procedure for key debouncing
  • sticky modifiers (sticky control key feature)
  • macro playback with humanizing randomization added (randomized delays)
  • Ability to program the matrix/layers without needing development tools/source modifications.
  • layout selection (i.e.) remapping character keys to use "native scancodes" (regular ANSI/US layout), "colemak-qwerty" (hardware-remapped scan codes), "dvorak-qwerty", "colemak-azerty", ...


Development tools (hardware and software):
  • use all open source/free (as in speech) software development tools
  • simple / inexpensive to build at home using "cheap" development tools (eg no $400 ICDs to program the chips)
  • firmware should be written mainly in C, not ASM or proprietary languages


Other:
  • commercial use possible (= find a license we all can live with)
  • ability to small run produce the boards cheaply
  • well documented, easily extensible, modifiable etc.

Miniguru thread at GH // The Apple M0110 Today

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #142 on: Wed, 16 December 2009, 15:54:22 »
uC family decision next. We will probably need a spreadsheet for this. Rows: requirements, Columns: chip families and members.

So we need a list of chips that may fit the requirements.

Miniguru thread at GH // The Apple M0110 Today

Offline keyb_gr

  • Posts: 1384
  • Location: Germany
  • Cherrified user
    • My keyboard page (German)
"Open Source" Generic keyboard controller.
« Reply #143 on: Wed, 16 December 2009, 16:41:53 »
Quote from: lowpoly;143080

Hardware (core):
  • capacitive switch support


Is it even clear how a capacitive keyboard normally operates? Not really to me at least. I am under the impression that there is more than one way of doing it...
Hardware in signatures clutters Google search results. There should be a field in the profile for that (again).

This message was probably typed on a vintage G80-3000 with blues. Double-shots, baby. :D

Offline cb951303

  • Posts: 72
"Open Source" Generic keyboard controller.
« Reply #144 on: Wed, 16 December 2009, 16:45:36 »
I would suggest a simple eeprom (couple of MBs)for the layout storing instead of SD because
1. SD is totally overkill for this purpose
2. AFAIK it has a restrictive license and the developer may have to sign an NDA to get the full spec. Not exactly in the spirit of open source.

for uC, I worked with Atmel AVR and PIC in the past. Atmel almost wins in every aspect but mostly in development tool support. It has pretty good GCC support.
and also, as stated before, there is V-USB which implements USB HID in software for most AVR chips.


EDIT: BTW there is no AVR chip other then XMEGA (fairly new series) that has  enough I/O pins for a 19x9 matrix + other things if we decide to use V-USB.
There is always the USB AVR series though.

Also note that V-USB requires a fee for commercial use. It's free for other purposes.
« Last Edit: Wed, 16 December 2009, 16:51:30 by cb951303 »
Filco Zero FKBN87Z/EB
Kensington Orbit K72337US

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #145 on: Wed, 16 December 2009, 16:54:37 »
Quote
Is it even clear how a capacitive keyboard normally operates?

We probably have to go through some iterations until most requirements are 'checked' in the spreadsheet. Some never will and will need some sort of extension (or be dropped if there isn't enough interest, which should be another column).

Any suggestions for a collaborative spreadsheet? Has Google something here?

Miniguru thread at GH // The Apple M0110 Today

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #146 on: Wed, 16 December 2009, 17:05:01 »
Quote from: cb951303;143096
I would suggest a simple eeprom (couple of MBs)for the layout storing instead of SD because
1. SD is totally overkill for this purpose
2. AFAIK it has a restrictive license and the developer may have to sign an NDA to get the full spec. Not exactly in the spirit of open source.

Some do not want the external programming software. Just a text editor to edit the layout, write it to SD and re-insert it into the controller. Also, if you use on-keyboard programming you can remove the SD to backup or edit your layout. So I think the main reason for SD is software-less data exchange.

I'm in EEPROM camp but having both can't hurt. The NDA you mention can collide with the open source requirement but maybe the full spec isn't necessary?
« Last Edit: Wed, 16 December 2009, 17:11:47 by lowpoly »

Miniguru thread at GH // The Apple M0110 Today

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #147 on: Wed, 16 December 2009, 17:35:25 »
Quote from: lowpoly;143082
uC family decision next.


Thanks for pushing this again! :) I thought Talis would show up one day to do this.

Quote from: keyb_gr;143095
Is it even clear how a capacitive keyboard normally operates? Not really to me at least. I am under the impression that there is more than one way of doing it...


There are multiple ways to measure capacitance, which is what needs to be done here. Talis once posted a link to a PDF that explains how capacitive switches are supposed to work. The figure on the first page pretty much says it all (think of the finger as some part of the key): you need to be able to decide between small and big capacitance. Which method you are going to use is up to you.

I don't know which way is best, or which would work at all. Msiegel is doing some research on this area for his Model F mod. Maybe he has found a good method already?

Quote from: cb951303;143096
I would suggest a simple eeprom (couple of MBs)for the layout storing instead of SD because
1. SD is totally overkill for this purpose
2. AFAIK it has a restrictive license and the developer may have to sign an NDA to get the full spec. Not exactly in the spirit of open source.


I also think its overkill, but this is an anything-goes wish list. Signing an NDA would be unacceptable though, IMHO.

Quote from: cb951303;143096
EDIT: BTW there is no AVR chip other then XMEGA (fairly new series) that has  enough I/O pins for a 19x9 matrix + other things if we decide to use V-USB.
There is always the USB AVR series though.


Yes, I ran into that problem when building a controller for an M4-1. I used two external shift registers (74164) to drive 16 of the matrix rows while using only two I/O ports on the AVR.

The USB AVR series would be great, but they are not available in DIL packages (or are they?). But if there were cheap devboards for these...

Offline cb951303

  • Posts: 72
"Open Source" Generic keyboard controller.
« Reply #148 on: Wed, 16 December 2009, 17:43:09 »
Quote from: lowpoly;143105
Some do not want the external programming software. Just a text editor to edit the layout, write it to SD and re-insert it into the controller. Also, if you use on-keyboard programming you can remove the SD to backup or edit your layout. So I think the main reason for SD is software-less data exchange.

but what will you do after the data exchange. how will you tell the keyboard to use a certain layout on the SD card without an external software (I may be missing a point)? but if an external software is unavoidable we might very well include a simple data exchange capability to that software. Something like a very simple multi purpose command line tool maybe?

Quote

I'm in EEPROM camp but having both can't hurt. The NDA you mention can collide with the open source requirement but maybe the full spec isn't necessary?


yes it's certainly possible. I think there is a lite spec that doesn't require an NDA but I'm not sure if it's totally free to use either.
Filco Zero FKBN87Z/EB
Kensington Orbit K72337US

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #149 on: Wed, 16 December 2009, 17:51:17 »
Quote from: Mnemonix;143110
Msiegel is doing some research on this area for his Model F mod. Maybe he has found a good method already?


IBM patents describe a method of driving column lines with digital pulses, and seeing if the pulses couple (through the fly-plate and sensor pads) to row lines.

according to formulas in one of the patents, a current of ~1-10 uA appears on the sense lines when pulses come through. the inputs and outputs to the microcontroller would seem to be all digital; there's some analog amplification and thresholding in between.

i'll be starting electronics experiments soon :)

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #150 on: Wed, 16 December 2009, 17:53:04 »
Quote from: lowpoly;143105
Some do not want the external programming software. Just a text editor to edit the layout, write it to SD and re-insert it into the controller. Also, if you use on-keyboard programming you can remove the SD to backup or edit your layout. So I think the main reason for SD is software-less data exchange.


Hm. I think would be easier to communicate with the keyboard controller directly using some tool, without the SD card detour. It is possible over USB, but would it also work over PS/2?

Using SD cards also means that (V)FAT(32) needs to be supported (because it is supported by any major OS). Microsoft has some stupid patent pending for supporting long file names, which is the reason why LFN support can be disabled in recent Linux kernels... I would hate those patent trolls doing the same to the GeeKey firmware.

Offline msiegel

  • Posts: 1230
"Open Source" Generic keyboard controller.
« Reply #151 on: Wed, 16 December 2009, 17:53:44 »
Quote from: Mnemonix;143110
The USB AVR series would be great, but they are not available in DIL packages (or are they?). But if there were cheap devboards for these...


i'm using the $20 Teensy dev board, with ATMEGA32U4 :)

Filco Zero (Fukka) AEKII sliders and keycaps * Filco Tenkeyless MX brown * IBM F/AT parts: modding
Model F Mod Log * Open Source Generic keyboard controller

Offline inornate

  • Posts: 25
"Open Source" Generic keyboard controller.
« Reply #152 on: Thu, 17 December 2009, 03:27:02 »
Quote from: lowpoly;143080
Good work, inornate. Is this your own project you mentioned on page 8?

Exactly. anyway AVR-based projects are really hard to support 19*9 matrix without additional hardware supports - because of its number of available pins :( The best available is 19*8. I think.

Maybe we can use MUX to increase its ability to handle more matrix but I'm not sure that additional hardware only for one extra column, is a good solution.

Offline cb951303

  • Posts: 72
"Open Source" Generic keyboard controller.
« Reply #153 on: Thu, 17 December 2009, 04:12:47 »
Quote from: inornate;143175
Exactly. anyway AVR-based projects are really hard to support 19*9 matrix without additional hardware supports - because of its number of available pins :( The best available is 19*8. I think.

Maybe we can use MUX to increase its ability to handle more matrix but I'm not sure that additional hardware only for one extra column, is a good solution.


XMega and AVR USB can support even much bigger matrices but the problem is they are not in DIL packages. Is there a 34+ pins DIL package in any other brand?
Filco Zero FKBN87Z/EB
Kensington Orbit K72337US

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #154 on: Thu, 17 December 2009, 04:28:58 »
Quote from: msiegel;143115
i'm using the $20 Teensy dev board, with ATMEGA32U4 :)

Oh yes, the Teensy and Teensy++ come with USB AVRs. Completely forgot about this. :loco:

Quote from: inornate;143175
Exactly. anyway AVR-based projects are really hard to support 19*9 matrix without additional hardware supports - because of its number of available pins :( The best available is 19*8. I think.

The IBM M4-1 has a 19x9 matrix, hence the requirement. I'd love to see it fully supported, including its trackpoint if possible.

Quote from: inornate;143175
Maybe we can use MUX to increase its ability to handle more matrix but I'm not sure that additional hardware only for one extra column, is a good solution.

Yes, a MUX was the first thing I was thinking of, too. Then I realized that we don't need to multiplex arbitrary signal patterns, but only need to generate very specific patterns. You are probing rows one by one, so only a single row is activated at any given time:

Row 1: 10000...   (first row pin is activated, the others are not (e.g., tri-stated))
Row 2: 01000...   (only second pin is activated)
Row 3: 00100...
...

That is, we are shifting the "1" from the first to the last pin in order to probe the corresponding rows. This is easily done using a shift register, which only has two input pins to be driven by the MCU: Data and Clock. You trade 8 I/O pins on the AVR with 2 I/O pins at the price of an additional component. It is also possible to cascade multiple shift registers so that instead of 16 or 24 I/O pins you are using 2 or 3 additional components while still only using 2 I/O pins.

In the end it's a matter of additional cost and PCB space. Alternatively, we could just use a bigger MCU with more I/O pins.

Offline cb951303

  • Posts: 72
"Open Source" Generic keyboard controller.
« Reply #155 on: Thu, 17 December 2009, 04:41:58 »
BTW if we need to keep the PCB small we may have to design it modular like arduino and its shields.

With bluetooth, SD(or eeprom), a BIG mcu and all other requested stuff it would probably fail to fit in any of the current keyboard cases :)
Filco Zero FKBN87Z/EB
Kensington Orbit K72337US

Offline inornate

  • Posts: 25
"Open Source" Generic keyboard controller.
« Reply #156 on: Thu, 17 December 2009, 04:50:11 »
Quote from: Mnemonix;143180
In the end it's a matter of additional cost and PCB space. Alternatively, we could just use a bigger MCU with more I/O pins.

Yes it's matter of cost (money and space); I agree that shift register is very good choice.

In my case I needed to build hundreds of units so cost was the most critical issue for me => therefore I chose minimal hardware parts in my project.

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #157 on: Thu, 17 December 2009, 04:51:42 »
Quote from: cb951303;143183
BTW if we need to keep the PCB small we may have to design it modular like arduino and its shields.

With bluetooth, SD(or eeprom), a BIG mcu and all other requested stuff it would probably fail to fit in any of the current keyboard cases :)


A 1391401 has plenty of space, probably enough to stow a whole mini computer, but the Space Saving version is not so roomy. :)

But yeah, modular design would be good, albeit a bit more expensive.

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #158 on: Sat, 02 January 2010, 04:54:41 »
Quote from: lowpoly;143101
Any suggestions for a collaborative spreadsheet? Has Google something here?


bump

Miniguru thread at GH // The Apple M0110 Today

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #159 on: Sat, 02 January 2010, 08:23:28 »
I started a google docs spreadsheet here:

http://spreadsheets.google.com/ccc?key=0AkMZsZqYsU0kdDdQZ2V3ZEJ6RENuUm5TTDRUS2FTUmc&hl=en

As of now, anyone can edit.

Miniguru thread at GH // The Apple M0110 Today

Offline lowpoly

  • Posts: 1749
"Open Source" Generic keyboard controller.
« Reply #160 on: Sat, 02 January 2010, 09:05:13 »
Quote from: lowpoly;147271
As of now, anyone can edit.
Didn't realize this would start immediately. :-) Sorry for deleting that word I couldn't remember having written.

Miniguru thread at GH // The Apple M0110 Today

Offline Specter_57

  • Posts: 143
For those thinking of using shift registers ...
« Reply #161 on: Sun, 03 January 2010, 12:52:46 »
Hello all.

For those thinking of using shift registers in order to keep with the p-DIP type of devices, there is a rather detailed explanation on the use of shift registers with code examples on this Arduino-related page.

See here:

Serial to Parallel Shifting-Out with a 74HC595
http://arduino.cc/en/Tutorial/ShiftOut

and

Using shift registers to extend the microcontroller I/O
http://homepages.which.net/~paul.hills/Software/ShiftRegister/ShiftRegister.html


Just started reading about this Arduino device (mentioned from time to time here...)...which uses some of the same controllers suggested in this thread...looks interesting, at least for me it is...still at the bottom end of the learning curve when it comes to microcontrollers.

Anyway, hope this link I provided is useful to some readers here.

Spec57
« Last Edit: Fri, 08 January 2010, 12:13:15 by Specter_57 »

Offline dmw

  • Posts: 84
    • http://humblehacker.com
HumbleHacker keyboard firmware
« Reply #162 on: Sun, 30 May 2010, 09:30:38 »
Hey all,

After a long hiatus, i'm finally back working on my keyboard project.  I've almost completely rewritten and open-sourced my firmware.  You can find it on github.

It has many features, such as:

  • Multiple layers, invoked through either momentary or toggle keys
  • key maps specified in a simple text file format
  • multi-key macros
  • a special "matrix discovery" mode to help you figure out your keyboard's matrix
  • a key can be mapped to modifiers + key (to be able to produce shifted keys without hitting shift, for example)
  • a single key can have different bindings depending on what modifier keys are pressed (allowing you to completely divorce a key from its shifted state)


Those last two work, but are still in development to iron out issues when keys overlap. The HID keyboard protocol does not make this easy, since keys and their shifted states are tied up in a single code (e.g. 'Keyboard 1  and !').

The code has only been tested on the AT90USB1287, but should run on any chip in the AT90USB series.  It's currently running on my HumbleHack'd TypeMatrix 2030.

I've started using github's issue tracker.  You can take a look there to see what I've got planned, or add your own feature requests.  I could also use some help in figuring out the best way to solve the key overlap problem alluded to above.
« Last Edit: Sun, 30 May 2010, 10:58:55 by dmw »

Offline dmw

  • Posts: 84
    • http://humblehacker.com
"Open Source" Generic keyboard controller.
« Reply #163 on: Sun, 30 May 2010, 09:57:02 »
Exactly.  That's what I did with the 2030.  It's nice to see that the price on the USBKEY has come down so much.  I paid $75 each for mine a few years ago.



I thought I'd post some examples of the keyboard definition files.  First, here's the keyboard matrix for the 2030.  Each cell in the table is filled with a 'location code', which is arbirtrary, but must also be used in the keymaps.

Code: [Select]
Matrix:2030-USB rev:197
/*            0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17 */
/* 0 */ Row: 7L, --, 7J, 7M, --, --, --, --, 7K, 1N, 5L, 6C, --, 5H, 5F, --, --, --
/* 1 */ Row: 1O, --, --, --, --, 6N, --, --, --, 4G, --, 5K, 5J, 5I, 5E, 5D, 5C, 5B
/* 2 */ Row: 6E, --, 7C, --, --, --, --, --, 6L, 1M, 4M, --, 1H, 4H, 4F, 1E, --, 1A
/* 3 */ Row: 1G, --, --, 3O, --, 6A, --, 6O, 6K, 1K, 2M, 1J, 2N, 2H, 2F, 1C, 1B, 2A
/* 4 */ Row: --, --, --, --, 6J, --, 4N, --, 5O, 5M, 4L, 4K, 4J, 4I, 4E, 4D, 4C, 4B
/* 5 */ Row: --, --, --, --, 7A, 1F, --, 7O, 6M, 1L, 2L, 2K, 2J, 2I, 2E, 2D, 2C, 2B
/* 6 */ Row: --, 7B, --, --, 6D, --, 4A, --, 2O, 2G, 3M, 1I, 3N, 3H, 3F, 1D, 4O, 3A
/* 7 */ Row: --, --, --, --, --, --, --, --, 6B, --, 3L, 3K, 3J, 3I, 3E, 3D, 3C, 3B

This is the US layout.  The 'tl:' and 'bl:' are key labels that are currently not used, but may be in the future (to generate keyboard images, for example).  They at least serve as a measure of documentation on what the key is expected to produce.
 
The 'base:' keyword shows that keymaps can be based on other keymaps.

the 'default' keyword says that this is the default keymap, i.e. the one that will be set when the keyboard is plugged in.

Code: [Select]
KeyMap:US base:Common default rev:205

  /* Row 3 */
  Key:2A Map:`_and_~           tl:"~"    bl:"`"
  Key:2B Map:1_and_!           tl:"!"    bl:"1"
  Key:2C Map:2_and_@           tl:"@"    bl:"2"
  Key:2D Map:3_and_#           tl:"#"    bl:"3"
  Key:2E Map:4_and_$           tl:"$"    bl:"4"
  Key:2F Map:5_and_%           tl:"%"    bl:"5"
  Key:2H Map:6_and_^           tl:"^"    bl:"6"
  Key:2I Map:7_and_&           tl:"&"    bl:"7"
  Key:2J Map:8_and_*           tl:"*"    bl:"8"
  Key:2K Map:9_and_(           tl:"("    bl:"9"
  Key:2L Map:0_and_)           tl:")"    bl:"0"
  Key:2M Map:-_and_Underscore  tl:"__"   bl:"-"
  Key:2N Map:=_and_+           tl:"+"    bl:":"

  /* Row 3 */
  Key:3B Map:q_and_Q           tl:"Q"
  Key:3C Map:w_and_W           tl:"W"
  Key:3D Map:e_and_E           tl:"E"
  Key:3E Map:r_and_R           tl:"R"
  Key:3F Map:t_and_T           tl:"T"
  Key:3H Map:y_and_Y           tl:"Y"
  Key:3I Map:u_and_U           tl:"U"
  Key:3J Map:i_and_I           tl:"I"
  Key:3K Map:o_and_O           tl:"O"
  Key:3L Map:p_and_P           tl:"P"
  Key:3M Map:[_and_{           tl:"{"    bl:"["
  Key:3N Map:]_and_}           tl:"}"    bl:"]"

  /* Row 4 */
  Key:4B Map:a_and_A           tl:"A"
  Key:4C Map:s_and_S           tl:"S"
  Key:4D Map:d_and_D           tl:"D"
  Key:4E Map:f_and_F           tl:"F"
  Key:4F Map:g_and_G           tl:"G"
  Key:4H Map:h_and_H           tl:"H"
  Key:4I Map:j_and_J           tl:"J"
  Key:4J Map:k_and_K           tl:"K"
  Key:4K Map:l_and_L           tl:"L"
  Key:4L Map:;_and_\:          tl:":"    bl:";"
  Key:4M Map:\'_and_\"         tl:"\""   bl:"'"

  /* Row 5 */
  Key:5B Map:z_and_Z           tl:"Z"
  Key:5C Map:x_and_X           tl:"X"
  Key:5D Map:c_and_C           tl:"C"
  Key:5E Map:v_and_V           tl:"V"
  Key:5F Map:b_and_B           tl:"B"
  Key:5H Map:n_and_N           tl:"N"
  Key:5I Map:m_and_M           tl:"M"
  Key:5J Map:,_and_\<          tl:"<"    bl:","
  Key:5K Map:._and_\>          tl:">"    bl:"."
  Key:5L Map:/_and_?           tl:"?"    bl:"/"
  Key:5M Map:\_and_|           tl:"|"    bl:"\\"

And here is a Programmer Dvorak layout, which illustrates some of the more advanced key bindings possible.  

Basically, modifiers are placed in <>, and separated by | (e.g. ).  Modifiers appearing before the Map: keyword are called pre-modifiers.  They change what the key will do when combined with the given modifier.  

Modifiers appearing after the Map: keyword are just called modifiers.  They affect what modifier keys are sent to the computer along with the given key binding.

So given this, and looking at key 2A, hitting the key by itself will produce '$', while hitting the key with will produce '~'.

Code: [Select]
KeyMap:pDV base:US rev:57

  /* Row 2 */
  Key:2A         Map:4_and_$              bl:"$"
          Map:`_and_~      tl:"~"
  Key:2B         Map:7_and_&              bl:"&"
          Map:5_and_%      tl:"%"
  Key:2C         Map:[_and_{                     bl:"["
          Map:7_and_&             tl:"7"
  Key:2D         Map:[_and_{              bl:"{"
          Map:5_and_%             tl:"5"
  Key:2E         Map:]_and_}              bl:"}"
          Map:3_and_#             tl:"3"
  Key:2F         Map:9_and_(              bl:"("
          Map:1_and_!             tl:"1"
  Key:2H         Map:=_and_+                     bl:"=
          Map:9_and_(             tl:"9"
  Key:2I         Map:8_and_*              bl:"*"
          Map:0_and_)             tl:"0"
  Key:2J         Map:0_and_)              bl:")"
          Map:2_and_@             tl:"2"
  Key:2K         Map:=_and_+              bl:"+"
          Map:4_and_$             tl:"4"
  Key:2L         Map:]_and_}                     bl:]"
          Map:6_and_^             tl:"6"
  Key:2M         Map:1_and_!              bl:"!"
          Map:8_and_*             tl:"8"
  Key:2N         Map:3_and_#              bl:"#"
          Map:`_and_~             tl:"'"

  /* Row 3 */
  Key:3B          Map:;_and_\:           tl:":"  bl:";"
  Key:3C          Map:,_and_\<           tl:"<"  bl:","
  Key:3D          Map:._and_\>           tl:">"  bl:"."
  Key:3E          Map:p_and_P            tl:"P"
  Key:3F          Map:y_and_Y            tl:"Y"
  Key:3H          Map:f_and_F            tl:"F"
  Key:3I          Map:g_and_G            tl:"G"
  Key:3J          Map:c_and_C            tl:"C"
  Key:3K          Map:r_and_R            tl:"R"
  Key:3L          Map:l_and_L            tl:"L"
  Key:3M          Map:/_and_?            tl:"?"  bl:"/"
  Key:3N          Map:2_and_@    tl:"@"
          Map:6_and_^    bl:"^"

  /* Row 4 */
  Key:4C  Map:o_and_O                    tl:"O"
  Key:4D  Map:e_and_E                    tl:"E"
  Key:4E  Map:u_and_U                    tl:"U"
  Key:4F  Map:i_and_I                    tl:"I"
  Key:4H  Map:d_and_D                    tl:"D"
  Key:4I  Map:h_and_H                    tl:"H"
  Key:4J  Map:t_and_T                    tl:"T"
  Key:4K  Map:n_and_N                    tl:"N"
  Key:4L  Map:s_and_S                    tl:"S"
  Key:4M  Map:-_and_Underscore           tl:"__" bl:"-"

  /* Row 5 */
  Key:5B  Map:\'_and_\"                  tl:"\"" bl:"\'"
  Key:5C  Map:q_and_Q                    tl:"Q"
  Key:5D  Map:j_and_J                    tl:"J"
  Key:5E  Map:k_and_K                    tl:"K"
  Key:5F  Map:x_and_X                    tl:"X"
  Key:5H  Map:b_and_B                    tl:"B"
  Key:5J  Map:w_and_W                    tl:"W"
  Key:5K  Map:v_and_V                    tl:"V"
  Key:5L  Map:z_and_Z                    tl:"Z"
« Last Edit: Sun, 30 May 2010, 10:36:28 by dmw »

Offline dmw

  • Posts: 84
    • http://humblehacker.com
"Open Source" Generic keyboard controller.
« Reply #164 on: Sun, 30 May 2010, 19:10:55 »
Ok, I just finished reading through all the posts in this thread.  Maybe should have done that _before_ I posted. ;)

I know I'm late to the game, but I have to say... Mnemonix, awesome job with your controller board and firmware!  If I had access to this a while ago, I probably would have never decided to try to do it myself.  I'm also very excited about the Teensy++.  With that, I see no need to build my own controller board.

Mnemonix, there's a lot of overlap between our projects.  I would like to borrow some of your ideas for my firmware, if you don't have any objections.  For example, I have been planning to add some method of programming the keyboard without re-flashing the firmware, but I wasn't sure how to go about it.  Looks like you have that feature already.  It seems from reading your posts that you have a lot of experience with this kind of development.  I'd like to pick your brain on a few things, as this is my first foray into MCU development.  I have a lot of ideas - would you consider collaborating?  Or have you moved on from this project?

Offline ricercar

  • * Elevated Elder
  • Posts: 1697
  • Location: Silicon Valley
  • mostly abides
"Open Source" Generic keyboard controller.
« Reply #165 on: Sun, 30 May 2010, 19:33:39 »
You didn't to start with dog-dares this time? :laugh:

I trolled Geekhack and all I got was an eponymous SPOS.

Offline sethstorm

  • Posts: 257
"Open Source" Generic keyboard controller.
« Reply #166 on: Mon, 31 May 2010, 00:32:32 »
Quote from: ripster;188209
Thanks.

OK, who at Geekhack is gonna go 2nd?   I'd volunteer but I'm in the 25% of the Geekhack population that isn't in IT.  I don't even have a beard.

Show Image


On using the controller?  Would this be adaptable for the card-edge connector that model M membranes present?  Count me in.

It would seem to be quite usable to use this, the firmware, and attach it to my Wheelwriter 5.  It has a nice, small 13x8 matrix.
Current:
IBM: Model M: 1391401, 1386887 Terminal 122 Key 
IBM: Model F: 6110668 Terminal 122 key with Trackpoint and M13 blacks
IBM: Specialty: Wheelwriter 5, Boltmodded.  AT F layout, M technology. 
Lexmark/IBM: M13 Black Trackpoint
NCR:HO150-STD1-01-17 Decision Mate V - The other Gray NCR linear.


Offline timofonic

  • Posts: 59
"Open Source" Generic keyboard controller.
« Reply #167 on: Wed, 02 June 2010, 21:22:06 »
Interesting...

Some site or wiki page showing the schematics plus the link to the firmware code? Or update the first page :)

Also...

Aren't most USB adapters sucky? I mean about unable to push several keys at once.

Anyway, it IBM keyboards are 2kro. It could be nice to replace the original controller by a N-key rollover capable one.
« Last Edit: Wed, 02 June 2010, 23:04:33 by timofonic »

Offline noctua

  • Posts: 188
"Open Source" Generic keyboard controller.
« Reply #168 on: Thu, 03 June 2010, 04:26:55 »
Quote from: timofonic;189024
Interesting...

Some site or wiki page showing the schematics plus the link to the firmware code? Or update the first page :)

Also...

Aren't most USB adapters sucky? I mean about unable to push several keys at once.

Anyway, it IBM keyboards are 2kro. It could be nice to replace the original controller by a N-key rollover capable one.


You may notice there exist a big difference between a idea and doing so, for
example you have to check the matrix carefully, some needs additional
1N4148 (or similar), some firmware code needs to revise..
Selfmade Keyboard I (done)
DT225 CH Trackball

Selfmade Keyboard II (95% completed)
L-Trac CST2545W-RC Trackball

both use Cherry MX Blue switches, an Teensy++ controller and have an Colemak layout

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #169 on: Thu, 03 June 2010, 15:47:06 »
(Sorry for the late answer, but I'm quite busy at the moment.)

Quote from: dmw;188364
Ok, I just finished reading through all the posts in this thread.  Maybe should have done that _before_ I posted. ;)

I know I'm late to the game, but I have to say... Mnemonix, awesome job with your controller board and firmware!  If I had access to this a while ago, I probably would have never decided to try to do it myself.  I'm also very excited about the Teensy++.  With that, I see no need to build my own controller board.


Thank you! :)

Good you've decided to try it yourself, diversity is good. Also, thanks for sharing your work. As I understand it, your code will only work on USB-enabled AVRs. So when extending my own code for these I can take a look at your code how you've done it.
I've also thought about ordering a Teensy++ to play around with, but that will have to wait for now.

Quote from: dmw;188364
Mnemonix, there's a lot of overlap between our projects.  I would like to borrow some of your ideas for my firmware, if you don't have any objections. For example, I have been planning to add some method of programming the keyboard without re-flashing the firmware, but I wasn't sure how to go about it.  Looks like you have that feature already.


Well, it's all GPL'ed code, so, by definition copying is OK as long as your code is GPL-compatible, too, or if the copied code is trivial. Otherwise, borrowing ideas is always allowed, of course. :)

Concerning the programming of the keyboard, I am using the AVR's internal EEPROM for storing alternative key maps and configuration data. The tricky part was to find a method for communicating with the keyboard so that data other than HID packages could be exchanged. Fortunately, there is libusb which is taking care of the nasty OS-dependent details (detaching the HID driver from the device, re-attaching it later, sending/receiving data).

Quote from: dmw;188364
It seems from reading your posts that you have a lot of experience with this kind of development.  I'd like to pick your brain on a few things, as this is my first foray into MCU development.  I have a lot of ideas - would you consider collaborating?  Or have you moved on from this project?


This was my first microcontroller-based project, too, but I have done some VHDL and other low-level stuff before, plus lots of experience in C and software development in general. I may seem more experienced than I really am. My MCU skills are currently improving, though, since I've got a new job in embedded systems development. Now I am getting paid for having fun. :)

I haven't moved from the project, but I have less time to work on it -- and it is working for me already anyway, so there's not much left to do from my perspective.
Still, if you have questions or would like to discuss ideas, feel free to do so (here in public or PM). I'd love to hear your ideas.

Offline JBert

  • Posts: 764
"Open Source" Generic keyboard controller.
« Reply #170 on: Thu, 03 June 2010, 16:18:52 »
Quote from: timofonic;189024
Anyway, it IBM keyboards are 2kro. It could be nice to replace the original controller by a N-key rollover capable one.
Forget about it. You need to alter the matrix before you can use an NKRO controller, something which isn't possible seeing how the matrix is printed on non-sticky mylar sheets.

The only NKRO IBM keyboards are the model Fs or earlier models.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline Halo

  • Posts: 1
"Open Source" Generic keyboard controller.
« Reply #171 on: Wed, 09 June 2010, 04:39:03 »
Quote from: Mnemonix;189301

I haven't moved from the project, but I have less time to work on it -- and it is working for me already anyway, so there's not much left to do from my perspective.


Weren't you originally wishing to implement trackpoint/trackball support?
Your IBM M4-1 has one so I hope I didn't just miss mention of support.

Thank you for sharing your kbupgrade by the way. :)

Offline Mnemonix

  • Posts: 163
"Open Source" Generic keyboard controller.
« Reply #172 on: Wed, 09 June 2010, 13:47:43 »
Quote from: Halo;191211
Weren't you originally wishing to implement trackpoint/trackball support?
Your IBM M4-1 has one so I hope I didn't just miss mention of support.

Thank you for sharing your kbupgrade by the way. :)

Yes, trackpoint support is still missing. Didn't think of it when writing my last message. :)
As a matter of fact, trackpoint support is getting more interesting for me right now because my desk is usually full of stuff at work, so throwing away the mouse would definitely help (I'm using the M4-1 at work).

So, for the keyboard part, there's not much left to do; trackpoint is still planned. Concerning the keyboard support, getting the Model F to work I got from Meltie some months ago is on top of my list.

Edit: Oh, welcome to Geekhack!

Offline chimera15

  • Posts: 1441
"Open Source" Generic keyboard controller.
« Reply #173 on: Sat, 19 June 2010, 10:45:41 »
I'm reading through this, is there a ready made program to upload to a teensy++ that can define a matrix or not?

Is DMW's the most complete?  I need to compile it with a c++ compiler?  Is there a walkthrough of what I need to do exactly to get it running on my teensy++.  I've never had a ton of luck compiling programs before.

Is there precompiled, or an exact list of what I need to do?
« Last Edit: Sat, 19 June 2010, 11:01:18 by chimera15 »
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


Offline dmw

  • Posts: 84
    • http://humblehacker.com
"Open Source" Generic keyboard controller.
« Reply #174 on: Sat, 19 June 2010, 12:07:10 »
chimera15,

If you want to try to use my firmware, I'll be happy to help you get it going.  I do have it compiled and running on my Teensy++ 2.0.  What keyboard do you have in mind for it?

You need a C compiler to compile it - avr-gcc to be exact.  There are different packages for each OS.  WinAVR for Windows and  CrossPack for Mac.  You'll have to use your favorite package manager to install avr-gcc on Linux.

You can find my source code at http://github.com/humblehacker/keyboard.  If you're not familiar with git, you can download a tarball or zipfile from http://github.com/humblehacker/keyboard/downloads. Choose the one labeled 'teensy-test.'
« Last Edit: Sat, 19 June 2010, 12:42:16 by dmw »

Offline noctua

  • Posts: 188
"Open Source" Generic keyboard controller.
« Reply #175 on: Sat, 19 June 2010, 12:17:16 »
To my knowledge there exist no specific adapted version for Teensy++. Some
are based on V-USB other are based on LUFA that i have seen, since the
matrix scan mechanism self is portable to any controller. The bottom line
is therefore the programming of the built-in USB device controller..

We'll see.
Selfmade Keyboard I (done)
DT225 CH Trackball

Selfmade Keyboard II (95% completed)
L-Trac CST2545W-RC Trackball

both use Cherry MX Blue switches, an Teensy++ controller and have an Colemak layout

Offline dfj

  • Posts: 171
  • Location: Canada
  • Visit our irc: #geekhack on libera.chat!
I'll give it a poke too.
« Reply #176 on: Sat, 19 June 2010, 14:41:56 »
Quote from: dmw;194698
chimera15,

You can find my source code at http://github.com/humblehacker/keyboard.  If you're not familiar with git, you can download a tarball or zipfile from http://github.com/humblehacker/keyboard/downloads. Choose the one labeled 'teensy-test.'


I've got a teensy++ and some matrices handy too, I'll give it a shot this weekend, hopefully. Just dl'd yer test...

I've also got a mess of code which is near-release quality, but missing a bunch of mnemonix's features... I want to see which areas you cracked well...
  With a bit of luck, we killed largely different problems. :)
(e.g. I kilt the 6-key/nkro problem in USB for my driver... but I din' bother doing software-remappable keys...)

   I've used atmega168s, the teensy++ and the atmega 32 on this - din' quite manage to get a ps2-usb converter working on an 8-pin tiny yet, though. :)

yup,
dfj
Fave Switch manus: IBM, Topre, Matias, ...

Offline dfj

  • Posts: 171
  • Location: Canada
  • Visit our irc: #geekhack on libera.chat!
An advantage of a pinless Teensy++
« Reply #177 on: Sat, 19 June 2010, 17:20:44 »
- is that one can mount double-height pins in it for prototyping. Once you are happy, you can snip the bottoms, tops or use another one to lay flat inside yer keyboard.


dfj
Fave Switch manus: IBM, Topre, Matias, ...

Offline chimera15

  • Posts: 1441
"Open Source" Generic keyboard controller.
« Reply #178 on: Sat, 19 June 2010, 18:03:31 »
Quote from: dmw;194698
chimera15,

If you want to try to use my firmware, I'll be happy to help you get it going.  I do have it compiled and running on my Teensy++ 2.0.  What keyboard do you have in mind for it?

You need a C compiler to compile it - avr-gcc to be exact.  There are different packages for each OS.  WinAVR for Windows and  CrossPack for Mac.  You'll have to use your favorite package manager to install avr-gcc on Linux.

You can find my source code at http://github.com/humblehacker/keyboard.  If you're not familiar with git, you can download a tarball or zipfile from http://github.com/humblehacker/keyboard/downloads. Choose the one labeled 'teensy-test.'

I'm going to try to build a scratchbuild with it, with this layout:
http://geekhack.org/showwiki.php?title=Island:10454

I'm using Windows...

Is it possible to create the two function keys like I describe with this programming?

I'm installing winavr, is that all I need?

Alright, I've installed winavr, and downloaded the zip file.....now what. lol
« Last Edit: Sat, 19 June 2010, 21:02:35 by chimera15 »
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


Offline dmw

  • Posts: 84
    • http://humblehacker.com
"Open Source" Generic keyboard controller.
« Reply #179 on: Sat, 19 June 2010, 21:39:43 »
Quote from: chimera15;194785
I'm going to try to build a scratchbuild with it, with this layout:
http://geekhack.org/showwiki.php?title=Island:10454

Do you know the keyboard matrix already?  If you don't, my code includes a custom build option that will help you determine the matrix.

Quote
Is it possible to create the two function keys like I describe with this programming?

You can have as many function keys as you like.

Quote
I'm installing winavr, is that all I need?

There is a ruby script code generator that turns the keymap files into code.  If you don't have ruby installed, you'll have trouble building. You can get ruby for Windows here. There are additional dependencies once you've installed ruby.  If you don't want to install ruby, I can build the keymaps for you after you've created your keymap files.  

Quote
Alright, I've installed winavr, and downloaded the zip file.....now what. lol

  • Unzip the zip file
  • Navigate to the directory keyboard/firmware
  • make a copy the directory kb_reference.  Call it whatever you like - kb_chimera, for example.
  • from the command-line, navigate to keyboard/firmware/kb_chimera
  • type 'make'

This will build the reference firmware, which is just a starting point for doing your own keyboard.  There are some files you'll need to modify to actually build a working firmware.  Take a look at keyboard/firmware/kb_chimera/layouts to get an idea.

Once you reach this point, contact me and we'll take it further.  Maybe PM me, so we don't clog up this thread.  You can also reach me on freenode at ##humblehacker, if you do IRC.
« Last Edit: Sat, 19 June 2010, 22:16:51 by dmw »

Offline Specter_57

  • Posts: 143
"Open Source" Generic keyboard controller.
« Reply #180 on: Tue, 29 June 2010, 06:47:05 »
.

Here is something that may be of interest, related to this thread...see my post in the "Making a Cheap Model M USB Controller" thread, post #257 on page 18:

http://geekhack.org/showwiki.php?title=Island:8406&do=comments&page=18

..............
Spec_57

Offline chimera15

  • Posts: 1441
"Open Source" Generic keyboard controller.
« Reply #181 on: Tue, 29 June 2010, 07:24:58 »
DMW wins. lol
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


Offline repeatrate

  • Posts: 5
"Open Source" Generic keyboard controller.
« Reply #182 on: Mon, 24 January 2011, 23:26:58 »
nvm worked great.
« Last Edit: Tue, 25 January 2011, 08:19:37 by repeatrate »

Offline intealls

  • Posts: 63
"Open Source" Generic keyboard controller.
« Reply #183 on: Wed, 26 January 2011, 06:36:57 »
I just wanted to say thanks to dmw, your firmware is absolutely awesome. Finished wiring up one of my AEK II's yesterday, and it works fabulously. Thanks to you, I can bring my dvorak and fn-hax to every computer on the planet. THANK YOU! :D

I think you can all tell where I'm going to chop it off. :) The layout is very MiniGuru-ish at the moment.


Offline Jaga

  • Posts: 2
"Open Source" Generic keyboard controller.
« Reply #184 on: Mon, 23 January 2012, 06:47:13 »
Hello!
I'm interested in building custom keyboard. I don't like stuff for sale.
I need a custom arrangement of keys, some custom keys (like compose, dead keys etc.), custom codes from keys and of course custom keycaps.
I need a custom controller, I think. But I don't know the full technology. Is there a FAQ of making a keyboard from scratch?

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
"Open Source" Generic keyboard controller.
« Reply #185 on: Mon, 23 January 2012, 07:14:15 »
Kinda sorta.

Here
Here
Here
Here

There are likely to be several more, but that should get you pretty well on your way.  There are a number of already developed KB firmwares for the teensy, or you can go with an Aikon, or Chamelon (available on TaoBao), or some other controller.
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline Jaga

  • Posts: 2
"Open Source" Generic keyboard controller.
« Reply #186 on: Mon, 23 January 2012, 07:24:04 »
Thank you. And sorry me not searching properly.

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
"Open Source" Generic keyboard controller.
« Reply #187 on: Mon, 23 January 2012, 07:26:22 »
Unfortunately with GH sometimes that requires already knowing what you're searching for and knowing to use google and site:geekhack.org to do it.  :)
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline Input Nirvana

  • Master of the Calculated Risk
  • Posts: 2316
  • Location: Somewhere in the San Francisco Bay area/Best Coast
  • If I tell ya, I'll hafta kill ya
"Open Source" Generic keyboard controller.
« Reply #188 on: Fri, 27 January 2012, 02:02:53 »
So what is the status of this? Is there current work still being done? Or is it at it's final point?
Kinesis Advantage cut into 2 halves | RollerMouse Free 2 | Apple Magic Trackpad | Colemak
Evil Screaming Flying Door Monkeys From Hell                     Proudly GeekWhacking since 2009
Things change, things stay the same                                        Thanks much, Smallfry  
I AM THE REAPER . . . BECAUSE I KILL IT
~retired from forum activities 2015~

Offline Niy

  • Posts: 1
"Open Source" Generic keyboard controller.
« Reply #189 on: Wed, 18 April 2012, 09:50:43 »
I guess this project is dead -- tho I really hope there are some guys out there working on it.
But I'd be happy to be part of a restart of this project.

Offline uberben

  • Posts: 62
"Open Source" Generic keyboard controller.
« Reply #190 on: Wed, 18 April 2012, 11:09:08 »
Quote from: Niy;577891
I guess this project is dead -- tho I really hope there are some guys out there working on it.
But I'd be happy to be part of a restart of this project.

I'll be starting a custom, generic keyboard controller project shortly that I intend to release as open source. I'm building it for my Kinesis Contoured keyboard, but I intend to make it as generic as possible. It will be a combination USB/bluetooth (though it could easily be made bluetooth optional) keyboard controller and I have plans to integrate a pointing device as well. I've already got many of the parts, I just need to find some time to start playing with it.

My current plan is to kind of make a combination of the HumbleHacker keyboard and the Keyglove. Once I get started, I'll probably start a thread here with details and progress updates. I'm all for working with others to speed up development.

Offline komar007

  • Posts: 712
  • Location: Poland
    • komar's blog
"Open Source" Generic keyboard controller.
« Reply #191 on: Wed, 18 April 2012, 14:06:17 »
Could you tell some more details about the controller, hardware specifically?
I already have a working codebase for AVR with a USB HID nkro stack.
I can release it as open-source if necessary. I don't have much time to end this project, so if it can help, let me know.
GH60 rev. B w/ ali's case|Cherry G80-3000 HFU/05|IBM Model M (51G8572)
Check out the GH60 project! | How to make a keyboard

Offline uberben

  • Posts: 62
"Open Source" Generic keyboard controller.
« Reply #192 on: Wed, 18 April 2012, 14:30:41 »
Quote from: komar007;578130
Could you tell some more details about the controller, hardware specifically?
I already have a working codebase for AVR with a USB HID nkro stack.
I can release it as open-source if necessary. I don't have much time to end this project, so if it can help, let me know.

The dev board I have is the 32u4 breakout from Adafruit. The bluetooth module is the Bluegiga WT-12 (I have this breakout board). Ultimately, I hope to make a custom circuit board for it. If it is going to be a universal controller, I might need some help finding an appropriate set of dimensions for the board to maximize compatibility.

I haven't started on software yet, but I intend to use the LUFA stack for USB HID to maintain maximum open-source code. My goal is ultimately to have nkro, but 6kro compatibility for boot is desired too. I have seen some projects with this, though I haven't dug much into the details of their implementation. The one that caught my eye though was just using the standard 6kro headers for when there are <7 keys pressed, then switching to the extended headers when there are more. Seems simple enough to me, but like I said, I haven't started coding it up yet.

The more code examples I can get my hands on, the better. I would be glad to us your code as an example.

Offline hasu

  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
"Open Source" Generic keyboard controller.
« Reply #193 on: Wed, 18 April 2012, 19:11:23 »
I used WT12 from Jeff for HID stack of my keyboard and I found firmware 4.0 has some bugs on HID. I think you should get 4.1beta or 5.0beta from Bluegiga support. I'm using 4.1beta but not try 5.0beta yet.
I have some lag on the Bluetooth module to register keys, I don't want to use this keyboard for serious typing work though I'm not sure whether this lag is normal or not on Bluetooth. I have no Bluetooth keyboard excepting this DIY board. I guess I should try 5.0beta or use HCI instead of iWRAP.

FYI: I have a memo about NKRO on USB.
https://github.com/tmk/tmk_keyboard/blob/master/USB_NKRO.txt

Offline uberben

  • Posts: 62
"Open Source" Generic keyboard controller.
« Reply #194 on: Wed, 18 April 2012, 19:36:51 »
Ya, I have heard that the 5.0 software should work a lot better for HID than the 4.0. Is it a simple process to upgrade the module?

Offline hasu

  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
"Open Source" Generic keyboard controller.
« Reply #195 on: Wed, 18 April 2012, 20:42:14 »
Not a lot of work for upgrade itself.
But to get account from them was a bit hell. They didn't accept my gmail address so I had to setup a new email of a neat domain :)