For example lets use port P1.
If i want to output something i just write P1 = number; in keil C.
As i understand that value will be always on that port until next write.
If it is true, and if i want now to receive something on P1, it can not be received if port is already transmitting something. How to prepare port for input?
It also depend upon which microcontroller ur using..
In some 8051 u have to decide direction of the port i.e. output or input
I f its bidirectional port then above logic is true i.e. writing 1 before reading..