Slides created by: Professor Ian G. Harris Embedded Systems  Computer-based systems which do not appear to be computers Complexity is hidden from the.

Slides:



Advertisements
Similar presentations
Microprocessors Typical microprocessor controlled devices: Camera, mobile phone, stereo, mp3 player, electronic toys… High-level microprocessor controlled.
Advertisements

EEE226 MICROPROCESSORBY DR. ZAINI ABDUL HALIM School of Electrical & Electronic Engineering USM.
Robotics Club, Snt Council2 The 3 Schools of Robotics: Mechanical Design – Types of motors – Material selection –
MICRO-CONTROLLER: A microcontroller is the brain of the robot: These are: 1. Integrated Circuits (ICs) 2. Programmable.
By Solid State Workshop. ● A microcontroller is an integrated circuit that is programmed to do a specific task. ● Microcontrollers are really just “mini-computers”.
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 0 Introduction to Computing
Configurable System-on-Chip: Xilinx EDK
Elements of the Computer (How a processor works)
Computer Systems CS208. Major Components of a Computer System Processor (CPU) Runs program instructions Main Memory Storage for running programs and current.
ASPPRATECH.
Chapter 17 Microprocessor Fundamentals William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper.
Microcontroller: Introduction
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Atmega32 Architectural Overview
CS-280 Dr. Mark L. Hornick 1 Parts of a GP Computer (Microcomputer) Contains separate Microprocessor chip Memory/Memory controller MB control chips Peripheral.
AVR  Modern RISC architecture: Compact and FAST.  Tuned for high level languages.  Consistent architecture across entire line.  Small AVR are subsets.
Silicon Labs ToolStick Development Platform
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
Chapter Introduction to Computers and Programming 1.
 Chasis / System cabinet  A plastic enclosure that contains most of the components of a computer (usually excluding the display, keyboard and mouse)
Introduction to Programming Dr Masitah Ghazali Programming Techniques I SCJ1013.
Chapter 1 CSF 2009 Computer Abstractions and Technology.
AVR Microcontrollers.
Arduino Josh Villbrandt February 4, Digital Circuits Analog versus digital – What’s the difference? – How to represent an analog signal in a computer?
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
Topics Introduction Hardware and Software How Computers Store Data
The Computer Systems By : Prabir Nandi Computer Instructor KV Lumding.
©2008 The McGraw-Hill Companies, Inc. All rights reserved. Digital Electronics Principles & Applications Seventh Edition Chapter 13 Computer Systems Roger.
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Translate the following message:
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
Computer Systems Organization CS 1428 Foundations of Computer Science.
Microcontroller Presented by Hasnain Heickal (07), Sabbir Ahmed(08) and Zakia Afroze Abedin(19)
Computer Architecture And Organization UNIT-II General System Architecture.
Chapter 1 Computer Abstractions and Technology. Chapter 1 — Computer Abstractions and Technology — 2 The Computer Revolution Progress in computer technology.
Computer Organization & Assembly Language © by DR. M. Amer.
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Electronic Analog Computer Dr. Amin Danial Asham by.
1 Software. 2 What is software ► Software is the term that we use for all the programs and data on a computer system. ► Two types of software ► Program.
Embedded System. What is an Embedded System? Computing systems embedded within electronic devices Hard to define – Nearly any computing system other than.
Computer Systems. Bits Computers represent information as patterns of bits A bit (binary digit) is either 0 or 1 –binary  “two states” true and false,
Computer operation is of how the different parts of a computer system work together to perform a task.
Lecture 7: Overview Microprocessors / microcontrollers.
ChibiOS/RT Demo A free embedded RTOS
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO Session 2 Computer Organization.
Department of Electronic & Electrical Engineering Introduction to microcontrollers A microcontroller is a small computer on a single integrated circuit.
Unit 1: Computing Fundamentals. Computer Tour-There are 7 major components inside a computer  Write down each major component as it is discussed.  Watch.
Slides created by: Professor Ian G. Harris Embedded Systems  Embedded systems are computer-based systems which are embedded inside another device (car,
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Embedded Systems Introduction. Microprocessor building blocks 1. ALU (Arithmetic Logic Unit): The ALU is a sequential logic circuitry that is intended.
Information Technology INT1001 Lecture 2 1. Computers Are Your Future Tenth Edition Chapter 6: Inside the System Unit Copyright © 2009 Pearson Education,
Programming and Debugging with the Dragon and JTAG Many thanks to Dr. James Hawthorne for evaluating the Dragon system and providing the core content for.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Sequence of control signal combinations.
1 The user’s view  A user is a person employing the computer to do useful work  Examples of useful work include spreadsheets word processing developing.
“Atmega32 Architectural Overview” SIGMA INSTITUTE OF ENGINEERING Prepared By: SR.NO NAME OF STUDENT ENROLLMENT 1 Parihar Shipra A Guided By:-
Introduction to Microcontroller Technology
Atmega32 Architectural Overview
Computer Hardware – System Unit
ECE354 Embedded Systems Introduction C Andras Moritz.
Discovering Computers 2011: Living in a Digital World Chapter 4
Embedded Systems Computer-based systems which do not appear to be computers Complexity is hidden from the user Embedded systems are much more common than.
Introduction to Microprocessors and Microcontrollers
ریز پردازنده. ریز پردازنده مراجع درس میکروکنترلرهای AVR برنامه نویسی اسمبلی و C محمدعلی مزیدی، سپهر نعیمی و سرمد نعیمی مرجع کامل میکروکنترلرهای AVR.
Topics Introduction Hardware and Software How Computers Store Data
Presentation transcript:

Slides created by: Professor Ian G. Harris Embedded Systems  Computer-based systems which do not appear to be computers Complexity is hidden from the user  Embedded systems are much more common than desktop/laptop systems  Interact with users via simple interface: Digital camera, TV, cellphone, …  Interact with another device, invisible to user: Disk drive, memory stick, anti-lock braking system, …

Slides created by: Professor Ian G. Harris Tight Constraints  Embedded design methodology: Be Efficient! Majority of embedded products are in cost critical markets (i.e. consumer electronics) Other applications are in performance/power critical markets (i.e. military, medical)  Constraints include: Maufacturing cost, Design cost, Performance, Power, Time-to-Market  Very different from traditional software engineering Moore’s law will save you eventually  Embedded system designers should be control freaks Need to have explicit control over timing, memory Why trust a compiler/interpreter/OS?

Slides created by: Professor Ian G. Harris Application Specificity  Embedded systems are generally application-specific  Perform one task or set of related tasks  Some devices blur the line (i.e. cell phones)  Allows design to be focused on one application  Unlike general-purpose systems (i.e. laptop)  Higher design efficiency is possible  Special-purpose vs. general purpose (i.e. video games)

Slides created by: Professor Ian G. Harris Hardware/Software Codesign  Hardware and software are often designed together  General-purpose systems use HW and SW developed by different companies  Greatly improved optimization is possible  Include only HW/SW needed for your application  More work for the designers  Must understand both HW and SW

Slides created by: Professor Ian G. Harris Generic ES Structure microcontroller sensors ADCDAC actuators ASICFPGA  Sensors receive data from the world  Actuators cause events in the world  Application-Specific Integrated Circuit (ASIC)- special-purpose hardware  Field Programmable Gate Array (FPGA) - reconfigurable hardware

Slides created by: Professor Ian G. Harris Sensors  Receive data from the environment  Motion - IR/ultrasonic detectors, potentiometers, encoders  Light - Photoresistors, cameras  Touch - Capacitive touch, pressure sensors  Variety of physical principles used  Many sensors are analog

Slides created by: Professor Ian G. Harris Actuators  Cause external events  Mechanical - motors  Audio – speakers, buzzers  Visual – LED, LCD, laser  May consider external communication to be actuation  Many actuators are analog

Slides created by: Professor Ian G. Harris Analog/Digital Conversion  Analog-to-Digital Converter (ADC)  Converts analog data to digital data  Used to interface with analog sensors  Digital-to-Analog Converters (DAC)  Converts digital signals to analog signals  Used to interface with analog actuators

Slides created by: Professor Ian G. Harris Application Specific Integrated Circuit (ASIC)  An integrated circuit which performs one function  Cheap in high volume  Very useful for common tasks  Network controllers (ethernet, CAN)  Audio/Video (audio codec, VGA controller)  Must interact with the microcontroller  Consider communication protocol

Slides created by: Professor Ian G. Harris Field Programmable Gate Array (FPGA)  Hardware which can be reconfigured via RAM  Faster than SW, slower than ASIC  No fabrication needed Logic Block Interconnect

Slides created by: Professor Ian G. Harris Microcontrollers  Microcontrollers are the center of the system  Accept input data, process it, make decisions, cause output events  Hardware/Software Interface Write code, execute it on a microcontroller Microcontroller interacts with hardware components

Slides created by: Professor Ian G. Harris General-Purpose vs. DSP  General-Purpose  Used in for any application  Many features included  Digital Signal Processors (DSP)  Made to support DSP functions  Vector instructions  Cheaper but more limited

Slides created by: Professor Ian G. Harris Software Translation  Machine language: CPU instructions represented in binary  Assembly language: CPU instructions with mnemonics Easier to read Equivalent to machine language  High-level language: Commonly used languages (C, C++, Java, etc.) Much easier to use All software must be translated into the machine language of the microcontroller

Slides created by: Professor Ian G. Harris Compilation/Interpretation  Compilation: Translate instructions once before running the code  C, C++, Java (partially)  Translation occurs only once, saves time  Interpretation: Translate instructions while code is executed  Basic, Java (partially)  Translation occurs every execution  Translation can adapt to runtime situation

Slides created by: Professor Ian G. Harris Why C for Embedded Systems?  Easier to use than Assembly language  Allows more control than higher-level languages (Java, Python, etc. C examplePython example int a, b, c;a = b + c a = b + c;  How much memory is used in each example?

Slides created by: Professor Ian G. Harris Compilation Example a = b + c; lw $r1, ($s1) lw $r2, ($s2) add $r3, $r2, $r1 sw $r3, ($s3) Load b from memory Load c from memory Add b and c Store result a in memory add$r3$r2$r1 Compiler Assembler

Slides created by: Professor Ian G. Harris Microcontroller Components Register: Stores a single value - Like a single memory location - Extremely fast - Extremely expensive Storage Elements - Data is stored in different components - Speed/Cost (area) tradeoff Several special-purpose registers, used internally General-purpose registers, used by the program

Slides created by: Professor Ian G. Harris Storage Elements Register File: Stores many values - A set of registers, each has an address - Acts just like a memory - Extremely fast, expensive Instruction operands are here oadd $r3, $r2, $r1 Can only read one or two registers at a time May contain ~32 registers

Slides created by: Professor Ian G. Harris Memories Cache: Stores many values - Slower than a register file - Cheaper than a register file - Still fairly fast and expensive Data cache holds data that the program operates on Instruction cache holds program instructions

Slides created by: Professor Ian G. Harris Main Memory Very big, Gigabytes (Gb) Not in the CPU Connected to the CPU via a system bus Memory access is slow Von Neumann Bottleneck Memory is much slower then the CPU Memory access time greatly slows program execution

Slides created by: Professor Ian G. Harris Arithmetic Logic Unit (ALU) Performs arithmetic and logical functions on data Many instructions use the ALU o Arithmetic operations: add, subtract, etc. o Logical Operations: AND, OR, XOR, etc.

Slides created by: Professor Ian G. Harris Special-Purpose Registers Program Counter (PC) Stores the address of the next instruction Drives the instruction cache Incremented after most instructions Updated after jump/branch instructions Program Status Word Contains various bits indicating operation status  Negative, zero, etc. Contains privileged mode bit  Indicates higher security permission

Slides created by: Professor Ian G. Harris Basic Processor Core PC Instruction Cache Register File Data Cache ALU PC is updated after each instruction Control logic needed to coordinate activity

Slides created by: Professor Ian G. Harris Executing an Instruction 1.Instruction Fetch – Get instruction from memory Update Program Counter afterward 2.Instruction Decode, Register Fetch – Identify instructions, get input operands 3.Execute – Perform operation 4.Register Write – Put result operands in register file add $r3, $r2, $r1

Slides created by: Professor Ian G. Harris Microcontroller Characteristics  Datapath Bitwidth  Number of bits in each register  Determines accuracy and data throughput  Input/Output Pins  Need enough pins to support your application  Performance  Clock rates are ~10-100x slower than desktop

Slides created by: Professor Ian G. Harris Other  proc Features  Timers  Needed for real-time applications  Analog-to-Digital Converters  Used to read input from analog sensors  Low-power modes  Power saving is important  Communication protocol support  Interface with other Ics  UART, I2C, SPI, etc.

Slides created by: Professor Ian G. Harris AVR ATmega2560  8-bit microcontroller  Up to 16MHz  256KB of flash memory  4KB EEPROM, 8KB SRAM  Peripherals  Timers, PWM, comparators, ADC, …

Slides created by: Professor Ian G. Harris AVR STK600 Board  Allows many different Atmel AVR microcontrollers to be programmed and interfaced with  Comes with a Routing Card containing the ATmega2560  Allows direct access via board pins  Other interfaces: USB, CAN, RS-232

Slides created by: Professor Ian G. Harris Facts about STK600  Has LEDs and buttons for experimentation  Headers are available to connect to microcontroller pins  Microcontroller I/O pin headers must be connected to board components manually using cables  Programming I/O must also be connected manually to board programming HW

Slides created by: Professor Ian G. Harris AVR Studio 5  Integrated Development Environment (IDE) provided by Atmel Replaces Eclipse  Free download from  Install everything that it tries to install.NET, Visual Studio Shell, USB driver, etc.  GNU toolchain is automatically installed too

Slides created by: Professor Ian G. Harris AVR Studio 5 Example  Project – A single application Can contain many files (.c,.h, etc.)  Solution – Contains all code on a single microcontroller Can contain many projects  Solution Explorer – Contents of solution  Output – Results of operations

Slides created by: Professor Ian G. Harris Make a New Project  File->Project->New  Select C in left column  Select C Executable Project  Name and Solution Name are the same  Note the location – a directory will be created  Click OK when done

Slides created by: Professor Ian G. Harris Select Device  Window appears after new project is created  Select device ATmega2560

Slides created by: Professor Ian G. Harris C Code Template  Text editor in upper left corner with program template  Solution Explorer lists all projects/files  Write the C code  Compile: Build->Build Solution  Build Succeeded message at bottom  Should create.hex file in Debug subdirectory of the project

Slides created by: Professor Ian G. Harris Programming the Board  Plug in the board via USB May download drivers if it is the first time May update firmware  Turn on the board  Bring up programming window Tools->AVR Programming

Slides created by: Professor Ian G. Harris Interface Settings  Select Tool STK600  Select Device ATmega2560  Select Interface ISP  Set ISP clock 100kHz is safe  Read Device ID and Target Voltage Verifies communication

Slides created by: Professor Ian G. Harris Programming Memory  Must program the.hex file into the Flash memory  Select Memories in left column  Browse to select the.hex file under Flash In Debug directory  Click Program

Slides created by: Professor Ian G. Harris Communication Problem  After board is connected, may get an error about “Cannot establish connection to debugging agent” or something like that  May be caused by a firewall  I had this problem with McAfee, not with Avast  Might occur with other anti-virus/firewall tools