Hello abbas,
Try this,
// Using definitions from your code....
#define CON_LEFT 0
#define CON_RIGHT 1
unsigned char Ks_readbyte( unsigned char con )
{
unsigned char rd_byte;
rs = 1; // we're not sending command
P1 = 0xff; // as input(float lines)
rw = 1; // we're reading
// Assuming non-inverted CS
if( con == CON_LEFT ) { // reading from left controller
cs1 = 1;
cs2 = 0;
} else { // reading from right controller
cs1 = 0;
cs2 = 1;
}
en = 1;
_nop_();
rd_byte = P1; // read while en=1 !
en = 0;
cs1 = cs2 = 0; // de-select both controllers
P1 = 0x00; // as output
return rd_byte;
}
Hope you can work that out now. If you still have any problem, I can post isis sample.
BTW, how are able to put text, images on LCD when you're having problems with read

My code for putting pixel on LCD involves call to readbyte() function

How did you managed to do that

regards,
sam_des