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.

Slides:



Advertisements
Similar presentations
INTRODUCTION OF COMPUTER
Advertisements

Fundamentals and a Brief History of Computer Systems.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Wednesday, 9/4/02, Slide #1 1 CS 106 Intro to CS 1 Wednesday, 9/4/02  Today: Introduction, course information, and basic ideas of computers and programming.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Prof. Béat Hirsbrunner Fulvio Frapolli, PhD Student (exercises) Bachelor students : - Major in computer science (first year, 2nd term) - Major in information.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Chapter Introduction to Computers and Programming 1.
Topics Introduction Hardware and Software How Computers Store Data
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Programming I Introduction Introduction The only way to learn a new programming language is by writing programs in it. The first program to.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Introduction Lecture 01.
Programming With C.
1 Programming in C Hello World! Soon I will control the world! Soon I will control the world!
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
Tolo-e-aftab higher education 1 th semester Bcs 1/2/1392 MINISTRY OF HIGHER EDUCATION.
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
1 Homework Done the reading? –K&R –Glass Chapters 1 and 2 Applied for cs240? (If not, keep at it!) Gotten a UNIX account? (If not, keep at it!)
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,
Slides created by: Professor Ian G. Harris Embedded Systems  Embedded systems are computer-based systems which are embedded inside another device (car,
Chapter 4 Software. Introduction Program: is a set of sequence instructions that tell the computer what to do. Software: is a collection of programs,
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
Hello world !!! ASCII representation of hello.c.
小型系統 心情 vs. 古典樂 心情 vs. 古典樂 浪漫求籤系統 美食導航系統 季潔亭雅鈺熒岱芸 美食導航系統 楊氏音樂模擬大會考人瑋 若維 芷萱 伽倩 楊氏音樂模擬大會考 麥當勞熱量計算系統 火星文困擾你嗎 ? 火星文困擾你嗎 ? 歌詞知多少 - 挑戰你的腦容量英琪 日馨 青雪 鈺娟.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Operating Systems A Biswas, Dept. of Information Technology.
Slides created by: Professor Ian G. Harris Embedded Systems  Computer-based systems which do not appear to be computers Complexity is hidden from the.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
BIL 104E Introduction to Scientific and Engineering Computing Lecture 1.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Chapter 1: Introduction to Computers and Programming
Software Development Environment
DDC 2223 SYSTEM SOFTWARE DDC2223 SYSTEM SOFTWARE.
Java Programming: From the Ground Up
BASIC PROGRAMMING C SCP1103 (02)
CSCE 206 Structured Programming in C
Chapter 1: Introduction to computers and C++ Programming
CSC201: Computer Programming
Topics Introduction Hardware and Software How Computers Store Data
Introduction to Visual Basic 2008 Programming
BASIC PROGRAMMING C SCP1103 (02)
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Microprocessor and Assembly Language
Technology Literacy Hardware.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 2 First Java Programs
Getting Started with C.
Java programming lecture one
Chapter 1: Introduction to Computers and Programming
Computer Science I CSC 135.
Computers: Hardware and Software
Topics Introduction Hardware and Software How Computers Store Data
Introduction to Computer Systems
Hardware & Software Programming. COMP102 Prog. Fundamentals I: Software / Slide 2 l Four components of a computer system: n CPU - central processing unit.
Homework Applied for cs240? (If not, keep at it!) 8/10 Done with HW1?
Chapter 11 Introduction to Programming in C
C Programming Getting started Variables Basic C operators Conditionals
Introduction to Computer Programming
Introduction to Computer Systems
Understand the interaction between computer hardware and software
Computer Programming-1 CSC 111
Computer components is a programmable machine that receives input, stores and manipulates data, and provides output in a useful format. Computer The computer.
Introduction to C Programming
Programming Logic and Design Eighth Edition
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

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, …

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?

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)

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

Generic ES Structure microcontroller sensors ADC DAC actuators IP FPGA 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

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

Actuators Cause external events Mechanical - motors Audio – speakers, buzzers Visual – LED, LCD, laser May consider external communication to be actuation Many actuators are analog

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

Intellectual Property (IP) Core 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

Field Programmable Gate Array (FPGA) Hardware which can be reconfigured via RAM Logic Block Interconnect Faster than SW, slower than ASIC No fabrication needed

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

General-Purpose vs. DSP Used in for any application Many features included Digital Signal Processors (DSP) Made to support DSP functions Vector instructions Cheaper but more limited

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

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

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

Compilation Example a = b + c; 10010001000000110000001000000001 Compiler 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 Assembler 10010001000000110000001000000001 add $r3 $r2 $r1

Getting Started Prints “hello, world” to the screen #include <stdio.h> main() { printf(“hello, world\n”); } Prints “hello, world” to the screen Type this in with a text editor and save it as hello.c

Running a Program You will need a text editor and a compiler Debugger will be needed later I use GNU tools emacs text editor http://www.gnu.org/software/emacs/ gcc C compiler http://www.gnu.org/software/gcc/ gdb C debugger http://www.gnu.org/software/gdb/ Can use these on Windows but MacOS and linux are easier

Eclipse IDE On Windows you might use the Eclipse Integrated Development Environment (IDE) Puts all tools together in a nice graphic user interface Need Java Runtime Environment (JRE) to run it http://www.eclipse.org/downloads/moreinfo/c.php Can also use Microsoft Visual Studio (costs money)

Compiling and Running Emacs window Compile and run

Breaking Down Hello.c #include <stdio.h> main() Tells the compiler to use the library functions described in stdio.h printf (the print function) is inside stdio main() Beginning of the main function All code execution starts at main

Breaking Down Hello.c { } printf( … ); Curly brackets are used to group lines of code All functions start and end with curly brackets printf( … ); This function prints to the screen The argument is in parenthesis The argument is what is printed Notice the semicolon at the end of the line

Breaking Down Hello.c “hello, world\n” This is the argument to printf which appears on the screen It is a string because it is in quotes (“”) \n is a special character with indicates newline main() { printf(“hello, ”); printf(“world”); printf(“\n”); }

Variables Variables are strings which represent values in the program Similar to algebraic variables All variables have a type which must be declared int x; float y; Type determines how arithmetic is performed, how much memory space is required

Celsius Conversion A program to convert Fahrenheit to Celsius, print a table 0 -17 20 -6 4 … Will need variables to hold numbers for computation Need to perform arithmetic C = (5/9)(F-32)

Fahrenheit – Celsius Program main(){ int fahr, celsius; int lower, upper, step; lower = 0; /* lower limit */ upper = 300; /* upper limit */ step = 20; /* step size */ fahr and celsius hold temperatures lower and upper limit the fahrenheit values step is the size of the increment

Fahrenheit – Celsius Program fahr = lower; while (fahr <= upper) { celsius = 5 * (fahr-32) / 9; printf("%d\t%d\n", fahr, celsius); fahr = fahr + step; } While loop iterates fahr from 0 to 300 fahr updates each iteration Assignment to celsius does the work

For statement fahr=0 is initialization main(){ int fahr; for (fahr=0; fahr<=300; fahr += 20) printf(“%3d %6.1f\n”, fahr, (5.0/9.0)*(fahr-32)); } fahr=0 is initialization fahr<=300 is the terminating condition fahr+=20 is the increment step

Symbolic Constants #define is a compiler directive #define LOWER 0 main(){ int fahr; for (fahr=LOWER; fahr<=300; fahr += 20) printf(“%3d %6.1f\n”, fahr, (5.0/9.0)*(fahr-32)); } #define is a compiler directive name is replaced by text

Character Input/Output c = getchar() Gets a single character from the input stream Typically the keyboard (stdin) Waits for the data input putchar(c) Sends a character to the output stream Typically the screen (stdout)

Stream Copying c is an int to hold the EOF character int c; c = getchar(); while (c != EOF) { putchar(c); } Copies characters from input to output EOF is a unique end-of-file character Defined in stdio.h (ctrl-d) c is an int to hold the EOF character