Russell, Now I know what's happening you are looking at top labels where it says SW1 and I am looking at bottom where is says 1 so 1,2,3 labels are SW1,SW6,SW7. Sorry about that I drew it fast and didn't pay attention to Switch Reference names that you ware looking at. thanks for your explanation sorry about that. Andre -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]On Behalf Of Andre Abelian Sent: Tuesday, June 26, 2007 11:13 AM To: Microcontroller discussion list - Public. Subject: RE: [EE] about keypad diodes Russell, When Row1 is 0 and Row2,3 is 1 the only buttons will work is 1,2,3. Row2 and Row3 are logic 1 and col1, col2, col3 have pull-up (logic 1) no thing will happen when they pressed. I am looking at the schematic I am sure about that. Andre _________________ 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 -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist