A similar project which I had done a few years ago. Here is the code.
unsigned short kp;
char uart_rd;
char code1[15] ,user1[4];
int i = 0, j, cnt = 0;
int w1;
//keypad module connections
char keypadPort at PORTD;
//end keypad module connections
//lcd module connections
sbit LCD_RS at...