
void initialize(void){

.
.
.
.
TMOD = 0x21; // T0=16-bits, T1=8-bits auto reload

//set up timer 0 for other interrupts, i.e : sensors routine 
TH0 = 0xFC;  
TL0 = 0x65;
ET0 = 1;
TR0 = 1; 

//set up timer 1 for UART bauding.
SCON = 0x40;      // Serial Mode 1
TH1 = 0xFF;       // 19200 BAUD @ 11,059,000 Hz
TR1 = 1;

EA = 1;
.
.
.
}

void putch(char val) // function to output a single byte character to SBUF
{ 
TI = 0; // transmit flag = 0
SBUF = val; // place the character on SBUF 
while (TI == 0); //wait for the completion of transmission
} 

void main(void)
{
initialize();

while(1){
//LCD Display function call here
//Keypad scanning/decoding function here
if(button pressed) putch('A');
}

}

//If button 1 is pressed
