CS 244 Introduction to Embedded Systems and Ubiquitous
CS 244 -Introduction to Embedded Systems and Ubiquitous Computing Instructor: Eli Bozorgzadeh Computer Science Department UC Irvine Winter 2010 - CS 244
Introduction to Embedded Systems n Suggested Textbooks: q q q n Embedded System Design, by F. Vahid and Givargis, Wiley, 2002 Embedded System Design, by P. Marwedel, Kluwer Academic, 2003 Embedded System Design, by Gajski, Abdi, and et. al. , Springer, 2008 Other sources q q Lecture notes handouts Winter 2010 - CS 244 2
Course outline n Lectures q q n n Tue-Thu: 9: 30 -11: 00 a. m. DBH 130 Office hours: email me first to make sure I am available! Grading policy: q q 25%: homework 25%: Paper presentation n q q Each of you presents a paper assigned to you, assignment: around week 4 and presentation around week 8 -9. 30%: embedded system Example project (week 6 -10) 20%: Exam (late midterm, week 8 -9) Winter 2010 - CS 244 3
Outline n n What are embedded systems? Embedded System Components q n n n Hardware/software Embedded System applications Model, languages and tools Hardware/software co-design and synthesis Reconfigurable Computing Real time Operating systems Copyrighted Material adapted from slides by Peter Marwedel, Frank Vahid, Tony Givargis, Dan Gajski, and Nikil Dutt Winter 2010 - CS 244 4
What’s an Embedded System? n Embedded systems = q n Two types of computing q q n Desktop – produced millions/year Embedded – billions/year Non-Embedded Systems q n information processing systems embedded into a larger product PCs, servers, and notebooks The future of computing! q Automobiles, entertainment, communication, aviation, handheld Winter 2010 - CS 244 devices, military and medical equipments. 5
Embedded Systems n Devices other than desktop PCs, servers, and notebooks q q n n n Electricity running through Perform something intelligent Hardware/software which form a component of a larger system, but are concealed from user Computers camouflaged as non-computers The future of computing! Winter 2010 - CS 244 6 6
An Example Embedded System Digital Camera Block Diagram Winter 2010 - CS 244 7
ES: Simplified Block Diagram actuators Winter 2010 - CS 244 8
Hardware Components Course Outline Concept Specification Hardware HW/SW Partitioning Estimation Exploration ign s De …) , t u yo a L is, s e nth y (S De sig n (Co mp ila tio n, …) Software Components Winter 2010 - CS 244 Validation and Evaluation (area, power, performance, …) 9
Components of Embedded Systems n Analog Components q n Digital Components q q n n Sensors, Actuators, Controllers, … Processor, Coprocessors Memories Controllers, Buses Application Specific Integrated Circuits (ASIC) Hardware Converters – A 2 D, D 2 A, … Software q q Software Application Programs Exception Handlers Winter 2010 - CS 244 10
Hardware Components Winter 2010 - CS 244
Hardware Components of Embedded Systems- an example Memory Controllers Interface Software (Application Programs) Coprocessors Processor ASIC Converters Analog Winter 2010 - CS 244 Digital 12 Analog
Processors n What is a processor? q q n General-purpose (GP) processors: q q q n Artifact that computes (runs algorithms) Controller and data-path Variety of computation tasks Functional flexibility and low cost at high volumes (maybe) Slow and power hungry Single-purpose (SP) processors (or ASIC) q q q One particular computation task Fast and power efficient Functional inflexibility and high cost at low volumes (maybe) Winter 2010 - CS 244 13 13
GP/SP Processor Architecture Status Data Input Data-Path Data Output Controller Control Winter 2010 - CS 244 14 14
General-purpose processors n Programmable device used in a variety of applications q n q Program memory General datapath with large register file and general ALU User benefits q q n Datapath Control logic and State register Register file Features q n Also known as “microprocessor” Controller Low time-to-market and NRE costs High flexibility IR PC Program memory General ALU Data memory Assembly code for: total = 0 for i =1 to … Examples q Pentium, Athlon, Power. PC Winter 2010 - CS 244 15
Application-specific IS processors (ASIPs) Programmable processor optimized for a n n particular class of applications having common characteristics q Compromise between general-purpose and ASIC (custom hardware) Features q Program memory q Optimized datapath q Special functional units Benefits q Some flexibility, good performance, size and power Examples q DSPs, Video Signal Processors, Network Processors, . . Winter 2010 - CS 244 Controller Datapath Control logic and State register Registers IR PC Program memory Custom ALU Data memory Assembly code for: total = 0 for i =1 to … 16
Application-Specific ICs (ASICs) n Digital circuit designed to execute exactly one program q n Features q q n coprocessor, hardware accelerator Contains only the components needed to execute a single program No program memory Controller Datapath Control logic index total State register + Data memory Benefits q q q Fast Low power Small size Winter 2010 - CS 244 17
Application Specific Circuits (ASIC) n. Custom-designed circuits necessary if ultimate speed or energy efficiency is the goal and large numbers can be sold. n. Approach suffers from long design times and high costs. Winter 2010 - CS 244 18
GP vs. SP Processors GP: n Programmable controller q q n n Control logic is stored in memory Fetch/decode overhead q n Typical bit-width (8, 16, 32, 64) Complete set of arithmetic/logic units Large set of registers High NRE/sale-volume Hardwired controller q Highly general data-path q ASIC: Highly tuned data-path q q q n No need for program memory and cache No fetch/decode overhead Custom bit-width Custom arithmetic/logic units Custom set of registers Low NRE/sale-volume Winter 2010 - CS 244 19 19
Storage n What is a memory? q q n Write-ability q n ability of memory to hold stored bits after they are written Many different types of memories q n Manner and speed a memory can be written Storage-permanence q n Artifact that stores bits Storage fabric and access logic Flash, SRAM, DRAM, etc. Common to compose memories Winter 2010 - CS 244 20 20
Write-ability n Ranges of write ability q High end n n q Middle range n n q Processor writes to memory, but slower E. g. , FLASH, EEPROM Lower range n n q Processor writes to memory simply and quickly E. g. , RAM Special equipment, “programmer”, must be used to write to memory E. g. , EPROM, OTP ROM Low end n n Bits stored only during fabrication E. g. , Mask-programmed ROM Winter 2010 - CS 244 21 21
Storage-permanence n Range of storage permanence q High end n n q Middle range n n q Holds bits days/months/years after memory’s power source turned off E. g. , NVRAM Lower range n n q Essentially never loses bits E. g. , mask-programmed ROM Holds bits as long as power supplied to memory E. g. , SRAM Low end n n Begins to lose bits almost immediately after written E. g. , DRAM Winter 2010 - CS 244 22 22
Storage-permanence Memory Types Mask-programmed ROM In-system programmable Ideal OTP ROM EPROM EEPROM Flash NVRAM Nonvolatile SRAM/DRAM Write-ability Winter 2010 - CS 244 23 23
Communication n What is a bus? q q n An artifact that transfers bits Wires, air, or fiber and interface logic Associated with a bus, we have: q Connectivity scheme n n n q Protocol n n n q Serial Communication Parallel Communication Wireless Communication Ports Timing Diagrams Read and write cycles Arbitration scheme, error detection/correction, DMA, etc. Winter 2010 - CS 244 24 24
Serial Communication n A single wire used for data transfer One or more additional wires used for control (but, some protocols may not use additional control wires) Higher throughput for long distance communication q n n Often across processing node Lower cost in terms of wires (cable) E. g. , USB, Ethernet, RS 232, I 2 C, etc. Winter 2010 - CS 244 25 25
Parallel Communication n Multiple buses used for data transfer One or more additional wires used for control Higher throughput for short distance communication q q n n Data misalignment problem Often used within a processing node Higher cost in terms of wires (cable) E. g. , ISA, AMBA, PCI, etc. Winter 2010 - CS 244 26 26
Wireless Communication n Infrared (IR) q Electronic wave frequencies just below visible light spectrum Diode emits infrared light to generate signal Infrared transistor detects signal, conducts when exposed to infrared light Cheap to build q Need line of sight, limited range q q q n Radio frequency (RF) q q q Electromagnetic wave frequencies in radio spectrum Analog circuitry and antenna needed on both sides of transmission Line of sight not needed, transmitter power determines range Winter 2010 - CS 244 27 27
Peripherals n n Perform specific computation task Custom single-purpose processors n n Designed by us for a unique task Standard single-purpose processors n n “Off-the-shelf” pre-designed for a common task Winter 2010 - CS 244 28 28
Timers n Timers: measure time intervals q q q n Basic timer To generate timed output events To measure input events Top: max count reached Clk 16 -bit up counter 16 Cnt Top Reset Range and resolution Winter 2010 - CS 244 29 29
Counters n Counter: like a timer, but counts pulses on a general input signal rather than clock q q e. g. , count cars passing over a sensor Can often configure device as either a timer or counter Winter 2010 - CS 244 Timer/counter Clk 2 x 1 mux 16 -bit up counter Cnt_in 16 Cnt Top Reset Mode 30 30
Watchdog Timer n n Must reset timer every X time unit, else timer generates a signal Common use: detect failure, self-reset Winter 2010 - CS 244 31 31
UART n UART: Universal Asynchronous Receiver Transmitter q q n n n Takes parallel data and transmits serially Receives serial data and converts to parallel Parity: extra bit for simple error checking Start bit, stop bit Baud rate q q Signal changes per second Bit rate, sometimes different Winter 2010 - CS 244 32 32
Pulse Width Modulator (PWM) n n Generates pulses with specific high/low times Duty cycle: % time high q n Square wave: 50% duty cycle Common use: control average voltage to electric device q q Simpler than DC-DC converter or digitalanalog converter DC motor speed, dimmer lights Winter 2010 - CS 244 33 33
LCD n n n Liquid Crystal Display N rows by M columns Controller build into the LCD module Simple microprocessor interface using ports Software controlled Winter 2010 - CS 244 34 34
Keypad N 1 N 2 N 3 N 4 k_pressed M 1 M 2 M 3 M 4 4 key_code keypad controller N=4, M=4 Winter 2010 - CS 244 35 35
Stepper Motor Controller n Stepper motor: rotates fixed number of degrees when given a “step” signal q n n In contrast, DC motor just rotates when power applied, coasts to stop Rotation achieved by applying specific voltage sequence to coils Controller greatly simplifies this Winter 2010 - CS 244 36 36
5. 0 V 4. 5 V 4. 0 V 3. 5 V 3. 0 V 2. 5 V 2. 0 V 1. 5 V 1. 0 V 0. 5 V 0 V 1111 1110 1101 1100 1011 1010 1001 1000 0111 0110 0101 0100 0011 0010 0001 0000 proportionality 4 4 3 3 analog output (V) Vmax = 7. 5 V 7. 0 V 6. 5 V 6. 0 V 5. 5 V analog input (V) Analog-to-Digital Converter 2 1 t 2 0100 t 3 t 4 time 1000 0110 0101 Digital output Analog to Digital (A/D) Winter 2010 - CS 244 2 1 t 1 0100 t 2 t 3 1000 0110 Digital input t 4 time 0101 Digital to Analog (D/A) 37 37
Summary n Hardware: Information Processing q q Processors Memories Communication Peripherals Winter 2010 - CS 244 38
- Slides: 38