Major master controller firmware update!

I have finally managed to rewrite some parts of firmware code I wasn’t particularly happy with, namely the collective head switch parser! It was a mess, used huge amounts of memory, yet only allowed using around 17 physical buttons.

I understood that with 2 more collective heads that will soon be added to Simchair collection, a major cleanup was needed, along with some changes related to use of flash memory to store configurations more efficiently. This allowed me to design a cleaner configuration structure that could be parsed more efficiently, and thus, I was able to add more buttons!

As of now, we can use up to 32 buttons of types 1 and 2, and up to 9 buttons of types 3 and 4 – buttons from 33 to 42 are reserved for to be assigned as middle buttons. With a mode switch support, this is 96 virtual buttons plus 33 available for middle switch positions. The latter are now defined explicitly, allowing for a wider range of configurations. These changes should allow for pretty much any collective configuration, with twice the buttons compared to what we had before.

Another good thing – all heads now have common data structures, that are populated in setup subroutines from corresponding configuration structures. This reduces chances of breaking something when adding features and makes things cleaner =)

Please sync with the repo and reflash, report bugs if you find any!

Here’s how new head switches configuration looks:

// COLLECTIVE SWITCHPANEL SWITCH MATRIX – NOW SUPPORTS UP TO 32
// BUTTONS + 10 ADDITIONAL BUTTONS FOR TYPES 3 AND 4
// 4 SWITCH TYPES ARE SUPPORTED:
// 1: button
// 2: momentary press button
// 3: selector button (button + middle button press when switch is centered)
// 4: selector momentary press button (momentary press button + middle button momentary press when switch is centered)
// ASSIGN THE BUTTON AFTER TYPES 3 AND 4 TO TYPE 5 (SLAVE) AND SET JOYSTICK BUTTON YOU WANT TO BE THE MIDDLE BUTTON IN 3RD COLUMN!
// BUTTONS FROM 33 TO 42 ARE RESERVED FOR MIDDLE BUTTONS

//0 – disabled, 1 – button, 2 – 3 – selector_button, 4 – selector, 5 – slave
const sw_matrix ab412_switch_matrix[] PROGMEM =
{
// i t m is i – id, t – type, m – middle button for types 3 and 4
{1, 1, 0},
{2, 1, 0},
{3, 2, 0},
{4, 2, 0},
{5, 2, 0},
{6, 2, 0},
{7, 2, 0},
{8, 2, 0},
{9, 3, 33},
{10,5, 33},
{11,3, 34},
{12,5, 34},
{13,3, 35},
{14,5, 35},
{15,4, 36},
{16,5, 36},

};


11 Replies to “Major master controller firmware update!”

  1. I have had to go back to the previous version of master controller after testing this. With the AB412 head (two pots + mode switch) when I move the switch to the right of the right hat switch up or down the master controller freezes and I have to unplug/re-plug.

    1. This is interesting! Have just finished another collective, haven’t noticed this issue there! Will try to reproduce with my copy.

      Have you used the default switch matrix config?

    1. Couldn’t reproduce it with my version so far, can you please try changing the following lines in switch matrix:

      {15,4, 36},
      {16,5, 36},

      to:

      {15,3,36},
      {16,5,36},

      and check if it works, if not:

      {15,3,37},
      {16,5,37},

      and if it still won’t work,

      {15,3,33},
      {16,5,33},

      Sadly my head was the first prototype and is wired slightly different, I will rewire it on this weekend to correspond the current version, meanwhile, let’s see if we can debug this issue with help of your feedback =)

    1. Still, haven’t been able to reproduce – tried all combinations, it works… Can it be it’s some difference in wiring?

      Also found a “hardware related” bug – legs of the lower left switch should be cut short, otherwise it will short pins of the KY-083 board under it when flipped.

  2. I cut the header pins of the ky083 to stop them touching but also I’m using all single pole switches so I have a decent amount of room in there. Thanks for looking into it, as I said all working for me.

Leave a Reply to hc625ma Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.