Author Topic: Newbie question: Matrix scan order and diode orientation  (Read 873 times)

0 Members and 1 Guest are viewing this topic.

Offline bokeron

  • Thread Starter
  • Posts: 1
Newbie question: Matrix scan order and diode orientation
« 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:

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.
  • But… at what state do the inputs start? Are they also driven HIGH or left alone in undetermined state (Hi-Z?).
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…
  • What direction does the current flow? Col to Row?
  • And therefore, how are the diodes set? Allow current from Col to Row?
   
Could somebody please clarify this to me? I can’t get my head around this.