
void keypad_init(void)  
{
  	KBPATN = 0x22;	   // pins 1 and 5
  	KBCON = 0x00;	   // Port 0 must Not match KBPATN to generate interrupt
        KBMASK = 0x22;  	
	EKBI = 1;
	P2 = 0x55;
	D_reset = 1;       // P0^1
	Tamper = 1;        // P0^5
}

void keypad_isr(void) interrupt 7 using 1  
{
	EKBI = 0;
	D_reset = 0;
	P2 = 0x00;
	if (Tamper)
	{
	 EA = 0;
	 P2 = 0x05;
	}
	KBCON &= 0xFE;	   // clear KBIF interrupt flag by writing 0 to it
	
}




