I think I got the idea. Thanks a million for the detailed explanation!
And Happy New Year to everyone!
Tom
And Happy New Year to everyone!
Tom
Here is a schematic to illustrate how you would interrogate four switches using the matrix scan method. This would require two output pins and two input pins for a total of four pins. Of course, you would not do this for only four switches. For 64 switches, you would use 8 input/output pins and 8 input pins for a total of 16 I/O pins.
The buffers shown are not actual circuits. They are there just to indicate which lines are outputs and which are inputs.
To begin the scan, all eight U1 lines are set to INPUT mode.
All eight bits read back at U2 will be HIGH.
If U1A alone is set to OUTPUT LOW, inputs at U2 will read back a LOW for every CLOSED switch on the U1A line.
Repeat this for every U1 line in order to scan all switches.
(Have to modify to make U1 lines into INPUT mode when not being used to send LOW).