Author Topic: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox  (Read 52539 times)

0 Members and 1 Guest are viewing this topic.

Offline vvp

  • Posts: 886
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #50 on: Mon, 02 February 2015, 06:54:39 »
Nice. I'm planning to do something like this too. Though I would like to put there ATxmega128A4U. Do you happen to know whether the address decoders and the EEPROMs on the original PCB would work with Vcc of 3.3V ?
I'm not sure whether I'll need to replace also the original PCB.
Thanks for the nice firmware.

Offline chrisandreae

  • Thread Starter
  • Posts: 43
  • Location: Tokyo, Japan
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #51 on: Fri, 06 February 2015, 05:59:21 »
Nice. I'm planning to do something like this too. Though I would like to put there ATxmega128A4U. Do you happen to know whether the address decoders and the EEPROMs on the original PCB would work with Vcc of 3.3V ?
I'm not sure whether I'll need to replace also the original PCB.
Thanks for the nice firmware.

Looking at datasheets (http://ecee.colorado.edu/~mcclurel/sn74ls138rev5.pdf, http://www.atmel.com/Images/doc0105.pdf), the EEPROM should be just fine. The decoders, maybe: they require a 5V Vcc, but will register input HIGH at 2.0V, and their output HIGH is typically 3.5v. The ATxmega128A4U datasheet states that the absolute maximum pin voltage is Vcc+0.5v. So you'd probably get away with it just fine, particularly with series resistors to limit the current.

Edit: you could always switch out the 74LS138 for 74HC138, a more modern CMOS variant which will handle 3.3v just fine.

However, one thing that you may have trouble with is the buzzer: my Kinesis features an Intervox BRT1209PF-06 (datasheet) whose operating voltage is 4-8V.
« Last Edit: Sat, 07 February 2015, 03:27:39 by chrisandreae »

Offline vvp

  • Posts: 886
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #52 on: Sat, 07 February 2015, 05:14:34 »
I can switch the buzzer. I will need to hack the PCB a bit anyway since I would like to add also 2 more buttons to each thumb cluster so that it has Maltron like thumb clusters. This is still far future since I want to finish v0.7 of Katy first.

I'm not decided whether I hack the original PCB or just replace it and also add an LCD support with the new PCB.

The rubber keys do not have diodes. That means the address decoders must be somehow able to handle a short between their outputs since when e.g. both F6 and F8 are pressed at the same time then U4-Y0 and U4-Y1 are shorted. Or is the resistance of the rubber keys high enough that it is not really a short? The original kinesis firmware will detect only one of the simultaneously pressed rubber keys in one column.

It looks safer to rather use something which allows to set output to high impedance for the rubber key matrix rows. E.g. the micro-controller pins directly. Only 3 more pins needed for that.

Offline chrisandreae

  • Thread Starter
  • Posts: 43
  • Location: Tokyo, Japan
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #53 on: Wed, 11 February 2015, 06:46:53 »
The rubber keys do not have diodes. That means the address decoders must be somehow able to handle a short between their outputs since when e.g. both F6 and F8 are pressed at the same time then U4-Y0 and U4-Y1 are shorted. Or is the resistance of the rubber keys high enough that it is not really a short? The original kinesis firmware will detect only one of the simultaneously pressed rubber keys in one column.

It looks safer to rather use something which allows to set output to high impedance for the rubber key matrix rows. E.g. the micro-controller pins directly. Only 3 more pins needed for that.

I see the issue that you're pointing out, but since it's part of the original design of the Kinesis, I'm reasonably prepared to assume it's not going to become any (more of) a problem in a derived design. I've certainly never burned out a Kinesis by chording the function keys.

Looking at the datasheet for the demultiplexer, there's:
Quote
IOS | Short Circuit Current (Note 1) | –20 (min) | –100 (max) | mA
Note 1: Not more than one output should be shorted at a time, nor for more than 1 second.
Perhaps this combined with the high scan rate is why it doesn't seem to be an issue in practice.

By the way, is your modified source with support for the ATxmega online anywhere?

Offline vvp

  • Posts: 886
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #54 on: Thu, 12 February 2015, 13:22:07 »
Right. I would not be afraid to use the original address decoder since it works ok. But the possible shorts should be considered if I would need to replace it.

The port to ATxmega128a4u is not published yet. I'll let you know when it is out. The port handles only Katy's controller since I do not have any ATxmega controller for Erogodox or Kinesis upgrade. Also Ergodox/Kinesis are probably broken because of the other changes added for Katy (like e.g. the layer shift keys).

Otherwise the port for ATxmega was easy. It is more or less only the LUFA upgrade to the latest version and then it just works. It is also not tested well yet since I do not have a case finished for Katy v0.7 (which is the first one using ATxmega).

Offline nomaded

  • Posts: 197
  • Location: Andover, MA
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #55 on: Tue, 09 June 2015, 13:17:00 »
I've designed a new double-sided PCB for the Kinesis, suitable for professional manufacture, which should reduce the effort required to get your hands on one. Schematics and Gerber files can be found here, or they can be ordered from the DirtyPCBs store here

(Attachment Link)
(Attachment Link)

Hi Chris,

What else would I need to order so I can use the boards from Dirty PCB? Looking through your github project, it's not clear what else is needed, like the ribbon cable in your photos.

Thanks.
Dvorak
ErgoDox fullhand (MX Clears) w/Nuclear Green Data SA || Infinity ErgoDox (Zealios 78g tactile) w/SA Retro || Atreus62 (MX Clears) w/Chocolatier || TECK 209 (MX Browns) || TouchStream ST
Kensington Slimblade Trackball || Logitech Cordless Optical Trackman || Apple Magic Trackpad
Current Dvorak-based ErgoDox layout || Current Dvorak-based TECK layout

Offline chrisandreae

  • Thread Starter
  • Posts: 43
  • Location: Tokyo, Japan
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #56 on: Wed, 10 June 2015, 04:03:39 »
What else would I need to order so I can use the boards from Dirty PCB? Looking through your github project, it's not clear what else is needed, like the ribbon cable in your photos.

I didn't make an exact BOM, but here are the things I bought specifically that might not be obvious from the schematic:

Ribbon cable
Ribbon cable connectors
Zener diodes for USB data lines
2mm pin header to connect to existing Kinesis USB cable

Other than that it's just an ATMega32A microcontroller, some 0603 resistors and capacitors in various values, a 16mhz crystal, a small electrolytic capacitor, and a 2.54mm pin header.

Offline krazyderek

  • Posts: 11
  • Location: Burlington, ON, Canada
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #57 on: Sun, 14 June 2015, 09:26:43 »
do you mind expanding on the reasons for the ribbon cable and secondary board? why didn't you just add the microcontroller, 7pin, jumpers, and diode right to the board that plugs into the kinesis socket?
(Building) Dactyl 5x6 (pro purple)
Dactyl Manuform 5x6 (silent reds)
Dactyl Manuform 5x6 (silent browns)
Truly Ergonomic 207/209 (browns)
(Sold) Kinesis Contour Classic (browns)
(Sold) Kinesis Maxim

Offline m0j0

  • Posts: 11
  • Location: Dallas, Texas
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #58 on: Sun, 14 June 2015, 10:09:56 »
Out of curiosity, and forgive me if this is should be obvious, but would this firmware work around the USB 3.0 issue with the Kinesis Advantage and Windows 7?


Offline chrisandreae

  • Thread Starter
  • Posts: 43
  • Location: Tokyo, Japan
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #59 on: Sun, 14 June 2015, 21:17:45 »
do you mind expanding on the reasons for the ribbon cable and secondary board? why didn't you just add the microcontroller, 7pin, jumpers, and diode right to the board that plugs into the kinesis socket?

Space, unfortunately. The Kinesis' microcontroller socket sits right underneath the cylindrical cutout in the case where the cable comes in, so there's very little room to be any larger than the 40-pin DIP footprint of the original chip. My initial design was all-in-one, and required me to cut out a bit of plastic for the case to shut.

I've actually considered porting to a physically smaller microcontroller, just so I can fit everything in between the pins in the DIP socket. I may get around to it some day.

Offline chrisandreae

  • Thread Starter
  • Posts: 43
  • Location: Tokyo, Japan
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #60 on: Sun, 14 June 2015, 21:20:23 »
Out of curiosity, and forgive me if this is should be obvious, but would this firmware work around the USB 3.0 issue with the Kinesis Advantage and Windows 7?

Yep, works fine on USB 3.0 in Windows 7.

Offline vvp

  • Posts: 886
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #61 on: Sun, 19 July 2015, 08:28:50 »
By the way, is your modified source with support for the ATxmega online anywhere?
It is out now: https://github.com/hercek/keyboard-firmware/commits/katy
Your latest branch containing the layer shift and Program/KeyPad key remap support is not merged yet.

There is my own layer shift version there. Other notable things: ATXmega support, newer LUFA version, lower EEPROM requirements and support for macro storage in internal eeprom (i.e. Ergodoxes without external EEPROM can have some macro functionality too).

Your Ergodox and Kinesis support is bitroted. And I cannot fix it by myself since I do not have Ergodox nor Kinesis with your controller. At most, I can make sure they compile. You need to decide whether you would want to merge anything to your branch. If so, I can merge your new branch and make Ergodox and Kinesis options to compile. It will not be soon since I'll need to understand your commits in the layer shift branch first.

Offline stian

  • Posts: 24
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #62 on: Tue, 17 November 2015, 05:49:17 »
Does anyone know specifically which components are needed to build the Kinesis Advantage 2.5 replacement firmware? Is there a BOM available, the information in this thread seems a bit scattered and I need to be sure I order the correct components.

I'd love to have someone build one for me, as I don't have the skills nor the equipment to solder surface mount components.

Aside from that, is there anyone interested in actually soldering one of these for me? I'd be willing to pay for the job of course.

Alternatively are there perhaps other ATmega breakout boards that have the correct amount of pins and pin spacing that could be used to skip the PCB manufacturing process all together? I know @vvp has a fork with support for other ATmega chips. Curious what people's thoughts are on this.
« Last Edit: Tue, 17 November 2015, 06:17:30 by stian »

Offline vvp

  • Posts: 886
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #63 on: Tue, 17 November 2015, 10:50:22 »
Carefull, my branch is for ATXmega and not for ATmega. ATXmega is a bit more powerfull and much less used than ATmega. Although the instruction set is almost the same, the input/output system is significantly different.
I have a plan to make my own ATXmega controller board for my old kinesis but there is no timeframe and it is possible I will not ever do it.

My port is for ATXmega128A4U (which has 34 GPIO pins) and it is specifically for my Katy keyboard. It is not usable with chrisandreae's kinesis replacement controler.

Chrisandreae uses ATmega32 chip in his kinesis replacement controller which has 32 GPIO pins.
Ergodox uses ATmega32u4 which has 26 GPIO pins.

If you want to completely avoid SMD soldering than you might be able to use Teensy 2.0 or ArduinoMicro boards. From the schematic it looks like you may be able to fit in 26 pins if you ignore some or all footswitch pins. All 26 pins can be pulled out from Teensy/ArduinoMicro but some of them (e.g. HWB) need to be pulled from inside smd components. It is not a big deal but harder compared to normal pins. You would need to modify the firmware too, i.e. some programming skills are needed.

Offline stian

  • Posts: 24
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #64 on: Wed, 18 November 2015, 01:51:47 »
Carefull, my branch is for ATXmega and not for ATmega. ATXmega is a bit more powerfull and much less used than ATmega. Although the instruction set is almost the same, the input/output system is significantly different.
I have a plan to make my own ATXmega controller board for my old kinesis but there is no timeframe and it is possible I will not ever do it.

My port is for ATXmega128A4U (which has 34 GPIO pins) and it is specifically for my Katy keyboard. It is not usable with chrisandreae's kinesis replacement controler.

Chrisandreae uses ATmega32 chip in his kinesis replacement controller which has 32 GPIO pins.
Ergodox uses ATmega32u4 which has 26 GPIO pins.

If you want to completely avoid SMD soldering than you might be able to use Teensy 2.0 or ArduinoMicro boards. From the schematic it looks like you may be able to fit in 26 pins if you ignore some or all footswitch pins. All 26 pins can be pulled out from Teensy/ArduinoMicro but some of them (e.g. HWB) need to be pulled from inside smd components. It is not a big deal but harder compared to normal pins. You would need to modify the firmware too, i.e. some programming skills are needed.

Thanks for the heads up, my mistake, I didn't notice it was for a different series.

I've thought abuot going down the Teensy2 route with the (ATmega32u4). I wouldn't need the footswitch capabilities, as the only reason I'd use them today would be extend the current firmware's macro capabilities. However, could I instead get a hold of a 32pin ATmega32 with a 32 pin IO configuration? If so I could do the same as Chrisandreae, just with a breakout board and a much less elegant solution.

Offline chrisandreae

  • Thread Starter
  • Posts: 43
  • Location: Tokyo, Japan
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #65 on: Wed, 18 November 2015, 20:36:29 »
The closest to a BOM that I put together was this post:

I didn't make an exact BOM, but here are the things I bought specifically that might not be obvious from the schematic:

Ribbon cable
Ribbon cable connectors
Zener diodes for USB data lines
2mm pin header to connect to existing Kinesis USB cable

Other than that it's just an ATMega32A microcontroller, some 0603 resistors and capacitors in various values, a 16mhz crystal, a small electrolytic capacitor, and a 2.54mm pin header.

If you want to use a Teensy to avoid the surface mount soldering, someone else has designed a pinout here and there's a pull request to my firmware to support it here that I haven't yet gotten around to merging (sorry!).

I'm also currently working on an ARM port, but progress on it stalled a lot when I broke my wrist a couple of months back.

Offline vvp

  • Posts: 886
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #66 on: Thu, 19 November 2015, 04:17:13 »
However, could I instead get a hold of a 32pin ATmega32 with a 32 pin IO configuration? If so I could do the same as Chrisandreae, just with a breakout board and a much less elegant solution.
I'm not aware of a breakout board with ATmega32. You can try to google :)
But really. If you can solder through hole parts then you can solder also SMD with only a very little training (like few hours). And then you learn that soldering SMD is even quicker than through-hole and will start to prefer SMD parts :)

Offline stian

  • Posts: 24
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #67 on: Sun, 06 December 2015, 07:12:55 »
The closest to a BOM that I put together was this post:

I didn't make an exact BOM, but here are the things I bought specifically that might not be obvious from the schematic:

Ribbon cable
Ribbon cable connectors
Zener diodes for USB data lines
2mm pin header to connect to existing Kinesis USB cable

Other than that it's just an ATMega32A microcontroller, some 0603 resistors and capacitors in various values, a 16mhz crystal, a small electrolytic capacitor, and a 2.54mm pin header.

If you want to use a Teensy to avoid the surface mount soldering, someone else has designed a pinout here and there's a pull request to my firmware to support it here that I haven't yet gotten around to merging (sorry!).

I'm also currently working on an ARM port, but progress on it stalled a lot when I broke my wrist a couple of months back.

I've looked at that hackaday project, but the schematic refers to a different Atmel chip, the AT90S58515-P, rather than the onboard AT89S8253.. The schematic refers to pins that doesn't even exist.

How do I use this to use the Teensy? I've literally got everything a lot of it wired up already.
« Last Edit: Sun, 06 December 2015, 07:42:55 by stian »

Offline vvp

  • Posts: 886
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #68 on: Mon, 07 December 2015, 05:10:17 »
How do I use this to use the Teensy? I've literally got everything a lot of it wired up already.
I'm afraid there is no simple answer to this. If somebody did not design the schematic to connect teensy to kinesis advantage then you need to design it yourself. Based on the schematics it should be doable (without handling some foot switch pins). It is a considerable work but it always like that when you choose a non-published not-yet-developed option.

Offline stian

  • Posts: 24
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #69 on: Tue, 08 December 2015, 03:18:45 »
I just want to update this and let everyone know that the TMK schematic seen on the hackaday site works. I'm thinking about creating a new schematic that's more detailed and references the correct chip.

Sad thing is, the Teensy I bought from PJRC doesn't support LUFA, so can't get the 'programmable on the fly' firmware running just yet.

Offline vvp

  • Posts: 886
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #70 on: Tue, 08 December 2015, 04:45:45 »
How could it not support LUFA?
PJRC Teensy is interesting only because of its proprietary 512 B bootloader. The application should not depend on bootloader.
And even if you would want a different bootloader, you still can replace it with an ISP programmer. And if it is just for a bootloader, then you can use something home made like these:
https://www.arduino.cc/en/Hacking/ParallelProgrammer
http://nahians-avr.webs.com/serialportprogrammer.htm
At least the first one works also with avrdude.

Offline stian

  • Posts: 24
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #71 on: Tue, 08 December 2015, 05:56:00 »
How could it not support LUFA?
PJRC Teensy is interesting only because of its proprietary 512 B bootloader. The application should not depend on bootloader.
And even if you would want a different bootloader, you still can replace it with an ISP programmer. And if it is just for a bootloader, then you can use something home made like these:
https://www.arduino.cc/en/Hacking/ParallelProgrammer
http://nahians-avr.webs.com/serialportprogrammer.htm
At least the first one works also with avrdude.

I'm not entirely sure, but I couldn't find much information on it. It's probably possible to flash the AVR itself through serial if the bit is set etc, but I don't want to brick my device either.
I wasn't able to flash the hex, and from what I read the Teensy 2.0 comes with the Halfkey bootloader.

Offline jmhman

  • Posts: 1
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #72 on: Fri, 11 December 2015, 09:39:22 »
Does the firmware for the Kinesis Advantage support the foot pedals? I don't have those, but I have used the internal connections for them to wire up a couple of palm arcade buttons à la Sordna's post: https://geekhack.org/index.php?topic=26579.0. I love them, and as much as I want to use this controller replacement, I really want to keep my palm buttons working (I have the left one mapped to left Shift and the right one shifts to the Keypad Layer).

Offline chrisandreae

  • Thread Starter
  • Posts: 43
  • Location: Tokyo, Japan
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #73 on: Mon, 14 December 2015, 19:41:01 »
Does the firmware for the Kinesis Advantage support the foot pedals? I don't have those, but I have used the internal connections for them to wire up a couple of palm arcade buttons à la Sordna's post: https://geekhack.org/index.php?topic=26579.0. I love them, and as much as I want to use this controller replacement, I really want to keep my palm buttons working (I have the left one mapped to left Shift and the right one shifts to the Keypad Layer).

Yes, -ish. I've routed the connections for them on the PCB, but never actually gotten around to adding them to the matrix scanning in the firmware. It wouldn't be much work at all to do so, I'd just need to dig my foot pedal out to check that I'd done it right.

Offline stian

  • Posts: 24
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #74 on: Wed, 10 February 2016, 03:44:10 »
How could it not support LUFA?
PJRC Teensy is interesting only because of its proprietary 512 B bootloader. The application should not depend on bootloader.
And even if you would want a different bootloader, you still can replace it with an ISP programmer. And if it is just for a bootloader, then you can use something home made like these:
https://www.arduino.cc/en/Hacking/ParallelProgrammer
http://nahians-avr.webs.com/serialportprogrammer.htm
At least the first one works also with avrdude.

I'm not entirely sure, but I couldn't find much information on it. It's probably possible to flash the AVR itself through serial if the bit is set etc, but I don't want to brick my device either.
I wasn't able to flash the hex, and from what I read the Teensy 2.0 comes with the Halfkey bootloader.

Update: I've been able to flash the Teensy 2.0 with the compiled hex but it doesn't want to work nicely. I ordered a Atmega32u4 breakout board and flashed that, works great with this firmware, really appreciate the help with this!

I do have a few questions though. Is it possible to add multiple layers to the GUI config tool? I use colemak and would like to use that natively but also have alt-gr modifiers comparative to the US International layout. I understand I can rewrite the layout under hardware/kinesis.c but I was hoping for an easier solution.

Lastly, it should be possible to remap and create new layers directly with the keyboard, how do I for example reprogram layer 3 to be colemak instead of qwerty? Does anyone have any experience with this? I honestly have some trouble understanding the documentation, beyond that of the capabilities of the Kinesis EEPROM remapping features.

Offline vvp

  • Posts: 886
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #75 on: Wed, 10 February 2016, 05:47:04 »
The firmware supports 10 "configurations" by default. These are actually 10 save spots where you can save your currently used keypad/normal layer.  You can load a configuration using Prg-<LoadCfgKey>-<NumberKey> key combination. You can save the current configuration using Prg-<SaveCfgKey>-<NumberKey>.
One configuration is actually contains a remap definition for your normal + keypad layer.

Probably (for Katy it is different so I'm not sure I have this right for non-Katy keyboards):
LoadCfgKey = L
SaveCfbKey = S

I.e. What is named "configuration" in this firmware is actually named "layer" in other firmwares. While "layer" in this firmware means either normal or keypad layer.

KeyboardClient (qtclient) allows you to modify the current configuration. So e.g. if you want Qwerty and Colemak then
define your querty layout in qtclient and save the configuration under number 1. Then define colemak layout in qtclient and save it under nubmer 2. Then you can quickly load the configuration 1 or 2 with Prg-<LoadCfgKey>-(1|2).

Offline stian

  • Posts: 24
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #76 on: Thu, 11 February 2016, 09:19:48 »
The firmware supports 10 "configurations" by default. These are actually 10 save spots where you can save your currently used keypad/normal layer.  You can load a configuration using Prg-<LoadCfgKey>-<NumberKey> key combination. You can save the current configuration using Prg-<SaveCfgKey>-<NumberKey>.
One configuration is actually contains a remap definition for your normal + keypad layer.

Probably (for Katy it is different so I'm not sure I have this right for non-Katy keyboards):
LoadCfgKey = L
SaveCfbKey = S

I.e. What is named "configuration" in this firmware is actually named "layer" in other firmwares. While "layer" in this firmware means either normal or keypad layer.

KeyboardClient (qtclient) allows you to modify the current configuration. So e.g. if you want Qwerty and Colemak then
define your querty layout in qtclient and save the configuration under number 1. Then define colemak layout in qtclient and save it under nubmer 2. Then you can quickly load the configuration 1 or 2 with Prg-<LoadCfgKey>-(1|2).

From what I can see there's no way to select which layer to save and load from in the GUI, correct? As for doing it through the keyboard I've tried to make a modification to the default layer and then save that to say layer 1, but it spits out "No Layer" on all of the layers I try to save to.. Am I doing something wrong? Or perhaps my GUI client is too old?
« Last Edit: Thu, 11 February 2016, 09:37:27 by stian »

Offline vvp

  • Posts: 886
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #77 on: Thu, 11 February 2016, 11:59:55 »
Not sure what gui client you have. But first naming:

One configuration contains two layers: normal and keypad. You can use KeypadShift/KeypadToggle to switch between them. (I.e. a configuration is actually the remap definition (what USB HID code each key press should emit).

The keyboard has one active (current) configuration and 0-9 inactive configurations.

Active configuration is the one which is used when you type normal text, use numerical keypad (in keypad layer) etc.

Inactive configurations are actually an 10 item array. Each array item is the space where you can store copy of your active configuration (Prg-<SaveCfgKey>-<NumberKey>). And it is also the space from which you can copy the configuration to the active configuration (Prg-<LoadCfgKey>-<NumberKey>).

GUI Client always works only with the active/current configuration only. GUI does not know that the keyboard has also configurations 0-9. GUI knows normal layer and keypad layer, but does not know configurations.

So lets say you have defined two configurations 1 and 2. The current configuration is the copy of 1. You want to modify configuration 2. You can do it like this:
  • Prg-<LoadCfgKey>-2 (copy configuration 2 to the active configuration)
  • modify it with GUI client
  • now the current configuration is different from both configuration 1 and 2
  • Prg-<SaveCfgKey>-2 (actualize configuration 2 so that it is not lost if you load some configuration)

It should work. Some configuration must be saved to e.g. slot 2 before you can load the (previously saved) configuration from the slot 2. If no configuration was saved to it then it prints "No Layer". Some keys must be remapped from default before you can save the active configuration to some slot. Otherwise it prints "No Change".

If you want to use GUI client on windows then the keyboard firmware and the GUI client must be compiled from "windows hack" branch and WinUSB driver must be installed. GUI client and keyboard firmware can be used directly on linux (no need for "windows hack" branch or special drivers).

Offline H-Man

  • Posts: 5
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #78 on: Tue, 12 April 2016, 02:14:09 »
Is there anyway to get one of these kinises conversion boards prebuilt?
Keyboards:
Kinesis Advantage MPC USB/QD I got for $50 [Main]
Kinesis Classic I got for $50 [Backup]
IBM model M from 1984 that I got for free. [Family gaming box]
Microsoft Ergonomic I spent too much money on. [paper weight]

Offline stian

  • Posts: 24
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #79 on: Tue, 26 April 2016, 03:53:27 »
Not sure what gui client you have. But first naming:

One configuration contains two layers: normal and keypad. You can use KeypadShift/KeypadToggle to switch between them. (I.e. a configuration is actually the remap definition (what USB HID code each key press should emit).

The keyboard has one active (current) configuration and 0-9 inactive configurations.

Active configuration is the one which is used when you type normal text, use numerical keypad (in keypad layer) etc.

Inactive configurations are actually an 10 item array. Each array item is the space where you can store copy of your active configuration (Prg-<SaveCfgKey>-<NumberKey>). And it is also the space from which you can copy the configuration to the active configuration (Prg-<LoadCfgKey>-<NumberKey>).

GUI Client always works only with the active/current configuration only. GUI does not know that the keyboard has also configurations 0-9. GUI knows normal layer and keypad layer, but does not know configurations.

So lets say you have defined two configurations 1 and 2. The current configuration is the copy of 1. You want to modify configuration 2. You can do it like this:
  • Prg-<LoadCfgKey>-2 (copy configuration 2 to the active configuration)
  • modify it with GUI client
  • now the current configuration is different from both configuration 1 and 2
  • Prg-<SaveCfgKey>-2 (actualize configuration 2 so that it is not lost if you load some configuration)

It should work. Some configuration must be saved to e.g. slot 2 before you can load the (previously saved) configuration from the slot 2. If no configuration was saved to it then it prints "No Layer". Some keys must be remapped from default before you can save the active configuration to some slot. Otherwise it prints "No Change".

If you want to use GUI client on windows then the keyboard firmware and the GUI client must be compiled from "windows hack" branch and WinUSB driver must be installed. GUI client and keyboard firmware can be used directly on linux (no need for "windows hack" branch or special drivers).

Hey, thanks for the detailed information. I've actually found the problem, it never was the GUI client. My problem is either with the firmware build, or how I've connected the breakout board.
For example, the GUI client throws an exception when I try to upload an empty macro (I'm unable to actually use macros, even outside of the GUI client).
E.g: terminate called after throwing an instance of 'InsufficentStorageException'  what():  Cannot store 4 bytes to macro storage: only 0 available.

I followed instructions for the TMK firmware, therefor it's likely I'm missing something that allows me to utilize the onboard eeprom? I'm not sure what that could be though.

Offline chrisandreae

  • Thread Starter
  • Posts: 43
  • Location: Tokyo, Japan
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #80 on: Tue, 26 April 2016, 04:37:47 »
Hey, thanks for the detailed information. I've actually found the problem, it never was the GUI client. My problem is either with the firmware build, or how I've connected the breakout board.
For example, the GUI client throws an exception when I try to upload an empty macro (I'm unable to actually use macros, even outside of the GUI client).
E.g: terminate called after throwing an instance of 'InsufficentStorageException'  what():  Cannot store 4 bytes to macro storage: only 0 available.

I followed instructions for the TMK firmware, therefor it's likely I'm missing something that allows me to utilize the onboard eeprom? I'm not sure what that could be though.

The current release of the firmware uses the external 2kbyte I2C EEPROM included on the Kinesis' PCB to store the macro contents. On the Kinesis' 40 pin socket, SCL is pin 7 and SDA is pin 8. Those needs to be wired up to your microcontroller (preferably to the hardware I2C SCL/SDA pins, but you can use any I/O pins at a performance penalty if you #define BITBANG_TWI), the selected pins mapped in hardware/kinesis.h, and the firmware compiled with HAS_EXTERNAL_STORAGE=1.

Offline stian

  • Posts: 24
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #81 on: Tue, 26 April 2016, 05:05:30 »
Much appreciated Chris! I might just have compiled the firmware without external storage support.. I'll look into it and hopefully get it working. Would be great to use keypad_shift to access the keypad layer instead of reaching up to the keypad button to activate a second layer.

Offline stian

  • Posts: 24
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #82 on: Tue, 26 April 2016, 12:38:32 »
I've now checked both the pinout and can confirm both pin 7 & 8 go to SCL and SDA on my breakout board. I even recompiled and reflashed the firmware with external eeprom enabled. Still it reports macro storage size to 0. I must be doing something wrong..

Offline vvp

  • Posts: 886
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #83 on: Tue, 26 April 2016, 15:46:41 »
Macros storage size is defined by symbol MACROS_SIZE. Or may be MACRO_SIZE in older sources?
Check what is that symbol defined like in your sources.
The relevant code reporting this to KeyboardClient is in
lufa/lufa_main.c:207
Code: [Select]
case READ_MACRO_STORAGE_SIZE:
Endpoint_Write_16_LE(MACROS_SIZE);

Offline stian

  • Posts: 24
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #84 on: Wed, 27 April 2016, 01:24:21 »
Macros storage size is defined by symbol MACROS_SIZE. Or may be MACRO_SIZE in older sources?
Check what is that symbol defined like in your sources.
The relevant code reporting this to KeyboardClient is in
lufa/lufa_main.c:207
Code: [Select]
case READ_MACRO_STORAGE_SIZE:
Endpoint_Write_16_LE(MACROS_SIZE);

It reads exactly as you mention it. I'm using a fork of this project with added support for the atmega32u4, could that be the reason this isn't working?

Offline vvp

  • Posts: 886
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #85 on: Wed, 27 April 2016, 05:44:06 »
Ok, search all your sources for string MACROS_SIZE.
It will be defined somewhere to 0. Probably in some *.h file or a makefile. Change the definition to e.g. 1024.

If your fork redefined the symbol than it is one of the reasons why macros do not work for you. Maybe it is the only reason.

Offline stian

  • Posts: 24
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #86 on: Thu, 30 June 2016, 01:17:53 »
Ok, search all your sources for string MACROS_SIZE.
It will be defined somewhere to 0. Probably in some *.h file or a makefile. Change the definition to e.g. 1024.

If your fork redefined the symbol than it is one of the reasons why macros do not work for you. Maybe it is the only reason.

Hi, I looked through the source and couldn't find any mistakes in the macro size definition. Could it be wrong wiring on my end that's causing it?

Offline vvp

  • Posts: 886
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #87 on: Sun, 03 July 2016, 06:23:48 »
If your KeyboardClient still reports macro storage size as 0 and your MACROS_SIZE is bigger than 0, then I do not know what else can be wrong. Well, it can be a lot of things (my next guess would be somewhere in qtclient code) but they do not seem probable to me. I doubt this can be caused by wiring.
Sorry, I'm out of ideas.

Offline mystdrkn

  • Posts: 3
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #88 on: Tue, 26 July 2016, 20:16:54 »

I didn't make an exact BOM, but here are the things I bought specifically that might not be obvious from the schematic:

Ribbon cable
Ribbon cable connectors
Zener diodes for USB data lines
2mm pin header to connect to existing Kinesis USB cable

Other than that it's just an ATMega32A microcontroller, some 0603 resistors and capacitors in various values, a 16mhz crystal, a small electrolytic capacitor, and a 2.54mm pin header.

I'm scoping out the components to try this on my Kinesis Advantage. What values do you recommend for the resistors and capacitors?

Offline danpritts

  • Posts: 1
  • Location: a frozen hellscape at the moment
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #89 on: Thu, 08 June 2017, 17:23:45 »

I didn't make an exact BOM, but here are the things I bought specifically that might not be obvious from the schematic:

Ribbon cable
Ribbon cable connectors
Zener diodes for USB data lines
2mm pin header to connect to existing Kinesis USB cable

Other than that it's just an ATMega32A microcontroller, some 0603 resistors and capacitors in various values, a 16mhz crystal, a small electrolytic capacitor, and a 2.54mm pin header.

I'm scoping out the components to try this on my Kinesis Advantage. What values do you recommend for the resistors and capacitors?

mystdrkn, did you ever proceed?

Has anyone else other than chrisandreae actually pulled this off? 

I think I can probably figure out what all needs to be done from this thread, but I fear I'm not good enough with a soldering iron to do the assembly myself. 

Offline vvp

  • Posts: 886
Re: On-the-fly Programmable Keyboard Firmware for Kinesis and Ergodox
« Reply #90 on: Fri, 09 June 2017, 04:42:29 »
Chris' firmware is used by other people. No idea how many (if any) use his hardware though. I guess most use Ergodox hardware with the firmware. I use a completely different hardware.