What about complementing the pin in question with the normally closed contacts. This would change them from Reading low to reading high. Regards, Jim -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of Andre Abelian Sent: Monday, December 04, 2006 5:03 PM To: Microcontroller discussion list - Public. Subject: [pic]: keypad routine Hi to all engineers, I am working on a project that has 5x5 keypad is used. Just today I realized that 4 of it's keys are normally closed and also 5th column is connected to RC2 and the rest to RD port (col) and RB0 is connected to 5th Row and the rest of port D (Row). The way I was using keypad scan was assumed every thing was connected to same port. Those normally closed keys are kind of confusing me because when key is not pressed it will return 0 but in this case I can't take 0 as key pressed. any recommendation or method should I use any routine in c will appreciate. I use 18f4550 with ccs c compiler. Andre -- 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