Professional Documents
Culture Documents
Interfacing of LED 8051
Interfacing of LED 8051
Interfacing of LED 8051
Microcontrollers
Read latch
TB2
TB1
Read pin
8051 IC
Port 0 with Pull-Up Resistors
4
Vcc
10 K
P0.0
DS5000 P0.1
Port 0
P0.2
8751 P0.3
8951 P0.4
P0.5
P0.6
P0.7
5 A Pin of Port 1
TB1
Read pin
8051 IC
6 Writing “1” to Output Pin P1.X
Clk Q 0 M1
output 1
Write to latch
TB1
Read pin
8051 IC
7 Writing “0” to Output Pin P1.X
Clk Q 1 M1
output 0
Write to latch
TB1
Read pin
8051 IC
LED (Light Emitting Diode)
The intensity of the light emitted by an LED depends on the amount of
forward current passed through the device. The maximum allowable forward
current is denoted by IFmax.
When designing an LED circuit, we have to know the typical voltage drop,
VTyp across the device, and the maximum allowable voltage drop, V Fmax.
The brightness of the emitted light is measured in millicandela (mcd) and this
is usually referenced to the forward current.
For example, standard red LEDs are quoted to have brightness of 5 mcd when
operated at 10 mA.
Interfacing LED
● Current passing through the LED should be limited to
maximum forward current (IF).
● To find the value of this resistor, we use the forward voltage and
forward current.
● We design a circuit with 5V supply and forward current of
10mA. We use a red LED here.
ORG 00H
START: MOV A,#00
MOV P1,A
CALL DELAY
MOV A,#0FF;
MOV P1,A
CALL DELAY
SJMP START
END
Delay Subroutine
Instruction No of Bytes
DELAY: MOV R0, #0FFH 2
L2: DJNZ R0, L2 3
RET 3
Delay Generated by Subroutine