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

LAB1 Introduction to Embedded Systems

Embedded system Biomedical engineering
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

LAB1 Introduction to Embedded Systems

Embedded system Biomedical engineering
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

LAB 1: INTRODUCTION TO EMBEDDED SYSTEMS AND

AVR MICROCONTROLLERS
EMBEDDED SYSTEMS AND INTERFACING LAB

BY: ENG . MOHAMMED ABDALNASSER ALZAGHIR


773215130
771311599
GRADES

 Attendance 20%
 HW. 15%
 Practical Test 25%
 Concepts Test 15%
 Project 25%
TOPICS AND LABS
 Introduction to Embedded systems and AVR  UART (HC-06 – WiFi module)
microcontrollers
 I2C
 Getting started with atmega16 and atmel studio
 SPI
 GPIO Digital output and 7-segment display
 ESP32 and IoT
 GPIO Digital input and Keypad
 16x2 LCD display
 Interrupt
 Counters / Timers (Compare – Input capture - )
 PWM
 ADC
TOPICS AND LABS

 Lecture Topics
1. Overview of Embedded Systems
2. Applications of Embedded Systems in Mechatronics
3. Introduction to AVR Microcontrollers
4. AVR Architecture and Key Features
5. Introduction to the Development Environment (Atmel
Studio\)
OVERVIEW OF EMBEDDED SYSTEMS

 Definition of Embedded Systems: An embedded system is a combination of hardware and software

designed to perform a specific function or task within a larger system. Unlike general-purpose computers,

embedded systems are dedicated to particular tasks, optimizing performance, power consumption, and

cost.
OVERVIEW OF EMBEDDED SYSTEMS

 Characteristics of Embedded Systems:

• Specialized Functionality: Designed for specific control functions within a larger system.

• Real-Time Operation: Often required to respond to events within strict time constraints.

• Resource Constraints: Limited memory, processing power, and power consumption.

• Reliability and Stability: Must operate reliably under varying conditions for extended periods.
COMPONENTS OF EMBEDDED SYSTEMS:

• Microcontroller/Microprocessor: The brain of the system, executing programmed instructions.

• Memory: Stores the program code and data (RAM, ROM, Flash).

• Peripherals: Interfaces for communication (UART, I2C, SPI), input (sensors), and output
(actuators).

• Power Supply: Provides the necessary electrical power for operation.


TYPES OF EMBEDDED SYSTEMS:

•Stand-alone Systems: Operate independently without the need for a host system (e.g., digital watches).

•Real-time Systems: Respond to inputs or events within a predefined time frame (e.g., automotive control

systems).

•Networked Systems: Connected to other systems or networks for communication (e.g., IoT devices).
SoC

MCUs
•Wireless MCUs
•Automotive
FPGA
TYPES OF MCUs

EMBEDDED
Embedded
SYSTEMS Systems
CONTROLLERS

ASIC PLC

DSP
FPGA

SoC PLC
TYPES OF
EMBEDDED
Embedded
SYSTEMS Systems
CONTROLLERS
MCUs
•Wireless MCUs
•Automotive
DSP
MCUs

ASIC
PLC

FPGA DSP
TYPES OF
EMBEDDED
Embedded
SYSTEMS Systems
CONTROLLERS

SoC ASIC

MCUs
•Wireless MCUs
•Automotive
MCUs
DSP

PLC ASIC
TYPES OF
EMBEDDED
Embedded
SYSTEMS Systems
CONTROLLERS
MCUs
FPGA •Wireless MCUs
•Automotive
MCUs

SoC
ASIC

MCUs
DSP •Wireless MCUs
•Automotive
TYPES OF MCUs

EMBEDDED
Embedded
SYSTEMS Systems
CONTROLLERS

PLC SoC

FPGA
MCUs
•Wireless MCUs
•Automotive
MCUs

ASIC SoC
TYPES OF
EMBEDDED
Embedded
SYSTEMS Systems
CONTROLLERS

DSP FPGA

PLC
MCUs
•Wireless MCUs
•Automotive
MCUs

ASIC SoC
TYPES OF
EMBEDDED
Embedded
SYSTEMS Systems
CONTROLLERS

DSP FPGA

PLC
Applications of Embedded Systems in Real world
SMARTPHONES:
COMBINING COMMUNICATION,
COMPUTING, AND MULTIMEDIA
CAPABILITIES.
CONSUMER
ELECTRONICS HOME APPLIANCES:
SMART REFRIGERATORS, WASHING
MACHINES, AND OVENS WITH
EMBEDDED CONTROL FOR
APPLICATIONS ENHANCED FUNCTIONALITY.
Engine Control Units (ECUs):
Managing engine performance,
emissions, and fuel efficiency.

Advanced Driver Assistance


Systems (ADAS):
Automotive
Features like lane-keeping assist,
adaptive cruise control, and
automatic emergency braking.
APPLICATIONS
•Programmable Logic Controllers
(PLCs):
Automating machinery and
processes in manufacturing.
INDUSTRIAL
AUTOMATION Robotics:
Embedded systems in robotic arms
and automated guided vehicles
(AGVs) for precise control and
APPLICATIONS navigation.
•Medical Devices: Embedded
systems in pacemakers, insulin
pumps, and diagnostic equipment
for monitoring and treatment. Healthcare

Wearable Health Monitors:


Tracking vital signs and fitness
metrics in real-time.
APPLICATIONS
•Avionics:
Embedded systems in flight control,
navigation, and communication.
AEROSPACE AND
DEFENSE Unmanned Aerial Vehicles
(UAVs):
Drones with embedded systems for
autonomous flight and data
APPLICATIONS collection.
 3. Introduction to AVR Microcontrollers
Intro.
microcontrollers Atmel

AVR is a family of microcontrollers developed since 1996 by Atmel, acquired


Microchip Technology modified Harvard architecture 8-bit

by Microchip Technology in 2016. These are modified Harvard architecture 8-


8-bit RISC

bit RISC single-chip microcontrollers. AVR was one of the first microcontroller families
flash memory one-time programmable ROM

to use on-chip flash memory for program storage, as opposed to one-time


one-time programmable ROM EPROM EEPROM

programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time.

AVR microcontrollers – Wikipedia


Atmel AVR instruction set - Wikipedia
Intro.

The AVR is a modified Harvard architecture machine, where program and

data are stored in separate physical memory systems that appear in

different address spaces, but having the ability to read data items from

program memory using special instructions.


History and Development

•AVR microcontrollers were developed by Atmel (now part of Microchip Technology) in the

1990s.

•Known for their high performance, low power consumption, and ease of use in embedded

applications.
•Various older AVR microcontrollers:
ATmega8 in 28-pin narrow dual in-line
package (DIP-28N), ATxmega128A1 in 100-
pin thin quad flat pack (TQFP-100)
package, ATtiny45 in 8-pin small outline
(SO-8) package.
AVR
•ATmega328P in 28-pin
narrow dual in-line package
(DIP-28N). It is commonly
AVR found on Arduino boards.
AVR Microcontroller Family

 TinyAVR: Small, simple, and low-power microcontrollers for basic applications.

 MegaAVR: Popular and versatile microcontrollers with a rich set of peripherals.

 XMEGA: High-performance microcontrollers with advanced features for complex applications.

 Application-specific AVR megaAVRs with special features not found on the other members of the AVR family,
USB

such as LCD controller, USB controller, advanced PWM, CAN, etc.


FPGA

 FPSLIC (AVR with FPGA) FPGA 5k to 40k gates

 32-bit AVRs
AVR Microcontroller Family

 The ATtiny series features small package microcontrollers with a limited peripheral set available.
However, the improved tinyAVR 0/1/2-series (released in 2016) include:
• Peripherals equal to or exceed megaAVR 0-series
• Event System
• Improved AVRxt instruction set, hardware multiply

Frequency
Flash size Package SRAM EEPROM
[MHz]
0.5–32 KB 1.6–20 6–32-pin package 32–3072 bytes 64–512 bytes

ATtiny microcontroller comparison chart - Wikipedia


AVR Microcontroller Family

 The ATmega series features microcontrollers that provide an extended instruction set (multiply
instructions and instructions for handling larger program memories), an extensive peripheral set,
a solid amount of program memory, as well as a wide range of pins available. The megaAVR 0-
series (released in 2016) also has functionality such as:
• Event system
• New peripherals with enhanced functionality
• Improved AVRxt instruction set

Frequency
Flash size Package SRAM EEPROM
[MHz]
4–256 KB 1.6–20 28–100-pin package 256–16384 bytes 256–4096 bytes
AVR Microcontroller Family

 the ATxmega series offers a wide variety of peripherals and functionality such as:
• Extended performance features, such as DMA, "Event System", and cryptography support
ADCs

• Extensive peripheral set with ADCs

Frequency
Flash size Package SRAM EEPROM
[MHz]
16–256 KB 32 44–100-pin package 1–32 KB 512–2048 bytes

ATtiny microcontroller comparison chart - Wikipedia


AVR Architecture and Key Features
Architecture Overview

•Harvard Architecture: Separate memory spaces for program code and data, allowing

simultaneous access.

•Registers: 32 general-purpose working registers for fast and efficient data manipulation.

•ALU: Arithmetic Logic Unit for performing arithmetic and logical operations.
Memory Organization:

•Flash Memory: Non-volatile memory for storing the program code.

•SRAM: Volatile memory for runtime data storage.

•EEPROM: Non-volatile memory for storing data that must be preserved across power cycles.
I/O Ports:

•Digital I/O: Configurable as input or output for interfacing with digital devices.

•Analog I/O: Analog-to-Digital Converter (ADC) for reading analog signals.


Timers and Counters:

• Timers: For generating precise time delays, PWM signals, and event counting.

• Counters: For counting external events and generating timing signals.


Communication

•USART: Universal Synchronous/Asynchronous Receiver/Transmitter for serial communication.

•I2C: Inter-Integrated Circuit for communication with multiple devices using a two-wire interface.

•SPI: Serial Peripheral Interface for high-speed communication with peripherals.


Power Management:

•Sleep Modes: Various low-power modes to reduce power consumption during idle

periods.

•Brown-Out Detection: Ensures reliable operation by resetting the microcontroller

when the supply voltage drops below a certain threshold.


Key Features of AVR Microcontrollers

•RISC Architecture: Reduced Instruction Set Computing for efficient and fast instruction execution.

•Flash Memory: In-system programmable memory for storing code, allowing easy updates.

•Peripheral Integration: Built-in peripherals like timers, ADCs, PWMs, UARTs, I2C, and SPI for

versatile interfacing.

•Low Power Consumption: Power-saving modes for battery-operated applications.


Example Microcontroller: ATmega328P

•Core: 8-bit AVR with RISC architecture.

•Clock Speed: Up to 20 MHz.

•Memory: 32 KB Flash, 2 KB SRAM, 1 KB EEPROM.

•Peripherals: 3 timers, 6 PWM channels, 8-channel 10-bit ADC, USART, SPI, I2C.

•Applications: Widely used in Arduino boards, making it accessible for prototyping and learning.
EMBEDDED SYSTEMS REQUIREMENTS

PROGRAM Perip EMBEDDED


MCU MER CODE IDE SYSTEM
herals
 Uploading (programming) and verifying and interfacing with the
AVRDUDE programmer

PROTEUS  Emulating the MCU and simulation of the embedded system design

ATMEL STUDIO 7  Coding and preparing the software programs

ARDUINO IDE  Preparing the Arduino ISP programmer

LAB SOFTWARES
SOFTWARES
WHAT MAKE ARDUINO

SOFTWARE
•Processing HARDWARE
•Avr-gcc •USB to TTl ARDUINO
•Avrdude •Development project
•Bootloader Boardss
•Libraries and core
OUR LABS

SOFTWARE HARDWARE
• Atmel Studio • Arduino ISP AVR Lab
7 • MCU
• Avrdude • Peripherals
NORMS
NORMS
Atmel Studio IDE SM training
Academy

You might also like