//*****************************************************************
//	WriteData()  
//*****************************************************************
void WriteData() 
{ 
   char data ch; 
   while(ch != 0x0D) // ch is uninitialised here on 1st entry to the loop!!
   { 
      ch = get_char(); 			
      i2c_writebyte(c++,ch); 
      outchar(ch); 
   } 
   wrom = 0; 
   ES = 1; 
}