diff options
Diffstat (limited to 'content/zettel/5a1a.md')
-rw-r--r-- | content/zettel/5a1a.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/content/zettel/5a1a.md b/content/zettel/5a1a.md new file mode 100644 index 0000000..aca3fe7 --- /dev/null +++ b/content/zettel/5a1a.md @@ -0,0 +1,35 @@ ++++ +title = "Matrix scanning" +author = "Yann Herklotz" +tags = [] +categories = [] +backlinks = ["5a1"] +forwardlinks = ["5a1b"] +zettelid = "5a1a" ++++ + +The main idea of how the keyboard circuit works together with the +embedded processor, is that instead of requiring an IO pin for each of +the keys on the keyboard, it instead really only needs one IO pin for +all the keys in the matrix. The keys are placed in a matrix circuit such +that when a key is pressed, the columns of the matrix can be scanned +sequentially to figure out where the key is. + +This can be done, for example, by connecting all the keys, which are +also switches, into on column with the other keys, and then also +connecting the keys in the same row together. To then identify if a key +has been pressed, the micro-controller has to scan all the rows and +columns. This is done by setting all the columns to high sequentially, +and then scanning which rows receive that signal. This means that one +can then get a matrix representation with a bit set for each key that +has been set. + +However, there are situations when keys can be ghosted, where pressing +three keys connects all the lines in the matrix, which means that it +then is not possible to distinguish a key from the others. The larger +the matrix, the more often keys can be ghosted. To solve this issue, we +therefore have to stop current from flowing backwards in the matrix, +which is the original cause of the ghosted keys. This can be done by +adding diodes after each key, before the key connects to the row. This +means that ghosted keys are therefore not possible, as the only way to +go from one row to the other is if the switch in the current row is set. |