

unsigned char lcdread(unsigned char page, unsigned char column, unsigned char chipselect)
{
	setpage(page, chipselect);   //shud be self descriptive
	setcolumn(column, chipselect);
	
	ldata=0xFF;		//make I/P port	to read data
	en=0;	
	rw=1;				// now reading from the LCD		rs=1;				//data
	if(chipselect==1)  	// if in Left half of LCD
	{
		cs1=1;
		cs2=0;
	}
	else			 //nahi to right half
	{
		cs1=0;
		cs2=1;
	}
	
	en=1;	   //now data wud NOT have come to port
	
/*===================Double Data Read===================*/
	
	en=0;		  //this made my lyf hell for 3 days, JUST this!

	if(chipselect==1)  	// if in Left half
	{
		cs1=1;
		cs2=0;
	}
	else			 // right half
	{
		cs1=0;
		cs2=1;
	}
	en=1;	   //now data wud have come to port
	return(ldata);       //LDATA IS P3 OR WHATEVER...
}