Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Electronic problem with matrix keyboard using 8086

Not open for further replies.


Newbie level 3
May 23, 2011
Reaction score
Trophy points
Activity points

I have problem with eletronic in this matrix keyboard (professor told me that). First with 8282 I send zero on all 8 lines and wait key to be pressed. Before any key is pressed all lines in AND port is all 1. When key is pressed one of the 13 lines is zero and the NMI interrupt is called. In NMI procedure I scan matrix. The problem is with switches. He (professor) told me that currency won't flow correctly and components will be demaged (the currency will flow into the 8282 and ENCODER) this is not the proper way because 8282 is output port.

Thanks for helping


I think professor is wrong!

There are some things to note though:
1. The second 8282 output is just an encoded representation of the top one. It doesn't carry any information about the keys at all.
2. 13-input nand gates don't exist, you would have to make it out of several smaller ones - why not 'nand' after the encoder where there are only 4 bits to check?
3. I can't see any purpose for the bottom 8282.

The more usual way of approaching this is to accept a 4-bit number from the bus and decode it into 1 of 16 to drive the keyboard rows and to encode the columns back to another 4 bits. This leaves you with 4 output bits spare and 4 input bits spare.


Thanks for reply

About first note: This encoder can't carry zero on all lines which is needed to capture pressed key. First is used to generate zero on all lines (in the first time), after NMI is called the first 8282 sends 1 on all lines except one, that zero bit is shifted while proper row is discovered, then I get byte from second and third 8282 to form code.

The button 8282 is used for CTRL, ALT,SHIFT keys.

Hence, every keypress on this keyboard will fire NMI interrupt and I will be able to read key location and electronic components will survive? :))



Given that you need to drive the 8 rows independantly to make them all zero, why not just note the number you write to the top 8282 and convert it to 4 bits in software. It seems overkill to use two ICs just to convert the number you start with into a different radix.

I can't see any electrical problem that would cause damage. It isn't clear what the components on the top and right side of the matrix are but I assume they are pull-up resistors, you don't need them on the rows because the top 8282 is always driving them. It would be advisable to add resistors (about 100 Ohms) in series with the row signals to the matrix just in case more than one key is pressed simultaneously, the resistor would limit the current that might flow between high and low signals on the outputs of the top 8282.


Thanks Brian for advice.

Not open for further replies.

Part and Inventory Search

Welcome to