karo89
Newbie level 5
- Joined
- Apr 22, 2011
- Messages
- 10
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,345
can i connect LEDs directly to the 80c51 output port??
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I think you need to write some code i.e LED ON/OFF..
If you connect direct LED to 80c51 it may not glow so write some necessary code and interface with LED...
You mcu ports are open drain/collector with internal pull-ups for port1,2,3 and without pull-ups for port0.
They outputs can't provide any current at the high state, they can only sink current (provide ground) at the low state.
Note 1 in the datasheet says
Under steady state (non-transient) conditions, IOL must be externally limited as follows:
Maximum IOL per port pin: 10 mA
Maximum IOL per 8-bit port: Port 0: 26 mA,Ports 1, 2, 3: 15 mA
Maximum total IOL for all output pins: 71 mA
If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater than the listed test conditions.
Maybe you can get away with one led at about 8mA (driving the cathode with the mcu, will light with logic 0) and only one led in the port but it would be better to use a transistor to drive the led and be able to use the led with a higher current.
Alex