Posts

Showing posts from June, 2020

To turn LED ON using 8051 Micro-Controller

Image
SOFTWARE: KEIL MICRO VISION 4 SIMULATOR: PROTEUS 8.0 CIRCUIT DIAGRAM: CIRCUIT WORKING: This project is about turning on the led which is connected to port 1.0 of port 1. I have designed this circuit as a current sinking circuit.So in order to turn ON the led,I have provided 0V(logic 0) on port 1.0. PROGRAM : #include<reg51.h> sbit led1 = P1^0; void main() { P1=0xfc; // set Port 1.0 as output led1=1; // initially turn off the led while(1) //continuous loop { led1 = 0; // turn on the led1 } } PROGRAM DESCRIPTION: At starting I have make turned off the led by providing logic 1 (Port1.0).Then for a continuous process,I have used while loop.After that I have turned ON the led by providing logic 0. VIDEO:

Blinking leds using 8051 Micro-Controller

Image
SOFTWARE : KEIL MICRO VISION 4 SIMULATOR : PROTEUS 8.0 CIRCUIT DIAGRAM: CIRCUIT WORKING: This project is about blinking of leds which are connected to port 1.0 and port 1.1 pins of port 1. I have designed this circuit as a current-sinking circuit.So in order to turn ON the leds, I have provided 0V(logic 0) and for turning OFF the leds 5V(logic 1) is provided to the respective pins. PROGRAM : #include<reg51.h>  sbit led1 = P1^0;  sbit led2 = P1^1; void delay(int d);  void main()  { P1=0xfc; // set port 1.0 and port 1.1 as output  led1=1;   // turn off the led1 led2=1; // turn off the led2 while(1) //continuous loop  {  led1 = 0; // turn on the led1 led2 =1; // turn off the led 2 delay(10); // delay of 100 mili seconds  led1=1; // turn off the led1 led2=0; // turn on the led2 delay(10);  } }  void delay(int d) // delay code  { int i; for(i=0;i<d*1274;i++); } PROGRAM DESCRIPTION: At starting I have make both the led's off by providing logic 1 to led1 (port1.0)and led2 (por