uLisp as Mechanical Keyboard controller?


#1

I was thinking of making a mechanical keyboard with a Teensy 4(.1) and using µLisp to write the firmware.

My principal motivation for this is that I just find the configure -> compile -> flash process for a regular keyboard with QMK far too slow for me to experiment with keybindings and the like.

If I did, this would probably be my first time using µLisp (although I have CL experience of course).

My main concerns for this are power consumption and time delay, ideally, it needs to be ≤ 100 mW as some platforms do not support more gourmand keyboards. For time delay, I’m hoping using a Teensy 4.0 will alleviate any performance issues that we get as compared to a regular mech using a Teensy 2.0 + C.

Am I overestimating the performance requirements? Would an STM32 board also be suitable for this? I have a couple of Espruinos lying around which I could probably flash.

In general, would µLisp be suitable? The performance requirement is around 5-10 ms to process and send the keystroke to the operating system, maybe C actually matters there?

Am I missing anything with my plan to make a keyboard or does it seem reasonable?


#2

One of the considerations when using uLisp is that a garbage collection may occur at any time, so that may determine the maximum latency. Have a look at the GC time figures for each platform on the Performance page. These figures are generally inversely proportional to the processor speed, and proportional to the amount of RAM.

For example, the GC time for the Teensy 4.0/4.1 is 1.2 ms.


#3

To clarify those are maximum theoretical times ? Actual times would be based on the amount of Lisp objects currently existing?


#4

Yes, that’s correct.


#5

Mechanical keyboards offer the best feel and the greatest customizability.
Someone may recommend uLisp… But it’s totally arduino-based thing which is inefficient itself. Also uLisp is not a good solution for non-AVR MCUs. On AVR it has serious limitations. I guess you can try LispBM. But you will need better hardware to run it so there is no implementation for AVR.


#6

uLisp is not a good solution for non-AVR MCUs.

Can you give your reasons?

On AVR it has serious limitations.

Can you expand - what serious limitations?


#7

I would recommend an ESP32C3 module. These are cheap and have wifi, ble etc.
I designed a PCB for keyboard matrix decoding but never had the time to write any code for it. If you want design files I can share them. Just contact me. The PCB houses an ESP32C3 mini 1 module and encoder-decoders for stimulating and reading a matrix.

@johnsondavies would love to chat and learn from you, if you have the time and desire. Maybe there are areas where we can collaborate?