Author Topic: Firmware with good on-the-fly macro recording?  (Read 1031 times)

0 Members and 1 Guest are viewing this topic.

Offline Croktopus

  • Thread Starter
  • Posts: 13
Firmware with good on-the-fly macro recording?
« on: Wed, 14 November 2018, 02:06:10 »
I wanted to use QMK, but the on-the-fly macros are stored in volatile memory and it only supports 2 of them (I'm looking at a keyboard design with 12+ macro keys). I was wondering if any of the other open source keyboard firmwares support this feature, and what microcontrollers people would recommend using (with 30+ i/o pins) since the at90usb1286 (the controller i was looking at) only has 4kb of eeprom and i think that might be a bit low. thaanks

Offline vvp

  • Posts: 747
Re: Firmware with good on-the-fly macro recording?
« Reply #1 on: Wed, 14 November 2018, 02:24:03 »
Chris'  firmware has on the fly macro support (like Kinesis Advantage) as well as subprogram support:
https://github.com/chrisandreae/keyboard-firmware
It runs at least on ATmega32u4, and maybe something else too.

There is a fork of it which has significant number of extensions (see the commit logs):
https://github.com/hercek/keyboard-firmware
It runs at least on ATmega32u4 and ATxmega128a4u.

Number of macros and the amount macro text allocated to all macros together is configurable. It depends mostly on your EEPROM storage size. E.g. in the fork the default setting is 128 macros taking at most 3586 bytes (all together).

Offline Croktopus

  • Thread Starter
  • Posts: 13
Re: Firmware with good on-the-fly macro recording?
« Reply #2 on: Wed, 14 November 2018, 04:25:35 »
thanks! ATxmega128A4U should do the job really well too.

Offline vvp

  • Posts: 747
Re: Firmware with good on-the-fly macro recording?
« Reply #3 on: Wed, 14 November 2018, 04:46:18 »
Well, it depends whether you require an off-the-shelf breakout board with bootloader loaded. I'm not sure whether there are some easily available for ATxmega. There is a ton of them for ATmega.

As for as me, I have an access to avrdragon and it is not a problem for me to solder TQFP. I did not need a breakout board.

Offline Croktopus

  • Thread Starter
  • Posts: 13
Re: Firmware with good on-the-fly macro recording?
« Reply #4 on: Fri, 16 November 2018, 21:50:31 »
I guess I'm in trouble cuz I don't really know what that means. I'm comfortable soldering tqfp's, and i am planning to design my own pcb entirely and configuring it over usb. would that not work?

Offline vvp

  • Posts: 747
Re: Firmware with good on-the-fly macro recording?
« Reply #5 on: Sat, 17 November 2018, 04:44:37 »
Ok, if it you are comfortable soldering the MCU to your PCB yourself then it would work nicely. I just wanted to mention that since many people would not do it.

The only problem you may encounter is access to an PDI programmer. If you know somebody(*) who has avrdragon or some other PDI programmer then you can ask them to burn bootloader for you. Once bootloader is on the MCU you can burn/update the firmware through USB port.
If it is not a problem to buy avrdtragom yourself then you can buy it and burn bootloader to MCU yourself. Avrdragon is about 50 . There are some other PDI programmers and maybe cheaper but I do not know them. The good thing about avrdragon is that it is also a PDI debugger.

If you intend to tinker with firmware more then you will need something like avrdragon anyway to debug the firmware. Printf debugging (i.e. debugging without a debugger) is a pain in neck for anything than simple code changes.

If you intend to use ATxmega and do not already have some suitable schematic then you can use the one for K80CS as a starting point.

(*) Probably almost anybody who does some AVR development (besides simple firmware update) will have avrdragon.

Offline Croktopus

  • Thread Starter
  • Posts: 13
Re: Firmware with good on-the-fly macro recording?
« Reply #6 on: Sun, 18 November 2018, 06:23:54 »
Oh, so xmegas have to be programmed over pdi for the first go? (just xmegas right, this wont apply to something like an at90usb1286?)

sounds like a pain lol. though might be worth it if it means not having to reprogram firmware whenever i want to change a macro

Offline vvp

  • Posts: 747
Re: Firmware with good on-the-fly macro recording?
« Reply #7 on: Sun, 18 November 2018, 11:25:09 »
Yes, when you buy an atxmega chip only then it comes without bootloader preloaded. One must use PDI to burn at least a bootloader. The firmware update can be done over USB after that.

I do not know anything about at90usb1286. LUFA has some support for it so my guess is that chris' firmware will work on at90usb1286 with only slight modifications.

You can still use atmega32u4. Notice that you can use e.g. shift register to save pins needed for matrix scanning. Then you will have enough pins even on ATmega32u4.

Offline Croktopus

  • Thread Starter
  • Posts: 13
Re: Firmware with good on-the-fly macro recording?
« Reply #8 on: Mon, 19 November 2018, 21:33:34 »
You can still use atmega32u4. Notice that you can use e.g. shift register to save pins needed for matrix scanning. Then you will have enough pins even on ATmega32u4.

Ooh boy. I've got some reading to do. That might clean up my traces around the microcontroller too...

If you can't tell, I'm real new to this stuff

Offline vvp

  • Posts: 747
Re: Firmware with good on-the-fly macro recording?
« Reply #9 on: Tue, 20 November 2018, 01:58:15 »
Ooh boy. I've got some reading to do.
http://www.openmusiclabs.com/learning/digital/input-matrix-scanning/

Edit:
There is also a cheap but flimsy way to burn atxmega bootloader: https://community.atmel.com/projects/atxmega-programmer-050
I do not recommend it. Expect to spend a few hundreds and a lot of time on your custom keyboard project anyway. Avrdragon is not that much expensive in that view. And if you expect to tinker with the firmware (*) you will appreciate a lot to have a working debugger.

(*) And you definitely will need to play with the keyboard matrix scanning code at least. That is iif you are not going to build exactly what the firmware is provided for by default (e.g. Ergodox/KinesisAdvantageWithCustomController in the case of chris' firmware or K80CS/K84CS int he case of the branch).
« Last Edit: Tue, 20 November 2018, 02:08:42 by vvp »