0% found this document useful (0 votes)
40 views

Lab Task 03 (Toggling of LEDs Using AT89C51 Microcontroller)

This lab document outlines an experiment using an AT89C51 microcontroller to toggle LEDs. The objectives are to get familiar with the Keil μ Vision IDE, learn how to upload programs to an STC development board, create a hex file, and toggle an LED. The required hardware includes an AT89C51 microcontroller development board, Keil software, and LEDs. The procedure involves writing an assembly code to generate a delay and toggle LEDs, creating a hex file, connecting the microcontroller and LEDs, and uploading the hex file. This allows students to learn about microcontrollers and how to program an LED toggle using an 8051 microcontroller.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Lab Task 03 (Toggling of LEDs Using AT89C51 Microcontroller)

This lab document outlines an experiment using an AT89C51 microcontroller to toggle LEDs. The objectives are to get familiar with the Keil μ Vision IDE, learn how to upload programs to an STC development board, create a hex file, and toggle an LED. The required hardware includes an AT89C51 microcontroller development board, Keil software, and LEDs. The procedure involves writing an assembly code to generate a delay and toggle LEDs, creating a hex file, connecting the microcontroller and LEDs, and uploading the hex file. This allows students to learn about microcontrollers and how to program an LED toggle using an 8051 microcontroller.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Course Code and Name: Introduction to

Mechatronics Lab (ME-332L) Date:

Lab No: 03 Course Instructor: Engr. Zia Ur Rahman

Name of Student: Semester: 6th

Registration No: Department: Mechanical Engineering

Lab Task Toggling of LEDs using AT89C51 Microcontroller

1. To get familiar with Keil µ Vision IDE.


2. To learn how to upload program in STC AT89S51 Development board.
Objectives 3. To familiar with how to create a hex file.
4. To learn how to toggle LED using AT89C51.

 STC AT89C51 Microcontroller


 Development Board
Hardware
 Keil µ vision IDE
and Software  Prog-ISP
Requirements  Wires
 LEDs

Theory Microcontroller:
A microcontroller is a compact integrated circuit designed to govern a specific operation in
an embedded system. A typical microcontroller includes a processor, memory and input/output
(I/O) peripherals on a single chip.

Microcontroller 8051:
8051 microcontrollers are designed by Intel in 1981. It is an 8-bit microcontroller. It is built with
40 pins DIP (dual inline package), 4kb of ROM storage and 128 bytes of RAM storage, 2 16-bit
timers. It consists of are four parallel 8-bit ports, which are programmable as well as addressable
as per the requirement. An on-chip crystal oscillator is integrated in the microcontroller having
crystal frequency of 12 MHz.

Toggling:
Toggle refers to the act of switching from one view, setting, or function to another. It implies
that there are only two possible options and that a user is switching between them, and usually
these options are on or off for a specific preference.

Prepared by Tanveer Uz Zaman


Diagram of Microcontroller 8051:

Fig. Development Board with AT89C51 Microcontroller

Fig. Circuit Diagram

Prepared by Tanveer Uz Zaman


Procedure  First we have to write a code in Assembly language in keil Software in which we
have to generate a delay and toggle the LEDs after that delay.
 After that we have to create a hex file of that code.
 On the basis of that code we have to make a connection of STC AT89C51
Microcontroller with LED as shown in the figure below.
 The hex file will be uploaded into STC AT89C51 Microcontroller through Prog-
ISP.
 During uploading the power of the board should be turn ON.
 When code is successfully uploaded we will see that LED will toggle after some
delay.

Programming Write a code in 8051 assembly language to toggle all general-purpose input output (GPIOs) pins
Code of a port

Prepared by Tanveer Uz Zaman


Results and
Conclusions

Prepared by Tanveer Uz Zaman

You might also like