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

.Archlab Task 04 (Toggling of LEDs Using C Language)

This document describes a lab experiment on toggling LEDs using a C language program on an AT85C51 microcontroller. 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 AT85C51 microcontroller, development board, Keil software, and Prog-ISP. Students will write a C code to generate a delay and toggle LEDs, create a hex file, connect the microcontroller and LEDs, upload the hex file using Prog-ISP, and observe the toggling LEDs. The document provides diagrams of the development board and circuit.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views

.Archlab Task 04 (Toggling of LEDs Using C Language)

This document describes a lab experiment on toggling LEDs using a C language program on an AT85C51 microcontroller. 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 AT85C51 microcontroller, development board, Keil software, and Prog-ISP. Students will write a C code to generate a delay and toggle LEDs, create a hex file, connect the microcontroller and LEDs, upload the hex file using Prog-ISP, and observe the toggling LEDs. The document provides diagrams of the development board and circuit.
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: 04 Course Instructor: Engr. Zia Ur Rahman

Name of Student: Semester: 6th

Registration No: Department: Mechanical Engineering

Lab Task Toggling of LEDs using C Language in AT85C51 Microcontroller

1. To get familiar with Keil µ Vision IDE.


2. To learn how to upload program in STC AT89C51 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
 Proteus

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 C 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 C Language to toggle all general-purpose input output (GPIOs) pins of a port
Code

Prepared by Tanveer Uz Zaman


Results and
Conclusions

Prepared by Tanveer Uz Zaman

You might also like