Exp 01

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

Heaven’s light is our guide

RAJSHAHI UNIVERSITY OF ENGINEERING & TECHNOLOGY


Department of Mechatronics Engineering

Lab Report

Experiment No.:01
Experiment Name: Sequential LED Blinking using Atmega32 with Proteus Simulation.

Submitted By: Submitted To:


Md. Emdadul Haque Emon Md Mehedi Hasan
ID: 2008029 Assistant Professor,
3rd Year , Odd Semester Department of Mechatronics Engineering,
Department of Mechatronics Engineering, Rajshahi University of Engineering &
Rajshahi University of Engineering & Technology, Rajshahi-6204.
Technology, Rajshahi-6204.

Md. Sakib Hassan Chowdhury


Lecturer,
Department of Mechatronics Engineering,
Rajshahi University of Engineering &
Technology, Rajshahi-6204.

Date of Experiment: 04.03.2024


Date of Submission: 20.04.2024

MTE 3104
Microcontroller and Interfacing Sessional
Experiment No: 01
Experiment Name: Sequential LED Blinking using Atmega32 with Proteus Simulation.
Objectives:
1. To understand AVR microcontroller programming.
2. To implement LED blinking using Atmega32 microcontroller.

Theory:
Microchip Technology currently possesses the AVR (Advanced Virtual RISC) microcontroller series,
initially developed by Atmel Corporation. These microcontrollers are widely utilized in various
embedded systems due to their remarkable performance, low power consumption, and extensive feature
set. Based on the Harvard architecture, AVR microcontrollers divide the data and instruction buses to
allow simultaneous access to program memory and data.
Key attributes of AVR microcontrollers include:
1. RISC Architecture: AVR microcontrollers utilize a Reduced Instruction Set Computing (RISC)
architecture, featuring a concise set of efficient instructions. This design enables rapid execution
of instructions and optimal resource utilization.
2. Flash Memory: AVR microcontrollers typically incorporate non-volatile flash memory for
storing program code, facilitating easy reprogramming without external memory devices.
3. Peripheral Integration: These microcontrollers integrate various peripherals like
timers/counters, analog-to-digital converters (ADC), serial communication interfaces (UART,
SPI, I2C), PWM generators, and digital I/O ports. These peripherals offer versatile functionality
for interfacing with external devices and sensors.
4. Low Power Consumption: Designed for low power operation, AVR microcontrollers are
suitable for battery-powered and energy-efficient applications. They offer multiple power-saving
modes and features such as sleep modes and clock prescaling to minimize power usage.
5. Development Tools: AVR microcontrollers are supported by a wide array of development tools,
including integrated development environments (IDEs) such as Atmel Studio and third-party
compilers/debuggers. These tools streamline software development, debugging, and simulation
of AVR-based projects.
LED Blinking:
A fundamental experiment in microcontroller programming involves controlling digital output by
flashing an LED. LEDs are semiconductor devices that emit light when forward biased and are
commonly used as visual indicators in electronic circuits.
LED blinking entails periodically turning an LED on and off to produce a flashing effect, often employed
as an introductory exercise in microcontroller programming.
The basic steps for LED blinking with AVR microcontrollers are:
1. Initializing I/O Pins: Configure the microcontroller's I/O pins connected to the LEDs as output
pins by setting the Data Direction Register (DDR) accordingly.
2. Controlling LED States: To turn an LED on, set the corresponding output pin to a logic high;
to turn it off, set the pin to a logic low.
3. Introducing Delays: Employ delay functions or timers to introduce a pause between turning the
LED on and off, determining the blinking frequency.
4. Iterating the Process: Continuously loop through the sequence of turning the LED on and off
with appropriate delays to sustain the blinking effect. This loop continues indefinitely until the
microcontroller is reset or powered off.

Working Principle:
1. Initially, the program sets the PORTC register to 3, thereby turning on two LEDs connected to
pins PC0 and PC1.
2. Subsequently, the program enters a for loop, iterating from 1 to 3.
3. Within the loop, the PORTC register undergoes a left-shift operation by 2 bits in each iteration.
This action effectively turns off the previously lit LEDs and turns on the next two LEDs in
sequence.
4. A delay of 1000 milliseconds is introduced between each transition using the _delay_ms function.

Required Components for Simulation:


1. Atmega32 microcontroller
2. Eight LEDs
3. Proteus simulation environment.

Figure:

Fig 1.1: Blinking 1


Fig 1.2: Blinking 1

Discussion:
This experiment serves as a fundamental introduction to microcontroller programming and digital output
management. Its scope can be expanded into more intricate projects by integrating additional
functionalities such as user interaction, sensor integration, and communication protocols. Understanding
LED blinking is crucial for beginners as it lays the groundwork for numerous embedded systems
projects.

Practical Applications:
Sequential LED blinking finds widespread application in various domains including:
1. Signaling and indicator systems
2. Traffic management systems
3. Entertainment and decorative lighting installations
4. Testing and debugging procedures for microcontroller systems

Conclusion:
This experiment effectively demonstrates sequential LED blinking utilizing the Atmega32
microcontroller within the Proteus simulation environment. The provided code illustrates how to manage
multiple LEDs sequentially through manipulation of the PORTC register. By implementing this
experiment, fundamental concepts of microcontroller programming like digital output control and timing
manipulation are comprehensively explored

Reference:
[1] Atmel Corporation, "ATmega32 8-bit AVR Microcontroller Datasheet," Atmel Corporation, San Jose,
CA, USA, Rev. 8156C–AVR–11/15, Nov. 2015. [Online]. Available:
https://ww1.microchip.com/downloads/en/devicedoc/doc2503.pdf. [Accessed: April 17, 2024].
[2] Labcenter Electronics Ltd., "Proteus User Manual," Labcenter Electronics Ltd., Witney, Oxfordshire,
UK, Version 8.10, Jan. 2020. [Online]. Available:
https://www.labcenter.com/downloads/prov8_user_manual.pdf. [Accessed: April 17, 2024].

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy