geekhack

geekhack Community => Keyboards => Topic started by: bokeron on Tue, 24 May 2022, 11:01:27

Title: Newbie question: Matrix scan order and diode orientation
Post by: bokeron on Tue, 24 May 2022, 11:01:27
Hi everybody.

I’m trying to understand very basic questions that have been answered a thousand times but in a way I don’t get or maybe I’ve read too much for my own good and now everything is a mess because I lack the education to grasp them.
So, If you allow me asking them, I’ll probably be asking here from time to time.

I’m starting with the keyboard matrix, rows, columns, inputs, outputs, low, high, Hi-Z and whatnot.
I’ll describe what I’ve understood so far – which doesn’t mean I’ve understood it right, so please correct me where I’m wrong.

A picture you’ve already seen a million times:
(https://i.ibb.co/jfpgqBL/Example-Matrix.jpg)
As you see, the customary matrix, without diodes yet.

Now… if I’ve understood it right, because MCUs use pull-up resistors, an “active-low” method is used. The consequences of this are being difficult for me to understand.

So, outputs are all set to HIGH and are driven LOW one by one to sequentially read inputs and find which one is also LOW, what means a key is pressed.
Also, about current flow and diodes…

Let’s say ROWs are output and COLs are input. When scanning, a switch is pressed and row in LOW state is connected to a column in ¿? state, so…
   
Could somebody please clarify this to me? I can’t get my head around this.