The P1 is an 8 bit Bidirectional I / O Port with internal pull up resistors, and the P1 output buffer drives four TTL logic levels. When you write "1" on the P 1 port, the internal pull-up resistor pulls the port up, which can be used as the input port. When used as input, the pin which is pulled down by the outside will output current IIL due to the internal resistance. When used as input, the latch must be set to 1.