Author Topic: TMK keyboard firmware  (Read 819689 times)

0 Members and 1 Guest are viewing this topic.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1850 on: Sun, 09 July 2017, 23:57:21 »
pabile,
It seems Bootmagic is accidentally eabled, you need to clear config in EEPROM.

First, download default frimware from Editor and flash it.  http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?alps64
Second, Plug-in while pressing Space and Backspace(top right key).
Now, your keyboard should be normal.

If this problem is reproduced you will have to check and fix your soldering.

See this for Bootmagic if needed.
https://github.com/tmk/tmk_keyboard/#boot-magic-configuration---virtual-dip-switch
« Last Edit: Sun, 09 July 2017, 23:59:34 by hasu »

Offline pabile

  • Posts: 158
  • Location: Southeast Asia
    • pabile online
Re: TMK keyboard firmware
« Reply #1851 on: Mon, 10 July 2017, 00:05:55 »
noted with thanks, hasu. i'll try this when i get back home later this evening. may i ask how does one enables bootmagic? through key combination? just asking to avoid it in future.

thanks for the quicky reply  :thumb:

Offline pabile

  • Posts: 158
  • Location: Southeast Asia
    • pabile online
Re: TMK keyboard firmware
« Reply #1852 on: Mon, 10 July 2017, 07:47:51 »
First, download default frimware from Editor and flash it.  http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?alps64
Second, Plug-in while pressing Space and Backspace(top right key).
Now, your keyboard should be normal.

hi hasu! just letting you know that your instructions above fixed my board. your alps64 and tmk really are amazing  :-*

Offline pOngey

  • Posts: 2
  • Location: Southeast Asia
Re: TMK keyboard firmware
« Reply #1853 on: Sun, 16 July 2017, 08:23:08 »
Hi Hasu,

I decided to create a hand-wired mechanical keyboard a while back in time and it was a tough journey; but it was really fun. I got everything connected and finally was able to generate a hex file earlier today (from my office's mac) after struggling with Windows and comma placements.

So, thinking that I finally got the hex file generated, I decided to flash it to my keeb. I am using Teensy.exe to flash the hex file to my Teensy 2.0, but after rebooting, the keyboard seems not to work... My PC also starts giving USB connecting/disconnecting sound effects in a loop for a while. After a couple of cycles, my Teensy turns into 'Program Mode' and nothing happens...

I reflashed the Teensy with slow_blink.hex and it's working fine. I'm too afraid to reflash it with my keyboard hex file.

Would you say the problem is from the hardware rather than a software issue?


-pOngey

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1854 on: Sun, 16 July 2017, 16:35:22 »
Hi Hasu,

I decided to create a hand-wired mechanical keyboard a while back in time and it was a tough journey; but it was really fun. I got everything connected and finally was able to generate a hex file earlier today (from my office's mac) after struggling with Windows and comma placements.

So, thinking that I finally got the hex file generated, I decided to flash it to my keeb. I am using Teensy.exe to flash the hex file to my Teensy 2.0, but after rebooting, the keyboard seems not to work... My PC also starts giving USB connecting/disconnecting sound effects in a loop for a while. After a couple of cycles, my Teensy turns into 'Program Mode' and nothing happens...

I reflashed the Teensy with slow_blink.hex and it's working fine. I'm too afraid to reflash it with my keyboard hex file.

Would you say the problem is from the hardware rather than a software issue?


-pOngey

Not sure what the problem exactly is but TMK has function to turn keyboard into program mode and you can disable it  with uncomment 'COMMAND_ENABLE' and 'BOOTMAGIC_ENABLE' in your Makefile.

Offline pOngey

  • Posts: 2
  • Location: Southeast Asia
Re: TMK keyboard firmware
« Reply #1855 on: Mon, 17 July 2017, 00:21:23 »
Hi Hasu,

I decided to create a hand-wired mechanical keyboard a while back in time and it was a tough journey; but it was really fun. I got everything connected and finally was able to generate a hex file earlier today (from my office's mac) after struggling with Windows and comma placements.

So, thinking that I finally got the hex file generated, I decided to flash it to my keeb. I am using Teensy.exe to flash the hex file to my Teensy 2.0, but after rebooting, the keyboard seems not to work... My PC also starts giving USB connecting/disconnecting sound effects in a loop for a while. After a couple of cycles, my Teensy turns into 'Program Mode' and nothing happens...

I reflashed the Teensy with slow_blink.hex and it's working fine. I'm too afraid to reflash it with my keyboard hex file.

Would you say the problem is from the hardware rather than a software issue?


-pOngey

Not sure what the problem exactly is but TMK has function to turn keyboard into program mode and you can disable it  with uncomment 'COMMAND_ENABLE' and 'BOOTMAGIC_ENABLE' in your Makefile.

Thank you for your reply, I will give it a try.

And thank you for your great supports!

-pOngey

Offline spwath

  • Posts: 71
Re: TMK keyboard firmware
« Reply #1856 on: Mon, 17 July 2017, 12:26:35 »
I'm having issues with making my firmware, not sure why.
I made this post about it, maybe should have made this post here.
https://geekhack.org/index.php?topic=90630.0

Offline _haru

  • Formerly linuxfanatic
  • Posts: 390
  • Location: Perth, Western Australia
  • Back from the dead
Re: TMK keyboard firmware
« Reply #1857 on: Mon, 24 July 2017, 06:46:32 »
Thinking of getting one of these for an upcoming project, seeing as the Atmega32u2 is supported by TMK: https://www.mattairtech.com/index.php/development-boards/atmega32u2-usb-development-board-arduino-compatible.html

Which bootloader should i buy it with? Will the stock Arduino compatible one work or do I need the DFU one? If so, which DFU bootloader, the Atmel one or the other one?
AMJ60 - 45g MX White | GH60 Rev. C - Ghost Gateron Blacks | DFK101 - Alps SKCM Cream | Filco Majestouch 2 TKL - 62g Vintage MX Ergo Clear

Offline Tactile

  • Posts: 1431
  • Location: Portland, OR
Re: TMK keyboard firmware
« Reply #1858 on: Mon, 24 July 2017, 12:17:32 »
Thinking of getting one of these for an upcoming project, seeing as the Atmega32u2 is supported by TMK: https://www.mattairtech.com/index.php/development-boards/atmega32u2-usb-development-board-arduino-compatible.html

Which bootloader should i buy it with? Will the stock Arduino compatible one work or do I need the DFU one? If so, which DFU bootloader, the Atmel one or the other one?

Between the offered choices the main difference is simply what tool you plan to use to program it. The two DFU options are for using FLIP from Atmel. The CDC bootloader won't work with FLIP, but works with AVRDUDE. I've used both tools and it wouldn't matter to me. If they say the CDC bootloader is recommended, that's what I'd go with.
REΛLFORCE

Offline _haru

  • Formerly linuxfanatic
  • Posts: 390
  • Location: Perth, Western Australia
  • Back from the dead
Re: TMK keyboard firmware
« Reply #1859 on: Mon, 24 July 2017, 17:18:44 »
Thinking of getting one of these for an upcoming project, seeing as the Atmega32u2 is supported by TMK: https://www.mattairtech.com/index.php/development-boards/atmega32u2-usb-development-board-arduino-compatible.html

Which bootloader should i buy it with? Will the stock Arduino compatible one work or do I need the DFU one? If so, which DFU bootloader, the Atmel one or the other one?

Between the offered choices the main difference is simply what tool you plan to use to program it. The two DFU options are for using FLIP from Atmel. The CDC bootloader won't work with FLIP, but works with AVRDUDE. I've used both tools and it wouldn't matter to me. If they say the CDC bootloader is recommended, that's what I'd go with.

Will either of them cause issues with getting TMK on the chips? I've heard that the Arduino bootloader might conflict with it.
AMJ60 - 45g MX White | GH60 Rev. C - Ghost Gateron Blacks | DFK101 - Alps SKCM Cream | Filco Majestouch 2 TKL - 62g Vintage MX Ergo Clear

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1860 on: Mon, 24 July 2017, 17:33:57 »
no issue will come up. you can use any program method, tmk doesn't depend on bootloader. you don't have to even have bootloader if you have programmer like avrisp mkII.
« Last Edit: Mon, 24 July 2017, 17:37:26 by hasu »

Offline _haru

  • Formerly linuxfanatic
  • Posts: 390
  • Location: Perth, Western Australia
  • Back from the dead
Re: TMK keyboard firmware
« Reply #1861 on: Mon, 24 July 2017, 17:44:11 »
no issue will come up. you can use any program method, tmk doesn't depend on bootloader. you don't have to even have bootloader if you have programmer like avrisp mkII.

Awesome, thanks!
AMJ60 - 45g MX White | GH60 Rev. C - Ghost Gateron Blacks | DFK101 - Alps SKCM Cream | Filco Majestouch 2 TKL - 62g Vintage MX Ergo Clear

Offline Eugene94

  • Posts: 26
Re: TMK keyboard firmware
« Reply #1862 on: Tue, 08 August 2017, 00:12:57 »
Hasu, I was wondering if it was at all possible to use my USB to USB converter as a USB flash drive. This idea occurred to me when I realized that the device was saving the custom keyboard layout and I wondered if it could save more... How much data can the device store? Could it be used to store text like a keylogger?
http://www.keelog.com/ps2_hardware_keylogger.html

Do you think that the TMK layout hex files would work on the devices in the link above?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1863 on: Tue, 08 August 2017, 00:28:36 »
1kb of eeprom can be used for storage and also rest part of flash if bootloader API can be  used.

I'm not sure about the last question but no probably.

Offline Trente

  • Posts: 172
Re: TMK keyboard firmware
« Reply #1864 on: Wed, 09 August 2017, 15:50:32 »
Hey Hasu, I have a question about building a alternative controller and using TMK firmware with it, and I would really want some suggestion from you if possible.

Recently I got a 1800 style keyboard but unfortunately it was no longer working. So I am planning to do some hand wiring and build an alternative controller for it. The problem I am facing is to find a proper controller board. Since I am having a much larger matrix than 60% keyboard, (if I did not misunderstand the concept) I would need for input pins on the controller board. But it seems the commonly used tenssy 2.0 and pro micro board don't have this much inputs. So I am wondering if you have some good suggestion on controller board I can use to achieve my goal?

Thank you very much

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1865 on: Wed, 09 August 2017, 16:04:01 »
Teensy 2.0++ if it's number of pins is enough for your needs.

Offline Trente

  • Posts: 172
Re: TMK keyboard firmware
« Reply #1866 on: Wed, 09 August 2017, 17:19:56 »
I think I got 19 columns and 7 rows, so it sounds barely enough on tenssy 2.0++

Offline _haru

  • Formerly linuxfanatic
  • Posts: 390
  • Location: Perth, Western Australia
  • Back from the dead
Re: TMK keyboard firmware
« Reply #1867 on: Wed, 09 August 2017, 19:03:40 »
I think I got 19 columns and 7 rows, so it sounds barely enough on tenssy 2.0++

The MattairTech 32U4 development board might work. I've got the 32U2 version in the mail right now.
AMJ60 - 45g MX White | GH60 Rev. C - Ghost Gateron Blacks | DFK101 - Alps SKCM Cream | Filco Majestouch 2 TKL - 62g Vintage MX Ergo Clear

Offline Trente

  • Posts: 172
Re: TMK keyboard firmware
« Reply #1868 on: Wed, 09 August 2017, 19:46:11 »
The MattairTech 32U4 development board might work. I've got the 32U2 version in the mail right now.

Gotcha, thanks for the advice, I will look into it

Offline _haru

  • Formerly linuxfanatic
  • Posts: 390
  • Location: Perth, Western Australia
  • Back from the dead
Re: TMK keyboard firmware
« Reply #1869 on: Wed, 09 August 2017, 23:45:51 »
The MattairTech 32U4 development board might work. I've got the 32U2 version in the mail right now.

Gotcha, thanks for the advice, I will look into it

 :thumb:
AMJ60 - 45g MX White | GH60 Rev. C - Ghost Gateron Blacks | DFK101 - Alps SKCM Cream | Filco Majestouch 2 TKL - 62g Vintage MX Ergo Clear

Offline Trente

  • Posts: 172
Re: TMK keyboard firmware
« Reply #1870 on: Thu, 10 August 2017, 01:45:59 »
By the way, since I have absolutely no background in any electrical engineering, I would be very glad if someone and point out some good direction for me. I took the night looking into some forum, and got a plan about how the matrix should be wired up. What I came up with is a 8*13 matrix now (after some rearrangement and cleaning up). Thus, I am wondering if development boards like tenssy 2.0 or audrino pro micro or audrino micro has enough input pins for this size of matrix, and what are the pins that is OK to use on these type of board if I want to used them to build handwire keyboards?

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: TMK keyboard firmware
« Reply #1871 on: Thu, 10 August 2017, 01:50:28 »
I am wondering if development boards like tenssy 2.0 or audrino pro micro or audrino micro has enough input pins for this size of matrix, and what are the pins that is OK to use on these type of board if I want to used them to build handwire keyboards?
ATMega32u4 has 26 I/O pins so either of the breakout boards you mentioned would cover a 8*13 matrix. Pins wise, you can use any indifferently for your matrix.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline Trente

  • Posts: 172
Re: TMK keyboard firmware
« Reply #1872 on: Thu, 10 August 2017, 02:08:54 »
ATMega32u4 has 26 I/O pins so either of the breakout boards you mentioned would cover a 8*13 matrix. Pins wise, you can use any indifferently for your matrix.

So if I didn't misunderstand, this means any pin including those labeled as GND or 3v or whatever would work in same way? Also, though this could be already out of my reach, but if I would like to add in led support, not in switch ones, but just three indicator LEDs (CapsLock,NumLock etc), how many extra pins or what extra stuff I need to add in to get the stuff working?

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: TMK keyboard firmware
« Reply #1873 on: Thu, 10 August 2017, 06:19:44 »
any pin including those labeled as GND or 3v or whatever would work in same way?
No, only I/O pins. They are generally labelled like F1, B4 or PF1, PB4 etc.

Also, though this could be already out of my reach, but if I would like to add in led support, not in switch ones, but just three indicator LEDs (CapsLock,NumLock etc), how many extra pins or what extra stuff I need to add in to get the stuff working?
The easiest way for LED indicators is to use a pin for each indicator. Being your matrix a 8*13, you have five free pins so you're good.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline jjanssen1

  • Posts: 165
  • Location: Melbourne, Australia
Re: TMK keyboard firmware
« Reply #1874 on: Wed, 13 September 2017, 19:00:43 »
Hi Everyone,

I am designing/building an ATTINY85 two key macropad, and I was wondering if there is a way to use TMK on it, either alongside or instead of V-USB?


Thanks
-Josh
IBM Model M 1386303

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1875 on: Wed, 13 September 2017, 19:09:21 »
Hi Everyone,

I am designing/building an ATTINY85 two key macropad, and I was wondering if there is a way to use TMK on it, either alongside or instead of V-USB?


Thanks
-Josh

TMK includes V-USB already but with default config firmware will overrun flash size of the tiny chip.
I can remember that I managed to use TMK with 16KB flash with removing some features at some point, you will have to configure without many featutres and even shave some code to fit it into 8KB.

You can try to compile TMK onekey project for TINY85 to know it size.

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1876 on: Thu, 14 September 2017, 09:33:53 »
To compile for ATtiny85 some tweaks was needed, putsed these commits to repo.

* bf20626 onekey: Add settings for Xtal-less V-USB
* 1c2f2b6 core: Remove unused file in vusb
* 4dc2fb5 onekey: Fix for V-USB of ATtiny85 and key scan
* 45f6e5c core: Fix for build option NO_ACTION_LAYER
* 956f806 core: Fix for ATtiny85

With those commits firmware size is under 6KB now and it works on ATtiny85!
To configure V-USB with crystal-less internal RC oscillator I refered to this page.
Connect D- to PB1, D+ to PB2 and switch between PB0 and GND.
http://codeandlife.com/2012/02/22/v-usb-with-attiny45-attiny85-without-a-crystal/

Quote

$ cd keyboard/onekey
$ make -f Makefile.vusb

...

Size after:
   text    data     bss     dec     hex filename
   5518      14     254    5786    169a onekey_vusb.elf

-------- end --------


Offline online

  • Posts: 205
Re: TMK keyboard firmware
« Reply #1877 on: Thu, 21 September 2017, 18:39:53 »
Hi all

I'm pretty new to TMK. I'm trying to assign Fn keys as a macro key using import Fn in TMK Keymap Generator.
However, the keys do not register as a macro. Below is the code.

"0":["ACTION_LAYER_MOMENTARY",1],"4":["ACTION_LAYER_MOMENTARY","2"],"11":["ACTION_MODS_KEY(MOD_LSFT, KC_1)"],"12":["ACTION_MODS_KEY(MOD_LSFT, KC_1)"],"13":["ACTION_MODS_KEY(MOD_LSFT, KC_1)"]

Could anyone can shed some light please?

Offline alh84001

  • Posts: 276
  • Location: EU-HR-ZG
Re: TMK keyboard firmware
« Reply #1878 on: Mon, 02 October 2017, 13:24:11 »
Hi hasu,

What are the chances of getting a PC 8801 converter?

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1879 on: Tue, 03 October 2017, 18:24:15 »
Hi hasu,

What are the chances of getting a PC 8801 converter?

I for one have no plan. Can you work on it? If so I can help you.

Offline hoapham98

  • Posts: 1
Re: TMK keyboard firmware
« Reply #1880 on: Fri, 27 October 2017, 11:03:12 »
Hi Hasu, I have a problem with demux in matrix.c. I used a 74HC138 to demux columns. The matrix scaned fine but I had a problem with DEBOUNCE. Althought I set DEBOUNCE to 5 but it didn't work. I press 'A' one time but it show 6 'A'. I tested with onekey and debounce worked fine. Please help me!
This is my matrix.c
Code: [Select]
/*
Copyright 2013 Mathias Andersson <wraul@dbox.se>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <stdbool.h>
#include <avr/io.h>
#include <util/delay.h>
#include "print.h"
#include "debug.h"
#include "util.h"
#include "matrix.h"


#ifndef DEBOUNCE
#   define DEBOUNCE 5
#endif

static uint8_t debouncing = DEBOUNCE;

/* matrix state(1:on, 0:off) */
static matrix_row_t matrix[MATRIX_ROWS];
static matrix_row_t matrix_debouncing[MATRIX_ROWS];

static uint8_t read_rows(void);
static void init_rows(void);
static void unselect_cols(void);
static void select_col(uint8_t col);

inline
uint8_t matrix_rows(void)
{
    return MATRIX_ROWS;
}

inline
uint8_t matrix_cols(void)
{
    return MATRIX_COLS;
}

void matrix_init(void)
{
    unselect_cols();
    init_rows();
    // initialize matrix state: all keys off
    for (uint8_t i=0; i < MATRIX_ROWS; i++)  {
        matrix[i] = 0;
        matrix_debouncing[i] = 0;
    }
}

uint8_t matrix_scan(void)
{
    for (uint8_t col = 0; col < MATRIX_COLS; col++) {  // 0-5
        select_col(col);
        _delay_us(3); // TODO: Determine the correct value needed here.
        uint8_t rows = read_rows();

        for (uint8_t row = 0; row < MATRIX_ROWS; row++) {  // 0-1
            bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1<<col);
            bool curr_bit = rows & (1<<row);
            if (prev_bit != curr_bit) {
                matrix_debouncing[row] ^= ((matrix_row_t)1<<col);
                debouncing = DEBOUNCE;
            }
        }
        unselect_cols();
    }

    if (debouncing) {
        if (--debouncing) {
            _delay_ms(5);
        } else {
            for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
                matrix[i] = matrix_debouncing[i];
            }
        }
    }

    return 1;
}

bool matrix_is_modified(void)
{
    if (debouncing) return false;
    return true;
}

inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
    return (matrix[row] & ((matrix_row_t)1<<col));
}

inline
matrix_row_t matrix_get_row(uint8_t row)
{
    return matrix[row];
}

void matrix_print(void)
{
    print("\nr/c 0123456789ABCDEF\n");
    for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
        xprintf("%02X: %032lb\n", row, bitrev32(matrix_get_row(row)));
    }
}

uint8_t matrix_key_count(void)
{
    uint8_t count = 0;
    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
        count += bitpop32(matrix[i]);
    }
    return count;
}

/* Row pin configuration
 * row: 0   1
 * pin: B0  B1
 */
static void init_rows(void)
{
    // Input_pullup (DDR:0, PORT:1)
    DDRB  &= ~((1<<0) | (1<<1));
    PORTB |= ((1<<0) | (1<<1));
}

static uint8_t read_rows(void)
{
    return (PINB&(1<<0) ? 0 : (1<<0)) |
           (PINB&(1<<1) ? 0 : (1<<1));
}


/* Columns 0 - 4
 * These columns uses 74HC138 3 to 8 bit demultiplexers.
 * col / pin:    PB2  PB3  PB4
 * 0:             0    0    0
 * 1:             1    0    0
 * 2:             0    1    0
 * 3:             1    1    0
 * 4:             0    0    1
 */
static void unselect_cols(void)
{
    DDRB |= ((1<<2) | (1<<3) | (1<<4));
    PORTB &= ~((1<<2) | (1<<3) | (1<<4));
}

static void select_col(uint8_t col)
{
    // Output high (DDR:1, PORT:1) to select
    switch (col) {
        case 0:
            break;
        case 1:
            PORTB |= (1<<2);
            break;
        case 2:
            PORTB |= (1<<3);
            break;
        case 3:
            PORTB |= (1<<2) | (1<<3);
            break;
        case 4:
            PORTB |= (1<<4);
            break;
    }
}

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1881 on: Fri, 27 October 2017, 19:27:45 »
hoapham98, I can't find anything wong with quick glance. this is not problem but you better use _delay_ms(1) instead of 5.


I would be helpful to implement your own different debounce from scratch when your debug doesn't go well. And refering to this 'timer based' debouncing code may be useful.
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/onekey/onekey.c


Offline Sifo

  • Alter
  • * Exquisite Elder
  • Posts: 7487
  • Location: #GOLDSPRINGS, #LEGITBALLIN
  • Illustrious
Re: TMK keyboard firmware
« Reply #1882 on: Thu, 09 November 2017, 17:54:42 »
Hey hasu, as we discussed I'm trying to get TMK to work for my current gaming needs.

What this user describes with QMK is the same experience I'm having with both QMK and TMK. Using Metalliqaz' easyAVR firmware makes it possible to do the combination for me but I'm having key bouncing issues with his firmware.

https://github.com/qmk/qmk_firmware/issues/1950

Using any of my other custom keyboards (TX87, lightsaver, NERD2.0, b.face, etc) doesn't have this problem.

I'm not 100% sure what the problem is but I read somewhere it could have something to do with polling rate (needs to be 1000hz). Is there anywhere in TMK where I can set that?

The keyboard is a GH60 rev. C, I'm using Windows 10 64bit and my keymap is as follows (this might have errors because I wrote it up really quick at work, at home the keymap compiles with no errors):

Code: [Select]
#include "keymap_common.h"

/*
 * Sifo
 */
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    /* Default
     * ,-----------------------------------------------------------.
     * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|Del|
     * |-----------------------------------------------------------|
     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| Bspc|
     * |-----------------------------------------------------------|
     * |LCtl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Enter   |
     * |-----------------------------------------------------------|
     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|    Shift     |
     * |-----------------------------------------------------------|
     * |Fn0 |Gui |Alt |      Space             |Fn1 |Alt |LCtl|RCtl|
     * `-----------------------------------------------------------'
     */
    KEYMAP_ANSI(
        ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,MINS,EQL,BSLS,DEL, \
        TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSPC, \
        LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN, QUOT,    ENT,  \
        LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,         RSFT,  \
        FN0,LGUI,LALT,          SPC,                     FN1,RALT, LCTL, RCTL),
    /* Fn1
     * ,-----------------------------------------------------------.
     * |Grv| P1| P2| P3| P4| P5| P6| P7|P8|P9|P0|PMNS|PPLS|PAST|   |
     * |-----------------------------------------------------------|
     * |Bspc |Del| Up|Ent|Hom|   |   |   |Ins|   |   |   |   |     |
     * |-----------------------------------------------------------|
     * |Caps  |Lef|Dwn|Rig|End|   |   |   |   |   |   |   |        |
     * |-----------------------------------------------------------|
     * |Shift  |NLck|PgDn|PgUp|PScr|ScLk|Paus|  |  |PDOT|PSLS|Shift|
     * |-----------------------------------------------------------|
     * |    |    |    |                        |    |RGui| App|    |
     * `-----------------------------------------------------------'
     */
    KEYMAP_ANSI(
        GRV, P1,  P2,  P3,  P4,  P5,  P6,  P7,  P8,  P9,P0,PMNS,PPLS,PAST,TRNS \
        BSPC,DEL,  UP,  ENT,HOME,TRNS,TRNS,TRNS,INS,TRNS,TRNS,TRNS,TRNS,TRNS,  \
        CAPS,LEFT,DOWN,RIGHT,END,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,    PENT,  \
        TRNS,NLCK,PGDN,PGUP,PSCR,SLCK,PAUS,TRNS,TRNS,PDOT,PSLS,          TRNS, \
        TRNS,TRNS,TRNS,          TRNS,                     TRNS,RGUI, APP,TRNS),
    /* Fn2
     * ,-----------------------------------------------------------.
     * |   | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|   |   |
     * |-----------------------------------------------------------|
     * |     |   |   |   |   |   |   |   |   |   |   |   |   |     |
     * |-----------------------------------------------------------|
     * |      |   |   |   |   |   |   |   |   |   |   |   |        |
     * |-----------------------------------------------------------|
     * |        |   |   |   |   |   |   |   |   |   |   |          |
     * |-----------------------------------------------------------|
     * |    |    |    |                        |    |RGui |App |   |
     * `-----------------------------------------------------------'
     */
    KEYMAP_ANSI(
        TRNS, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,TRNS, \
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,    TRNS,  \
        TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,         TRNS, \
        TRNS,TRNS,TRNS,          TRNS,                     TRNS,RGUI,APP, TRNS),
};
const action_t PROGMEM fn_actions[] = {
    [0] = ACTION_LAYER_MOMENTARY(1),
    [1] = ACTION_LAYER_MOMENTARY(2)
};


The strangest part about this is that even setting up a macro to perfectly press Space + C at the same time will not work consistently via TMK or QMK, but manually doing it via metalliqaz' firmware works flawlessly.
« Last Edit: Thu, 09 November 2017, 18:00:21 by Sifo »
I love Elzy

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1883 on: Thu, 09 November 2017, 19:39:54 »
Interesting.
You never get crouch jump at all with TMK? or you can get it occasionally?

In TMK USB polling of default keyboard(endpoint 1) requests 10ms interval(100Hz) for purpose of wide compatibility to computers. Try NKRO keyboard instead if you need 1ms interval. But I don't think this is problem, if this is true you won't be able to play the game with Realforce and HHKB.

To get the action timing is really critical? I watched people fail to jump through window many times in some youtube videos :)
Maybe, scan rate of switch matrix is too slow then?


Can you try elitekeyboards.com's Switchhitter and post logs of  key strokes of 'space + c'?
I like to see log from TMK keyboard and one of keyboards without problem.

Offline Sifo

  • Alter
  • * Exquisite Elder
  • Posts: 7487
  • Location: #GOLDSPRINGS, #LEGITBALLIN
  • Illustrious
Re: TMK keyboard firmware
« Reply #1884 on: Thu, 09 November 2017, 19:44:37 »
Interesting.
You never get crouch jump at all with TMK? or you can get it occasionally?

In TMK USB polling of default keyboard(endpoint 1) requests 10ms interval(100Hz) for purpose of wide compatibility to computers. Try NKRO keyboard instead if you need 1ms interval. But I don't think this is problem, if this is true you won't be able to play the game with Realforce and HHKB.

To get the action timing is really critical? I watched people fail to jump through window many times in some youtube videos :)
Maybe, scan rate of switch matrix is too slow then?


Can you try elitekeyboards.com's Switchhitter and post logs of  key strokes of 'space + c'?
I like to see log from TMK keyboard and one of keyboards without problem.

I can get it occasionally, maybe 1/10 times? I can also try NKRO on tmk when I get home.

I wouldn't say the timing is critical because a macro doesn't work via TMK but will work with Razer keyboards lol... but people have reported that it is easier on some keyboards than others, some guess that it might have to do with polling.

If you suspect it's the matrix scan rate, I can try adjusting it via metalliqaz' firmware since it has a built in console to play with the timings and report any difference.

I don't have a realforce or hhkb to test, but I can show you my switchhitter logs later tonight with different keyboards. I can even show you the difference between TMK vs metalliqaz' firmware on the same keyboard as well.
I love Elzy

Offline Sifo

  • Alter
  • * Exquisite Elder
  • Posts: 7487
  • Location: #GOLDSPRINGS, #LEGITBALLIN
  • Illustrious
Re: TMK keyboard firmware
« Reply #1885 on: Thu, 09 November 2017, 23:09:24 »
First update: switching to NKRO with shift + shift + N works, crouch jump 100% success rate now.

Is there a better way to enable NKRO as default?

Or is there a way to have 6kro with 1ms polling rate?

I love Elzy

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1886 on: Thu, 09 November 2017, 23:22:54 »
These are SwitchHitter logs of my keyboards on Thinkpad x201s/windows 10.
Hm, I don't find obvious problem in TMK keyboards. They can send two press events sequentially in 8ms apart as expected. TMK NKRO sends in 5ms apart in log below,  I guess the 5ms resolution is limitation of SwitchHitter or Windows because with xev on Linux it can send events in 1ms apart.


PS/2 internal keyboard:
15:58.0882 Space (0x20, BIOS 0x39) DOWN
15:58.0887 C (0x43, BIOS 0x2E) DOWN
15:58.0978 Space (0x20, BIOS 0x39) UP -> 97ms
15:58.0983 C (0x43, BIOS 0x2E) UP -> 97ms
16:00.0813 Space (0x20, BIOS 0x39) DOWN
16:00.0817 C (0x43, BIOS 0x2E) DOWN
16:00.0891 Space (0x20, BIOS 0x39) UP -> 77ms
16:00.0896 C (0x43, BIOS 0x2E) UP -> 77ms
16:04.0616 Space (0x20, BIOS 0x39) DOWN
16:04.0621 C (0x43, BIOS 0x2E) DOWN
16:04.0677 Space (0x20, BIOS 0x39) UP -> 62ms
16:04.0682 C (0x43, BIOS 0x2E) UP -> 62ms


Cherry G80-3600(10ms):
28:39.0352 C (0x43, BIOS 0x2E) DOWN
28:39.0360 Space (0x20, BIOS 0x39) DOWN
28:39.0472 Space (0x20, BIOS 0x39) UP -> 112ms
28:39.0488 C (0x43, BIOS 0x2E) UP -> 136ms
28:40.0376 C (0x43, BIOS 0x2E) DOWN
28:40.0392 Space (0x20, BIOS 0x39) DOWN
28:40.0472 C (0x43, BIOS 0x2E) UP -> 96ms
28:40.0480 Space (0x20, BIOS 0x39) UP -> 88ms
28:41.0368 C (0x43, BIOS 0x2E) DOWN
28:41.0376 Space (0x20, BIOS 0x39) DOWN
28:41.0448 C (0x43, BIOS 0x2E) UP -> 80ms
28:41.0464 Space (0x20, BIOS 0x39) UP -> 88ms
28:42.0312 C (0x43, BIOS 0x2E) DOWN
28:42.0328 Space (0x20, BIOS 0x39) DOWN
28:42.0416 Space (0x20, BIOS 0x39) UP -> 88ms
28:42.0432 C (0x43, BIOS 0x2E) UP -> 120ms


HHKB Pro2 with TMK Alt controller(NKRO/1ms):
19:12.0658 C (0x43, BIOS 0x2E) DOWN
19:12.0663 Space (0x20, BIOS 0x39) DOWN
19:12.0757 Space (0x20, BIOS 0x39) UP -> 93ms
19:12.0772 C (0x43, BIOS 0x2E) UP -> 114ms
19:16.0287 Space (0x20, BIOS 0x39) DOWN
19:16.0294 C (0x43, BIOS 0x2E) DOWN
19:16.0386 Space (0x20, BIOS 0x39) UP -> 99ms
19:16.0393 C (0x43, BIOS 0x2E) UP -> 99ms
19:19.0134 Space (0x20, BIOS 0x39) DOWN
19:19.0140 C (0x43, BIOS 0x2E) DOWN
19:19.0253 Space (0x20, BIOS 0x39) UP -> 120ms
19:19.0260 C (0x43, BIOS 0x2E) UP -> 120ms
19:21.0319 Space (0x20, BIOS 0x39) DOWN
19:21.0325 C (0x43, BIOS 0x2E) DOWN
19:21.0417 Space (0x20, BIOS 0x39) UP -> 99ms
19:21.0424 C (0x43, BIOS 0x2E) UP -> 99ms
19:24.0617 C (0x43, BIOS 0x2E) DOWN
19:24.0622 Space (0x20, BIOS 0x39) DOWN
19:24.0730 Space (0x20, BIOS 0x39) UP -> 107ms
19:24.0737 C (0x43, BIOS 0x2E) UP -> 121ms


HHKB Pro2 with TMK Alt controller(6KRO/10ms):
42:49.0785 C (0x43, BIOS 0x2E) DOWN
42:49.0793 Space (0x20, BIOS 0x39) DOWN
42:49.0849 Space (0x20, BIOS 0x39) UP -> 56ms
42:49.0857 C (0x43, BIOS 0x2E) UP -> 72ms
42:57.0593 C (0x43, BIOS 0x2E) DOWN
42:57.0601 Space (0x20, BIOS 0x39) DOWN
42:57.0665 C (0x43, BIOS 0x2E) UP -> 72ms
42:57.0673 Space (0x20, BIOS 0x39) UP -> 72ms
43:00.0249 Space (0x20, BIOS 0x39) DOWN
43:00.0256 C (0x43, BIOS 0x2E) DOWN
43:00.0336 C (0x43, BIOS 0x2E) UP -> 80ms
43:00.0344 Space (0x20, BIOS 0x39) UP -> 96ms
43:02.0169 Space (0x20, BIOS 0x39) DOWN
43:02.0177 C (0x43, BIOS 0x2E) DOWN
43:02.0265 Space (0x20, BIOS 0x39) UP -> 96ms
43:02.0273 C (0x43, BIOS 0x2E) UP -> 96ms
43:13.0705 Space (0x20, BIOS 0x39) DOWN
43:13.0712 C (0x43, BIOS 0x2E) DOWN
43:13.0792 C (0x43, BIOS 0x2E) UP -> 80ms
43:13.0800 Space (0x20, BIOS 0x39) UP -> 96ms



HHKB Pro2 with Topre original controller(10ms):
46:54.0396 Space (0x20, BIOS 0x39) DOWN
46:54.0412 C (0x43, BIOS 0x2E) DOWN
46:54.0500 C (0x43, BIOS 0x2E) UP -> 88ms
46:54.0507 Space (0x20, BIOS 0x39) UP -> 112ms
47:01.0412 Space (0x20, BIOS 0x39) DOWN
47:01.0419 C (0x43, BIOS 0x2E) DOWN
47:01.0500 Space (0x20, BIOS 0x39) UP -> 88ms
47:01.0516 C (0x43, BIOS 0x2E) UP -> 96ms
47:02.0573 C (0x43, BIOS 0x2E) DOWN
47:02.0580 Space (0x20, BIOS 0x39) DOWN
47:02.0636 Space (0x20, BIOS 0x39) UP -> 56ms
47:02.0652 C (0x43, BIOS 0x2E) UP -> 80ms
47:03.0588 Space (0x20, BIOS 0x39) DOWN
47:03.0595 C (0x43, BIOS 0x2E) DOWN
47:03.0676 C (0x43, BIOS 0x2E) UP -> 80ms
47:03.0684 Space (0x20, BIOS 0x39) UP -> 96ms
47:04.0596 C (0x43, BIOS 0x2E) DOWN
47:04.0603 Space (0x20, BIOS 0x39) DOWN
47:04.0659 Space (0x20, BIOS 0x39) UP -> 56ms
47:04.0675 C (0x43, BIOS 0x2E) UP -> 80ms



Alps64(10ms):
20:47.0951 Space (0x20, BIOS 0x39) DOWN
20:47.0959 C (0x43, BIOS 0x2E) DOWN
20:48.0087 Space (0x20, BIOS 0x39) UP -> 136ms
20:48.0095 C (0x43, BIOS 0x2E) UP -> 136ms
20:49.0639 C (0x43, BIOS 0x2E) DOWN
20:49.0647 Space (0x20, BIOS 0x39) DOWN
20:49.0767 Space (0x20, BIOS 0x39) UP -> 120ms
20:49.0775 C (0x43, BIOS 0x2E) UP -> 136ms
20:51.0551 Space (0x20, BIOS 0x39) DOWN
20:51.0559 C (0x43, BIOS 0x2E) DOWN
20:51.0671 C (0x43, BIOS 0x2E) UP -> 112ms
20:51.0695 Space (0x20, BIOS 0x39) UP -> 144ms
20:52.0943 C (0x43, BIOS 0x2E) DOWN
20:52.0951 Space (0x20, BIOS 0x39) DOWN
20:53.0087 Space (0x20, BIOS 0x39) UP -> 136ms
20:53.0094 C (0x43, BIOS 0x2E) UP -> 152ms



Alps64 NKRO(1ms):
26:37.0078 Space (0x20, BIOS 0x39) DOWN
26:37.0083 C (0x43, BIOS 0x2E) DOWN
26:37.0162 C (0x43, BIOS 0x2E) UP -> 79ms
26:37.0179 Space (0x20, BIOS 0x39) UP -> 101ms
26:39.0240 Space (0x20, BIOS 0x39) DOWN
26:39.0245 C (0x43, BIOS 0x2E) DOWN
26:39.0315 C (0x43, BIOS 0x2E) UP -> 69ms
26:39.0322 Space (0x20, BIOS 0x39) UP -> 81ms
26:41.0095 Space (0x20, BIOS 0x39) DOWN
26:41.0100 C (0x43, BIOS 0x2E) DOWN
26:41.0180 C (0x43, BIOS 0x2E) UP -> 80ms
26:41.0200 Space (0x20, BIOS 0x39) UP -> 105ms
26:43.0361 Space (0x20, BIOS 0x39) DOWN
26:43.0366 C (0x43, BIOS 0x2E) DOWN
26:43.0413 C (0x43, BIOS 0x2E) UP -> 47ms
26:43.0429 Space (0x20, BIOS 0x39) UP -> 68ms
26:45.0305 Space (0x20, BIOS 0x39) DOWN
26:45.0309 C (0x43, BIOS 0x2E) DOWN
26:45.0365 C (0x43, BIOS 0x2E) UP -> 55ms
26:45.0373 Space (0x20, BIOS 0x39) UP -> 69ms




Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1887 on: Thu, 09 November 2017, 23:27:14 »
First update: switching to NKRO with shift + shift + N works, crouch jump 100% success rate now.

Is there a better way to enable NKRO as default?

Or is there a way to have 6kro with 1ms polling rate?



Great.
Logs of your keyboards is still helpful to tack down the problem, post them when you get time, plz.


Isn't NKRO default when you build with that option? I can't remember. Check FAQ on wiki.
To get 1ms polling  you just need to change report descriptor, iirc.

Offline Sifo

  • Alter
  • * Exquisite Elder
  • Posts: 7487
  • Location: #GOLDSPRINGS, #LEGITBALLIN
  • Illustrious
Re: TMK keyboard firmware
« Reply #1888 on: Thu, 09 November 2017, 23:32:11 »
First update: switching to NKRO with shift + shift + N works, crouch jump 100% success rate now.

Is there a better way to enable NKRO as default?

Or is there a way to have 6kro with 1ms polling rate?



Great.
Logs of your keyboards is still helpful to tack down the problem, post them when you get time, plz.


Isn't NKRO default when you build with that option? I can't remember. Check FAQ on wiki.
To get 1ms polling  you just need to change report descriptor, iirc.

ok I will get you the logs when I can.

NKRO is not on by default, the default makefile I believe has NKRO_ENABLE = yes

I think bootmagic is on by default too. Says default is Space + N but doesn't work for me to toggle NKRO. I will have more details later!

EDIT: commented out bootmagic and now NKRO is on by default. will provide logs when I can later.
« Last Edit: Fri, 10 November 2017, 00:10:35 by Sifo »
I love Elzy

Offline Sifo

  • Alter
  • * Exquisite Elder
  • Posts: 7487
  • Location: #GOLDSPRINGS, #LEGITBALLIN
  • Illustrious
Re: TMK keyboard firmware
« Reply #1889 on: Fri, 10 November 2017, 01:53:52 »
Logs, 10 tries each of Space + C simultaneously:

EasyAVR via Metalliqaz:
Code: [Select]
42:53.0182 C (0x43, BIOS 0x2E) DOWN
42:53.0183 Space (0x20, BIOS 0x39) DOWN
42:53.0276 C (0x43, BIOS 0x2E) UP -> 94ms
42:53.0278 Space (0x20, BIOS 0x39) UP -> 95ms
42:53.0700 C (0x43, BIOS 0x2E) DOWN
42:53.0701 Space (0x20, BIOS 0x39) DOWN
42:53.0809 C (0x43, BIOS 0x2E) UP -> 109ms
42:53.0811 Space (0x20, BIOS 0x39) UP -> 110ms
42:54.0136 C (0x43, BIOS 0x2E) DOWN
42:54.0137 Space (0x20, BIOS 0x39) DOWN
42:54.0229 C (0x43, BIOS 0x2E) UP -> 92ms
42:54.0247 Space (0x20, BIOS 0x39) UP -> 109ms
42:54.0552 C (0x43, BIOS 0x2E) DOWN
42:54.0553 Space (0x20, BIOS 0x39) DOWN
42:54.0632 C (0x43, BIOS 0x2E) UP -> 80ms
42:54.0656 Space (0x20, BIOS 0x39) UP -> 103ms
42:55.0037 C (0x43, BIOS 0x2E) DOWN
42:55.0040 Space (0x20, BIOS 0x39) DOWN
42:55.0124 C (0x43, BIOS 0x2E) UP -> 87ms
42:55.0128 Space (0x20, BIOS 0x39) UP -> 88ms
42:55.0561 C (0x43, BIOS 0x2E) DOWN
42:55.0562 Space (0x20, BIOS 0x39) DOWN
42:55.0626 C (0x43, BIOS 0x2E) UP -> 66ms
42:55.0628 Space (0x20, BIOS 0x39) UP -> 67ms
42:55.0979 C (0x43, BIOS 0x2E) DOWN
42:55.0980 Space (0x20, BIOS 0x39) DOWN
42:56.0050 C (0x43, BIOS 0x2E) UP -> 71ms
42:56.0053 Space (0x20, BIOS 0x39) UP -> 72ms
42:56.0536 C (0x43, BIOS 0x2E) DOWN
42:56.0537 Space (0x20, BIOS 0x39) DOWN
42:56.0600 C (0x43, BIOS 0x2E) UP -> 64ms
42:56.0601 Space (0x20, BIOS 0x39) UP -> 64ms
42:57.0026 C (0x43, BIOS 0x2E) DOWN
42:57.0028 Space (0x20, BIOS 0x39) DOWN
42:57.0099 C (0x43, BIOS 0x2E) UP -> 73ms
42:57.0100 Space (0x20, BIOS 0x39) UP -> 72ms
42:57.0469 C (0x43, BIOS 0x2E) DOWN
42:57.0471 Space (0x20, BIOS 0x39) DOWN
42:57.0540 C (0x43, BIOS 0x2E) UP -> 72ms
42:57.0542 Space (0x20, BIOS 0x39) UP -> 72ms

TMK 6KRO
Code: [Select]
50:42.0321 C (0x43, BIOS 0x2E) DOWN
50:42.0328 Space (0x20, BIOS 0x39) DOWN
50:42.0416 C (0x43, BIOS 0x2E) UP -> 96ms
50:42.0424 Space (0x20, BIOS 0x39) UP -> 96ms
50:42.0744 C (0x43, BIOS 0x2E) DOWN
50:42.0752 Space (0x20, BIOS 0x39) DOWN
50:42.0833 C (0x43, BIOS 0x2E) UP -> 88ms
50:42.0841 Space (0x20, BIOS 0x39) UP -> 88ms
50:43.0209 C (0x43, BIOS 0x2E) DOWN
50:43.0217 Space (0x20, BIOS 0x39) DOWN
50:43.0289 C (0x43, BIOS 0x2E) UP -> 80ms
50:43.0297 Space (0x20, BIOS 0x39) UP -> 80ms
50:43.0633 C (0x43, BIOS 0x2E) DOWN
50:43.0641 Space (0x20, BIOS 0x39) DOWN
50:43.0745 C (0x43, BIOS 0x2E) UP -> 112ms
50:43.0761 Space (0x20, BIOS 0x39) UP -> 120ms
50:44.0121 C (0x43, BIOS 0x2E) DOWN
50:44.0129 Space (0x20, BIOS 0x39) DOWN
50:44.0193 C (0x43, BIOS 0x2E) UP -> 72ms
50:44.0208 Space (0x20, BIOS 0x39) UP -> 80ms
50:44.0560 C (0x43, BIOS 0x2E) DOWN
50:44.0568 Space (0x20, BIOS 0x39) DOWN
50:44.0632 C (0x43, BIOS 0x2E) UP -> 72ms
50:44.0640 Space (0x20, BIOS 0x39) UP -> 72ms
50:44.0976 C (0x43, BIOS 0x2E) DOWN
50:44.0985 Space (0x20, BIOS 0x39) DOWN
50:45.0056 C (0x43, BIOS 0x2E) UP -> 80ms
50:45.0065 Space (0x20, BIOS 0x39) UP -> 80ms
50:45.0416 C (0x43, BIOS 0x2E) DOWN
50:45.0424 Space (0x20, BIOS 0x39) DOWN
50:45.0481 C (0x43, BIOS 0x2E) UP -> 64ms
50:45.0505 Space (0x20, BIOS 0x39) UP -> 80ms
50:45.0889 C (0x43, BIOS 0x2E) DOWN
50:45.0897 Space (0x20, BIOS 0x39) DOWN
50:45.0969 C (0x43, BIOS 0x2E) UP -> 80ms
50:45.0977 Space (0x20, BIOS 0x39) UP -> 80ms
50:46.0305 C (0x43, BIOS 0x2E) DOWN
50:46.0313 Space (0x20, BIOS 0x39) DOWN
50:46.0393 C (0x43, BIOS 0x2E) UP -> 88ms
50:46.0401 Space (0x20, BIOS 0x39) UP -> 88ms

TMK NKRO
Code: [Select]
51:55.0322 C (0x43, BIOS 0x2E) DOWN
51:55.0323 Space (0x20, BIOS 0x39) DOWN
51:55.0419 C (0x43, BIOS 0x2E) UP -> 98ms
51:55.0420 Space (0x20, BIOS 0x39) UP -> 98ms
51:55.0865 C (0x43, BIOS 0x2E) DOWN
51:55.0866 Space (0x20, BIOS 0x39) DOWN
51:55.0974 C (0x43, BIOS 0x2E) UP -> 109ms
51:55.0974 Space (0x20, BIOS 0x39) UP -> 109ms
51:56.0806 C (0x43, BIOS 0x2E) DOWN
51:56.0807 Space (0x20, BIOS 0x39) DOWN
51:56.0912 C (0x43, BIOS 0x2E) UP -> 106ms
51:56.0912 Space (0x20, BIOS 0x39) UP -> 106ms
51:57.0328 C (0x43, BIOS 0x2E) DOWN
51:57.0329 Space (0x20, BIOS 0x39) DOWN
51:57.0425 C (0x43, BIOS 0x2E) UP -> 97ms
51:57.0426 Space (0x20, BIOS 0x39) UP -> 97ms
51:58.0030 C (0x43, BIOS 0x2E) DOWN
51:58.0030 Space (0x20, BIOS 0x39) DOWN
51:58.0120 C (0x43, BIOS 0x2E) UP -> 91ms
51:58.0121 Space (0x20, BIOS 0x39) UP -> 91ms
51:58.0773 C (0x43, BIOS 0x2E) DOWN
51:58.0773 Space (0x20, BIOS 0x39) DOWN
51:58.0858 C (0x43, BIOS 0x2E) UP -> 86ms
51:58.0866 Space (0x20, BIOS 0x39) UP -> 93ms
51:59.0312 C (0x43, BIOS 0x2E) DOWN
51:59.0313 Space (0x20, BIOS 0x39) DOWN
51:59.0399 C (0x43, BIOS 0x2E) UP -> 86ms
51:59.0407 Space (0x20, BIOS 0x39) UP -> 93ms
51:59.0888 C (0x43, BIOS 0x2E) DOWN
51:59.0888 Space (0x20, BIOS 0x39) DOWN
51:59.0986 C (0x43, BIOS 0x2E) UP -> 98ms
51:59.0996 Space (0x20, BIOS 0x39) UP -> 108ms
52:00.0571 C (0x43, BIOS 0x2E) DOWN
52:00.0572 Space (0x20, BIOS 0x39) DOWN
52:00.0660 C (0x43, BIOS 0x2E) UP -> 90ms
52:00.0667 Space (0x20, BIOS 0x39) UP -> 96ms
52:01.0167 C (0x43, BIOS 0x2E) DOWN
52:01.0168 Space (0x20, BIOS 0x39) DOWN
52:01.0252 C (0x43, BIOS 0x2E) UP -> 84ms
52:01.0253 Space (0x20, BIOS 0x39) UP -> 84ms

b.face
Code: [Select]
58:11.0027 C (0x43, BIOS 0x2E) DOWN
58:11.0028 Space (0x20, BIOS 0x39) DOWN
58:11.0135 C (0x43, BIOS 0x2E) UP -> 128ms
58:11.0136 Space (0x20, BIOS 0x39) UP -> 108ms
58:11.0616 C (0x43, BIOS 0x2E) DOWN
58:11.0617 Space (0x20, BIOS 0x39) DOWN
58:11.0712 C (0x43, BIOS 0x2E) UP -> 96ms
58:11.0720 Space (0x20, BIOS 0x39) UP -> 103ms
58:12.0104 C (0x43, BIOS 0x2E) DOWN
58:12.0105 Space (0x20, BIOS 0x39) DOWN
58:12.0200 C (0x43, BIOS 0x2E) UP -> 96ms
58:12.0201 Space (0x20, BIOS 0x39) UP -> 96ms
58:12.0639 C (0x43, BIOS 0x2E) DOWN
58:12.0640 Space (0x20, BIOS 0x39) DOWN
58:12.0720 C (0x43, BIOS 0x2E) UP -> 80ms
58:12.0721 Space (0x20, BIOS 0x39) UP -> 80ms
58:13.0096 C (0x43, BIOS 0x2E) DOWN
58:13.0097 Space (0x20, BIOS 0x39) DOWN
58:13.0176 C (0x43, BIOS 0x2E) UP -> 80ms
58:13.0184 Space (0x20, BIOS 0x39) UP -> 87ms
58:13.0560 C (0x43, BIOS 0x2E) DOWN
58:13.0561 Space (0x20, BIOS 0x39) DOWN
58:13.0648 C (0x43, BIOS 0x2E) UP -> 88ms
58:13.0648 Space (0x20, BIOS 0x39) UP -> 88ms
58:14.0919 C (0x43, BIOS 0x2E) DOWN
58:14.0920 Space (0x20, BIOS 0x39) DOWN
58:15.0024 C (0x43, BIOS 0x2E) UP -> 104ms
58:15.0025 Space (0x20, BIOS 0x39) UP -> 104ms
58:15.0360 Space (0x20, BIOS 0x39) DOWN
58:15.0368 C (0x43, BIOS 0x2E) DOWN
58:15.0432 C (0x43, BIOS 0x2E) UP -> 64ms
58:15.0448 Space (0x20, BIOS 0x39) UP -> 88ms
58:15.0872 C (0x43, BIOS 0x2E) DOWN
58:15.0873 Space (0x20, BIOS 0x39) DOWN
58:15.0943 C (0x43, BIOS 0x2E) UP -> 72ms
58:15.0951 Space (0x20, BIOS 0x39) UP -> 79ms
58:16.0256 C (0x43, BIOS 0x2E) DOWN
58:16.0256 Space (0x20, BIOS 0x39) DOWN
58:16.0319 C (0x43, BIOS 0x2E) UP -> 64ms
58:16.0327 Space (0x20, BIOS 0x39) UP -> 71ms

I also confirmed in game, only TMK 6KRO does not work.

Interestingly, the b.face is 6KRO.
« Last Edit: Fri, 10 November 2017, 02:03:18 by Sifo »
I love Elzy

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1890 on: Fri, 10 November 2017, 02:34:32 »
Thanks,
hmm, its cause seems to be polling rate against my expectation.
I guess b.face and EasyAVR uses 1ms as polling interval.

I can't understand why steam or pubg guys keep this issue unfixed, this will eliminate users of classic keyboards with 10ms polling including Realforce, HHKB and many many others :p

And this issue exists only on WIndows? (Assuming steam is multi platform and supports Mac and Linux.)

Offline Sifo

  • Alter
  • * Exquisite Elder
  • Posts: 7487
  • Location: #GOLDSPRINGS, #LEGITBALLIN
  • Illustrious
Re: TMK keyboard firmware
« Reply #1891 on: Fri, 10 November 2017, 02:55:54 »
Thanks,
hmm, its cause seems to be polling rate against my expectation.
I guess b.face and EasyAVR uses 1ms as polling interval.

I can't understand why steam or pubg guys keep this issue unfixed, this will eliminate users of classic keyboards with 10ms polling including Realforce, HHKB and many many others :p

And this issue exists only on WIndows? (Assuming steam is multi platform and supports Mac and Linux.)

pubg is the most poorly spaghetti coded game i've ever seen so that's why. but they are supposedly adding a new feature in the game so you can vault with 1 key. I guess at that point this will be obsolete, but I just wanted to figure it out for the mean time lol.

I can't confirm on Mac or Linux since i only have a windows machine at the moment.

But just in case, what would be the steps to enable 1ms polling for 6kro? I'm not sure what file contains the report descriptor
I love Elzy

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1892 on: Fri, 10 November 2017, 05:29:35 »
See line 309 of tmk_core/protocol/lufa/descriptor.c to change ".PollingIntervalMS".

Offline Sifo

  • Alter
  • * Exquisite Elder
  • Posts: 7487
  • Location: #GOLDSPRINGS, #LEGITBALLIN
  • Illustrious
Re: TMK keyboard firmware
« Reply #1893 on: Sat, 11 November 2017, 00:28:49 »
everything working perfectly now, 6kro with 1000hz polling rate, thank you so much hasu!
I love Elzy

Offline BrintaVett

  • Posts: 42
Re: TMK keyboard firmware
« Reply #1894 on: Sun, 12 November 2017, 15:13:41 »
Edit: moved this to another topic.

« Last Edit: Mon, 13 November 2017, 01:59:20 by BrintaVett »

Offline Ngt

  • * Elevated Elder
  • Posts: 2346
  • Location: Lyon, France
Re: TMK keyboard firmware
« Reply #1895 on: Tue, 14 November 2017, 15:06:22 »
Hello Hasu!


Thanks you for the great project it is really cool. I finished building my board and flashed TMK on it with a modified version of SpaceFn. I wonder where can I play with the activation time of the space key? I'd like to try with a longer activation time. It doesn't feel smooth to me with the default value but I can't figure out where the parameter is in the source code. Thanks for the help.

Silenced Novatouch w/ Hack'd by Geeks

Sold: Ducky Zero Shine (Brown) | Poker 2 (Blue) | HHKB 55g Type-S

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1896 on: Tue, 14 November 2017, 18:35:02 »
Hello Hasu!


Thanks you for the great project it is really cool. I finished building my board and flashed TMK on it with a modified version of SpaceFn. I wonder where can I play with the activation time of the space key? I'd like to try with a longer activation time. It doesn't feel smooth to me with the default value but I can't figure out where the parameter is in the source code. Thanks for the help.

SpaceFn is just one of example layouts using 'dual-role key' technique and coined by spiceBar. Dual-role key is proper word  for discussion and search in this case, though.
https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys

You can use this thread for gneral discussion of usage and implementation of dual role key.
https://geekhack.org/index.php?topic=41685.50


TMK implememtation of the dual role key is called as 'Tap key' in its doc and source. You can find code here. I guess what you are finding is TAPPING_TERM value which can be changed in confih.h.

https://github.com/tmk/tmk_keyboard/blob/5f6550a0be8b332f24ad6a7798e1237b2970ef85/tmk_core/common/action_tapping.c
https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#4-tapping

Offline Ngt

  • * Elevated Elder
  • Posts: 2346
  • Location: Lyon, France
Re: TMK keyboard firmware
« Reply #1897 on: Wed, 15 November 2017, 05:06:43 »
Hello Hasu!


Thanks you for the great project it is really cool. I finished building my board and flashed TMK on it with a modified version of SpaceFn. I wonder where can I play with the activation time of the space key? I'd like to try with a longer activation time. It doesn't feel smooth to me with the default value but I can't figure out where the parameter is in the source code. Thanks for the help.

SpaceFn is just one of example layouts using 'dual-role key' technique and coined by spiceBar. Dual-role key is proper word  for discussion and search in this case, though.
https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys

You can use this thread for gneral discussion of usage and implementation of dual role key.
https://geekhack.org/index.php?topic=41685.50


TMK implememtation of the dual role key is called as 'Tap key' in its doc and source. You can find code here. I guess what you are finding is TAPPING_TERM value which can be changed in confih.h.

https://github.com/tmk/tmk_keyboard/blob/5f6550a0be8b332f24ad6a7798e1237b2970ef85/tmk_core/common/action_tapping.c
https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#4-tapping


Alright thank you for the clarification. I didn't know the proper term indeed. I'll check that out. Have a good day.  :thumb:

Silenced Novatouch w/ Hack'd by Geeks

Sold: Ducky Zero Shine (Brown) | Poker 2 (Blue) | HHKB 55g Type-S

Offline mech0nly

  • Posts: 197
  • Location: ID
Re: TMK keyboard firmware
« Reply #1898 on: Sat, 30 December 2017, 07:40:55 »
​Hello,

Long story short, I successfully converted my L3 TKL87 PCB to TMK. (thanks to xauser who ported it) ;)
But when I enabled NKRO in Makefile and tried to build the firmware, I got this error
https://drive.google.com/open?id=1wPlM6pYNdwibq7yYsHYYDW3pULFq8pII

I think it has something to do with host.c/.h
How can I implement NKRO on V-USB?
Really need this feature for gaming :)

Thank you.
356CL DGE | 356mini | 360C | G81-3000SAT | G81-3000SAU | G81-3077SAU | ESA-3000-HASRO | G80-3000LPCXY-2 | G80-3485LWNUS-2 | 55g HHKB

Offline hasu

  • Thread Starter
  • Posts: 3471
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: TMK keyboard firmware
« Reply #1899 on: Sat, 30 December 2017, 19:26:43 »
​Hello,

Long story short, I successfully converted my L3 TKL87 PCB to TMK. (thanks to xauser who ported it) ;)
But when I enabled NKRO in Makefile and tried to build the firmware, I got this error
https://drive.google.com/open?id=1wPlM6pYNdwibq7yYsHYYDW3pULFq8pII

I think it has something to do with host.c/.h
How can I implement NKRO on V-USB?
Really need this feature for gaming :)

Thank you.

TMK doesn't support NKRO on V-USB.
I would be happy to help if you have time to implement it!

You will have to start with looking into codes in vusb protocol directory.
https://github.com/tmk/tmk_keyboard/tree/master/tmk_core/protocol/vusb