> Now I have hardware question about keypad diodes. I attached keypad schematic in pdf format. Using standard keypad without diodes most system I have seen returns only single key press and I have been told if I need multiply key press function I have to add diode per key and what I did is used keypad without the diodes and changed the software that can return multiple key press and it worked fine. The way I am looking at the schematic when Row1 is(0) only keys 1,2,3 can be scanned and with or without diodes I do not see any different. Same thing on Row 2 and Row3 and so on. My question is what is the purpose of diodes? /> The diodes are *necessary* if you wish to prevent phantom key action and allow "N-key rollover". N key rollover is the situation where you allow multiple keys to be pressed at once and released in possibly an order other than they were released in. The keystroke sequence is the order in which the keys were depressed. eg if Aa means - Press switch A, Release Switch A then ABaCcb would be interpreted as A B C And, more importantly (see below) things like ABCbBbBbBaAacb would appear as A B C B B B A B As will be seen below, without diodes there are hardware "sneak paths" that may produce apparently valid key closures for keys which are not pressed when 3 or more keys are pressed at once. If you can live with this limitation then you don't need the diodes for this purpose. _________________ In your example: With no diodes - Row 1 low. Switches 1,6,7 are possibly legal (not 1,2,3) BUT If you simultaneously press 1,2,5 then key 6 APPEARS to be pressed due to the current path Row 1 - SW1 - SW2 - SW5 - column 2 As Row1-column2 is the legal result of SW6 it looks like SW6 is pressed. As this will be decoded when SW2 and Sw5 are NOT being decoded (as they are on ROW2 which is high) you will not "notice" this possible error if you do not examine the resultant key scan table after a complete keyboard scan. The best you can do without diodes is decide whether a key activation MAY be spurious. eg if SW1 SW2 SW5 are pressed then you WILL see SW6 pressed whether it is or isn't. This sort of problem is usually only an issue when you have users who depress multiple keys simultaneously. This is most likely to occur during eg high speed typing or data entry and far less likely to occur with Joe Average keyboard entry. Adding the diodes prevents this path. Diode protection would be mandatory when using keyboards whose design encourages multiple adjacent key depressions and then sorts out the intended key in software such as the very small "thumb entry" keyboards on some PDAs. Without the diodes you can correctly decode any key sequence that does not lead to such spurious paths. Generally you will be OK with up to any 2 keys pressed. Some combinations of 3 or even more keys may be OK. eg here Sw1, Sw2 Sw9 should be OK as their is no "orthogonally connected" path between the 3 keys. Russell McMahon -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist