Soarer's Keyboard Controller firmware for ATMega32U4 designs / GH60

JBert

22 Feb 2017, 14:15

I've been a fan of Soarer converters for years, all of my favorite keyboards have one. A month ago I received the parts for a GH60 (which I actually ordered years ago). My hope was to flash it with Soarer's Keyboard Controller firmware but it went haywire, and Soarer is no longer active to help debug it!

I noticed that all of the keys next to the Enter key would be pressed / released within the blink of an eye. What they all have in common is that they are connected to a column on pin PD6. If you know Soarer's converter and have used Teensy boards before then this might ring a bell:
Soarer wrote: Yeah, PD6 has the LED on it, and my firmware still uses it - I guess that should be configurable too!
Darn! This explains what's happening: the firmware configures pin PD6 as an output which means that the state of that pin is continuously overwritten by the blinking LED logic.

I was lucky though that Arakula has managed to reverse-engineer the controller. While I couldn't get a working build out of it yet, I actually could follow Arakula's comments to the point where the PD6 port was configured and patch Soarer's original firmware file. Attached at the end of this post you can find a patched HEX file for ATMEGA32U4 which no longer tries to blink the "onboard" LED. Use your favorite programming tool to write the HEX file to the controller, then download Soarer's Converter tools (linked at the top) to build a Soarer Config file (scas) after which you can send it to the controller with scwr.

And if other people building a GH60 or clone might be interested, here's my jbert_gh60.sc file (only Colemak-on-QWERTY mode is commented out, get it from Soarer's converter ZIP):

Code: Select all

matrix
    blocking 0

    #           Col01       Col02       Col03       Col04       Col05       Col06       Col07       Col08       Col09       Col10       Col11       Col12       Col13       Col14       
    sense       PF0         PF1         PE6         PC7         PC6         PB6         PD4         PB1         PB7         PB5         PB4         PD7         PD6         PB3
                                                                                                                                                                                        
    strobe PD0  ESC         1           2           3           4           5           6           7           8           9           0           MINUS       EQUAL       BACKSPACE   # Row1
    strobe PD1  TAB         Q           W           E           R           T           Y           U           I           O           P           LEFT_BRACE  RIGHT_BRACE BACKSLASH   # Row2
    strobe PD2  CAPS_LOCK   A           S           D           F           G           H           J           K           L           SEMICOLON   QUOTE       BACKSLASH   ENTER       # Row3
    strobe PD3  LSHIFT      EUROPE_2    Z           X           C           V           B           N           M           COMMA       PERIOD      SLASH       FN2         RSHIFT      # Row4
    strobe PD5  LCTRL       LGUI        LALT        UNASSIGNED  UNASSIGNED  SPACE       UNASSIGNED  UNASSIGNED  UNASSIGNED  FN3         RALT        RGUI        APP         RCTRL       # Row5

    # Note: - FN3 is actually used for the 1U key to the right of a 1U backspace
    #       - FN2 is accessible to the left / right of RSHIFT if you use a narrow shift key
    #       - EUROPE_2 and BACKSLASH can be swapped for a UK keyboard but I've always liked the backslash close to ENTER

end


## The fun stuff! Mostly copy-pasted from my Soarer Converter configs

ifselect any

# "remap" caps_lock to Ctrl, press Caps lock + left Windows key to toggle caps lock instead
macroblock
    macro CAPS_LOCK -lgui
        MAKE LCTRL
      onbreak norestoremeta
        BREAK LCTRL
    endmacro

    macro CAPS_LOCK lgui
        PRESS CAPS_LOCK
    endmacro
endblock

# need to map the FN key into the base layer (0)
remapblock
  layer 0
    APP FN1
endblock

# define that FN1 accesses layer 1
layerblock
    FN1 1
endblock

# the layer itself is just some remaps tagged with the layer number
remapblock
  layer 1
    I UP
    J LEFT
    K DOWN
    L RIGHT
    U HOME
    O END
    P PAGE_UP
    SEMICOLON PAGE_DOWN
    ESC BACK_QUOTE
    ENTER PAD_ENTER
    BACKSPACE TAB
    TAB DELETE
    1 F1
    2 F2
    3 F3
    4 F4
    5 F5
    6 F6
    7 F7
    8 F8
    9 F9
    0 F10
    MINUS F11
    EQUAL F12
    BACKSLASH APP
    RIGHT_BRACE INSERT
    R PAUSE # mnemonic: 'pause', on 'p' key in Colemak
    # Special numpad Fns taken from customized Poker layout
    A PAD_PLUS # mnemonic: 'add'
    D PAD_MINUS # mnemonic: 'subtract', on 's' key in Colemak
    G PAD_SLASH # mnemonic: 'divide', on 'd' key in Colemak
    F PAD_ASTERIX # mnemonic: 'times', on 't' key in Colemak
endblock

ifselect any
macroblock

    # GUI + 1 = Permanent arrow keys and F1-F12 keys
    macro 1 GUI
        PRESS SELECT_1
    endmacro

    # To exit mode 1, as 1 is remapped to F1
    macro F1 GUI
        PRESS SELECT_1
    endmacro

    # GUI + 2 = Colemak on QWERTY mode if uncommented below
    macro 2 GUI
        PRESS SELECT_2
    endmacro

    # To activate / disable mode 2 if mode 1 is active
    macro F2 GUI
        PRESS SELECT_2
    endmacro

endblock

# Ordering in the SC file matters here! Fn lock layer always needs to be last
# in file for the remapblock to be executed last!

# Colemak selection code in Mode 2
#ifselect 2

#include colemak.sc


# Nav mode - keep cursor and F keys in base layer
ifselect 1

remapblock
  layer 0
    I UP
    J LEFT
    K DOWN
    L RIGHT
    U HOME
    O END
    P PAGE_UP
    SEMICOLON PAGE_DOWN
    ENTER PAD_ENTER
    1 F1
    2 F2
    3 F3
    4 F4
    5 F5
    6 F6
    7 F7
    8 F8
    9 F9
    0 F10
    MINUS F11
    EQUAL F12
    BACKSLASH APP
    RIGHT_BRACE INSERT
    R PAUSE # mnemonic: 'pause', on 'p' key in Colemak
    # Poker has no numpad
    A PAD_PLUS # mnemonic: 'add'
    D PAD_MINUS # mnemonic: 'subtract', on 's' key in Colemak
    G PAD_SLASH # mnemonic: 'divide', on 'd' key in Colemak
    F PAD_ASTERIX # mnemonic: 'times', on 't' key in Colemak
endblock

# reset conditionals in case this file is included from another file
ifselect any

Attachments
Soarer_Controller_v1.20_beta4_atmega32u4_no_obled.zip
(18.35 KiB) Downloaded 98 times

User avatar
seebart
Offtopicthority Instigator

22 Feb 2017, 14:21

Very attentive, thanks for sharing.

Post Reply

Return to “Workshop”