https://embetronicx.com/tutorials/microcontrollers/pic16f877a/keypad-interfacing-with-pic16f877a/
PIC16F877A - Keypad Interfacing