Sardar Patel Institute of Technology: Experiment Number 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

BharatiyaVidya Bhavan’s

Sardar Patel Institute of Technology


Bhavan’s Campus, Munshi Nagar, Andheri (West), Mumbai-400058 India

(Autonomous College Affiliated to University of Mumbai)

Name – Pulkit Chaudhari. Subject – Microcontrollers LAB.


UID Number – 2019110010. Branch – ETRX A.

EXPERIMENT NUMBER 1

Aim:

To program the I/O Port of 8-bit 8051 Microcontroller and effectively interface the

LED and switch.

Objective:

(i) Input: To use P1.0 and P1.1 as input port for 2 switches (SPST switches)
for controlling LEDs at output port.

(ii) Output: To use P0.0 and P0.1 as output port for 2 LEDs which will be
controlled using switches at input port for two configurations of Continuous
LED glow and Blinking LED glow.

(iii) Delay: Delay to be used is of 20ms.

Software used:

Proteus for Circuit Design and Keil µVision5 for writing C code.
BharatiyaVidya Bhavan’s

Sardar Patel Institute of Technology


Bhavan’s Campus, Munshi Nagar, Andheri (West), Mumbai-400058 India

(Autonomous College Affiliated to University of Mumbai)

Procedure:

(1) Create a Proteus project in administration mode and draw the circuit diagram
as show in figure below.

(2) Create a new Keil file and save it with .c extension and write the c code in it.

(3) Save the C code and right click on Target 1 and click on the first option and
under the output tab check the HEX file dialog box.

(4) After building when the HEX file is created go to Proteus and double-click on
the Microcontroller and in Program file browse to the directory where Objects
folder is and in it open the HEX file after that click on OK.

(5) Click on RUN on the Bottom Left corner of the application.

(6) Check whether the conditions are satisfied for Continuous LED glow.

(7) For Blinking LED glow, remove the 1st c file create from source group and add
new c file to it for Blinking LED glow.

(8) Repeats the rest of the steps as done for Continuous LED glow.
BharatiyaVidya Bhavan’s

Sardar Patel Institute of Technology


Bhavan’s Campus, Munshi Nagar, Andheri (West), Mumbai-400058 India

(Autonomous College Affiliated to University of Mumbai)

Program:
(i) For Continuous LED glow:

(ii) For Blinking LED glow:


BharatiyaVidya Bhavan’s

Sardar Patel Institute of Technology


Bhavan’s Campus, Munshi Nagar, Andheri (West), Mumbai-400058 India

(Autonomous College Affiliated to University of Mumbai)

Interfacing:
(i) For Continuous LED glow:

(ii) For Blinking LED glow:


BharatiyaVidya Bhavan’s

Sardar Patel Institute of Technology


Bhavan’s Campus, Munshi Nagar, Andheri (West), Mumbai-400058 India

(Autonomous College Affiliated to University of Mumbai)

Result:

After proper connections of LEDs and Switches with the Microcontroller 8051
(AT89C51) and using Keil to create C code for interfacing with the microcontroller
there are two configurations of LED Glow.
(i) Continuous LED glow which glows without any delay on holding the switch
to ON position.

(ii) Blinking LED glow which glows with a delay of 20ms (Experimental Delay )
on holding the switch to ON position.

Conclusion:

Hence with the help of programs like Keil µVision 5 and Proteus we can create a simple
Interface of Microcontroller 8051 with LEDs for either Continuous or Blinking glow. But
the delay used of 20ms is experimental i.e. it is not accurate.

You might also like