Thursday 8 March 2018

LED Blinking Using 8051


Introduction:
To design LED blinking using 8051, we required Keil5 software and Proteus software.
Keil software is used to write a program for 8051 in assembly or Embedded C. 
Proteus is used to design 8051 LED blinking circuit and test keil program.
Following steps are carried out to blink LED using 8051.

Procedure:
1) Create a project in Keil software with target as AT89C51 Atmel Microcontroller.
2) Create New assembly file and write a code for 8051. Here we use Pin2.0 of 8051 for LED connection.
3) Compile and Run the code in Keil.
4) Generate Hex file using “flash --> Output” option of Keil.
5) Design the circuit in Proteus software as per circuit diagram.
6) Load Hex file generated by Keil software in Proteus circuit.
7) Run the circuit in Proteus. 

Assembly Program:

org 00h;
led equ P2.0;     // set LED pin
up:setb led; // to turn ON LED
acall delay; // Call delay
acall delay;
acall delay;
clr led; // to turn off LED
acall delay;
acall delay;
acall delay;
sjmp up
delay : // Delay Program
mov r1,#0f0h;
l1:djnz r1,l1;
ret
end


Assembly Program in Keil software
 


Proteus Simulation for LED OFF

 Proteus Simulation for LED ON


No comments:

Post a Comment