Clear the port's bit in its PORT register, then output the inverted level to the pin's bit in the DDR register. This way when you write a 0 to the DDR register, the pin becomes an input, and thus high-impedance. When you write a 1 to the DDR register, it becomes an output of a low level...