-
-
Notifications
You must be signed in to change notification settings - Fork 39.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] Add bidirectional and duplex matrix code #8160
Conversation
Schematic drawing of Angel64 can be found here. Concerning documentation the part I want to change the most is this line.
https://docs.qmk.fm/#/hand_wire Fullsize keyboard is possible with a single ProMicro. |
802cb90
to
a1d5b93
Compare
a1d5b93
to
73e66d7
Compare
Updated according to the requests. (except the symbol names) |
73e66d7
to
78ffea9
Compare
This is pretty awesome, thank you for bringing it to core. I haven't reviewed the code in detail yet but I'm excited about what it will mean for custom keyboards.
We'll be able to review the code and test it out, but we'll need documentation on how |
description updated. |
78ffea9
to
b2aae55
Compare
cope with qmk cformat (clang-format). |
For reference, here is an example how to apply BOTHWAYS to the-dog-keyboard. The matrix of this keyboard can be found here. #7401 (comment) |
Hi! Won't this matrix ghost after you press 3 keys? eg. SW1, SW57 and SW8 would cause SW7 to trigger. |
That's a real good question. The answer is, It won't! Because |
I might be missing something obvious. That link shows a standard matrix, not a duplex one. It has six rows and twenty columns, all the diodes go in the same direction, and every switch belongs to exactly one physical row and column. Did you mean to post a different image? |
@sowbug Please take a look once again closely. In the left half of the matrix diodes are pointing upward (ROW2COL) and in the right half downward (COL2ROW) . |
Yes, I see now. I was looking at adjacent diodes expecting them to alternate direction. Thank you! |
@hineybush's episode is a strikingly well suited example which showcase the enhancement this PR enables. I heard some voices of anticipation hoping this PR get merged. At first there was no document, but I've already done decent documentation in the later commit. I beleave we've had more than enough time for people to swallow and consume the concept of this PR. What left was @fauxpark's statement about his fondness toward the wacky name of COL2ROW2COL. This PR is ready to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just in case, there may be someone reading this who find oneself feeling kind of not fully understanding. It's okay. It is not because of lack of documentation. It is because of lack of knowledge in electronics. Just let it go.
Please be careful with statements like this. QMK is welcoming to people of all skills levels, and one of our primary missions is to educate. Making confrontational statements runs counter to our code of conduct.
The bottom line is I'm not going to change those names.
I understand your frustration with this process. We've learned through hard-won experience that names matter, and are nearly impossible to change. (See the various ways the word keymap is used in different context as just one example.) That's why we have these conversations, to find the names that are going to be the least confusing in the long run.
As things stand right now we feel that there is not enough distinction between the plain meaning of EITHERWAY
and BOTHWAYS
for those terms to be used. In particular, people with reading disabilities like dyslexia may have a hard time distinguishing between them. I've suggested names that do not suffer from this ambiguity.
* COL2ROW , ROW2COL , EITHERWAY or BOTHWAYS - how your matrix is configured. | ||
* COL2ROW means the black mark on your diode is facing to the rows or facing away from the cols. This is considered the preferred choice in QMK when you are planning a new design. | ||
* ROW2COL means the opposide. The black mark on your diode is facing to the cols or facing away from the rows. | ||
* EITHERWAY is useful as compensation when a matrix has diodes messed up with their directions. This works prorerly even when arbitrary number of diodes are soldered wrong way. That means this setting is compatible with COL2ROW matrix and ROW2COL matrix at the same time. | ||
* BOTHWAYS is a new strategy to reduce number of pins required to drive a matrix. Compared to a conventional matrix twice the number of keys can be handled. This is considered an advanced topic and will be discussed separately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've been talking about this one internally and while we aren't in total agreement on the names we think these will work better.
* COL2ROW , ROW2COL , EITHERWAY or BOTHWAYS - how your matrix is configured. | |
* COL2ROW means the black mark on your diode is facing to the rows or facing away from the cols. This is considered the preferred choice in QMK when you are planning a new design. | |
* ROW2COL means the opposide. The black mark on your diode is facing to the cols or facing away from the rows. | |
* EITHERWAY is useful as compensation when a matrix has diodes messed up with their directions. This works prorerly even when arbitrary number of diodes are soldered wrong way. That means this setting is compatible with COL2ROW matrix and ROW2COL matrix at the same time. | |
* BOTHWAYS is a new strategy to reduce number of pins required to drive a matrix. Compared to a conventional matrix twice the number of keys can be handled. This is considered an advanced topic and will be discussed separately. | |
* `COL2ROW`, `ROW2COL`, `EITHER` or `DUPLEX_SCAN` - how your matrix is configured. | |
* `COL2ROW` means the black mark on your diode is facing to the rows or facing away from the cols. This is considered the preferred choice in QMK when you are planning a new design. | |
* `ROW2COL` means the opposite. The black mark on your diode is facing to the cols or facing away from the rows. | |
* `EITHER` is useful as compensation when a matrix has diodes messed up with their directions. This works properly even when arbitrary number of diodes are soldered wrong way. That means this setting is compatible with `COL2ROW` matrix and `ROW2COL` matrix at the same time. | |
* `DUPLEX_SCAN` is a new strategy to reduce number of pins required to drive a matrix. Compared to a conventional matrix twice the number of keys can be handled. See the section below on using `DUPLEX_SCAN`. |
@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
#define MATRIX_COLS 11 | |||
|
|||
#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } | |||
#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6} | |||
#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5 } | |
#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6} |
This change is not relevant to this PR.
it actually does cause ghosting. I shipped a few of my "broken" hbcp PCBs out and a customer has had an issue with keys triggering while holding down three others (left shift, left ctrl and left arrow triggers right shift). luckily I can fix this with the "fixed" PCBs with the correct diodes, once I get them in.. |
@hineybush Thank you for sharing your experience with us! I really appreciate it.
This will showcase a failure example. Ironically. Definitely, I will add a description on this matter. |
Thank you for your contribution! |
Has conflicts, and unapplied suggestions. |
Thank you for your contribution! |
Thank you for your contribution! |
This is very cool and the diffs are relatively minor. Is there any chance for this code? |
@kbrock I believe anyone can pick this up and continue working on it. because it is already openly released code under the same GPL license. |
Hello, Looking at the changes to the master branch since 2022 Feburary regarding the changes of matrix_read_rows_on_col It might take a few weeks before I can get time to build a test keyboard for the code. The documentation that I plan to update:
|
Hi! I'd say you should better create another pull request for your new revised construct. |
Description
Two things.
1st) Now that we have more than one keyboards that utilize duplexing of matrix by deploying both COL2ROW and ROW2COL at the same time. Namely those keyboards are:
I suggest bringing the so to called COL2ROW2COL code into the core. I labeled it BOTHWAYS .
I've asked the author of those keyboards to test this code. and the result was perfect.
2nd) Using the fact that the technique above fully functions without ghost and with NKRO-bility, it can be proved that key-matrix with inconsistent diode direction can also be made to function, provided proper lines of code. It's worth noting the code for this is also compatible with both COL2ROW and ROW2COL at the same time. I labeled it EITHERWAY .
I suggest using EITHERWAY as a new default for when DIODE_DIRECTION is not defined.This part is taken back.
This PR will not increase footprints of flash-rom or ram for any of the existing keyboards. It even reduces a few bytes for some split keyboards utilizing split_common.
I've also tested BOTHWAYS and EITHERWAY with my one-off experimental keyboard which has STM32F303, and it too worked great.
Minimum extent of documentation is included.
I'm planning to do extended and in-detail guide later on. after this is accepted.
Types of Changes
Checklist