Since you haven't shown your circuit diagram, I assume we're talking about a pin that is open-drain (or open-collector) and you want to use that to light a LED. In that case, have the LED connected between output pin and VDD/VCC. Send 0 to the pin to turn the LED on and send 1 to the pin to turn the LED off. You don't need the pull-up resistor. Of course you'll need to have a current-limiting resistor in series with the LED. However, you can not turn the LED on with a 1 if the LED is connected between the output pin and VDD/VCC. To turn the LED on with a 1, the LED must be connected between the output pin and ground.
Dear friends,
I am trying to glow an LED from port 1 of 89C52 microcontroller.
I have arranged the components as shown in the ckt diagram in the last reply by Tahmid.
But, I am unable to glow the LED.
I also measured the voltage across the pin to which LED was connected (P1_5).
It comes out to be +Vcc.
But, the voltage across LED and resistor(470E) is 0V.