Time: Office Hour: TR 03:20Am ~ 05:20Pm Website
Total Page:16
File Type:pdf, Size:1020Kb
EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Instructor: Airs Lin Mentor: Dr. Charles Liu Time: . SEC1:TR 01:30PM~03:10PM . SEC2:TR 09:50AM~11:30AM Office Hour: TR 03:20am ~ 05:20pm Website: http://EE446.is‐an‐Engineer.com Email: [email protected] 1 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Week 1: . Introduction to Embedded Systems Week 2, 3: . UML in Embedded System Design . Homework 1: Embedded proposal . Homework 2: UML Week 4: . Memory Technology Week 5: . Peripheral Interfaces Week 6: . Microcontroller (Cypress PSoC 5) . PSoC Project Week 7: . PSoC Project Week 8: . Introduction to FPGA . Altera System on Chip (SoC) 2 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Week 9: . FPGA Project (Handshaking) Week 10: . FPGA Project (Handshaking) Final Week. 3 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Embedded Systems is a computer inside a product Computer system which is part of some other equipment Typically dedicated software (may be user‐ customizable) May be required to respond to events in real time A special‐purpose computer system Designed to perform one or a few dedicated functions, sometimes with real‐time computing constraints. Usually containing sensors and actuators (and its control loop) Usually embedded as part of another system 4 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Providing pervasive computational intelligence Appliance, equipment, facilities are getting more intelligent . Predicting your need . Optimizing consumption, performance . Coordinate with each other 5 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Early era: purposely built chips and boards . Integrating mostly analog components . Hardwired computation logic Recent: rise of cheap general purpose microprocessors . Programmable computation logic . On‐board memory . Networking and communication capabilities Two major types: . FPGA (Field‐programmable Gate Array) ▪ Programmable at logic gate level . Microprocessor ▪ Programmable by programming languages (C/C++, Assembly, Java) Embedded Processors: • PIC MCUs(8/16/32 bit MCU) • 8051 (8bit MCU) • Zilog Z80(8bit MCU), Z8000 (16bit MCU) • Atmel ATmega328 MCU (8bit) • … 6 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Embedded Processors: • ARM Cortex‐M3 CPU Core (32bit) • Cypress PSoC 5 • Atmel SAM3X8E (Arduino Due) • Multi‐Core ARM Core CPU (32bit) • TI OMAP Dual ARM‐Cortex Core MCU • AllwinnerTech A20 Dual Core SoC MCU • Rockchip RK3188 Quad Core ARM Cortec‐A9 SoC • Intel • Intel Quark SoC X1000 (32bit –Intel Pentium) • AMD • AMD G‐T40E Dual‐Core x86 SoC 7 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Embedded systems integrating with other systems, and must be dependable: Reliability: R(t) = probability of system working correctly provided that is was working at the beginning (t=0) Maintainability: M(d) = probability of system working correctly d time units after error occurred. Availability: probability of system working at time t Safety: no harm to be caused Security: confidential and authentic communication Embedded systems have small footprint and must be efficient: . Energy efficient . Code‐size efficient (especially for systems on a chip) . Run‐time efficient . Weight efficient . Cost efficient Specific to a certain application: . Knowledge about behavior at design time can be used to minimize resources and to maximize robustness. Specific user interface (no mouse, keyboard and screen) 8 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Real‐Time embedded systems are meant to be front‐ end, and must meet real‐time constraints: . A real‐time system must react to stimuli from the controlled object (or the operator) within the time interval dictated by the environment . For real‐time systems, right answers arriving too late are wrong Frequently connected to physical environment through sensors and actuators, . Hybrid systems (analog + digital parts) . Embedded systems are reactive systems, in continual interaction with environment and executes at a pace determined by environment General Purpose Computing System Embedded System General Purpose: Broad class of applications. Specific Purpose: Limited applications that are implemented at design‐time. Programmable by end user Not programmable by end user Faster is better Fixed run‐time requirements (additional computing power not useful) Criterial: cost, average speed Criteria: cost, power consumption, predictability 9 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 10 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Requirements analysis & definition . Recognition of need . Definition of problem ▪ Customer Requirements ▪ Trying to figure out what the customer is looking for ▪ Note: Customers might not know what they want ▪ Can always give platitudes, e.g. convenient, easy‐to‐use, lightweight, simple ▪ Digging deeper: find a design problem in customer original requests and refine the problem 11 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 How much hardware do we need? . How big is the CPU? Memory? Co‐Design: Hardware or Software ? Code Optimization Efficient Input / Output Embedding an Operating System or not? ‐ Real Time? ‐ non Real Time? Testing and Debugging ASIC Reconfigurable Logic . CPLD . FPGA Multiple Embedded Systems 12 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Custom‐designed circuits necessary . if ultimate speed or energy efficiency is the goal and . large numbers can be sold Approach suffers from . long design times and . Lack of flexibility (changing standards) and . high costs ▪ Product Cost = NRE + (RE * P) Image Signal Processor ASIC for High-Quality CCD Camera Video ASIC 13 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Full custom chips may be too expensive, software may be too slow . Use of configurable hardware ▪ Complex Programmable Logic Device (CPLD) ▪ Field Programmable Gate Array (FPGA) Application areas . Fast prototyping . For smaller designs or lower production volumes Example: . Xilinx Virtex‐5 FPGAs . Altera Cyclone IV FPGAs 14 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Function inlining Eliminate common sub‐expressions Loop unrolling Optimize code in assembly language Optimize compiler When to use inline function • Use inline instead of #define • The function is small and called very often 15 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Example: Common sub‐expression Example: Common sub‐expression elimination Replace re‐computation of expression by use of tmp which holds value. Unrolled loop Example: Initializing an array Loop termination assembly code 16 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Example: Normal loop Example: After loop unrolling Assembly Code . Use assembly language to implement some functions Inline‐Assembler . Mixing C and Assembler Code 17 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Most compiler has a range of optimization levels 18 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Microprocessor Unit (MPU) Microprocessor Memory CPU (on single chip) • Microprocessor is heart of Computer System • It is just a processor. Memory and I/O components have to be connected externally I/O Ports Microcontroller Unit (MCU) All in one chip: Reduced chip count for board design • Microprocessor • Memory • I/O Ports BeagleBone Black Board 1GHz TI AM335x ARM Cortex‐A8 CPU 512MB DDR3, 4GB Flash Memory microSD Card Support I/O Expansion Headers . 65 Digital I/O (3.3V only) ▪ 7 Analog ▪ 4 Serial ▪ 2 SPI ▪ 2 I2C ▪ 8 PWMs ▪ 4 Timers ▪ … 19 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 EXPANSION 512MB DDR3L USB HOST 2GB/4GB TI Sitara eMMC AM3358AZCZ microSD USB (ARM Cortex-A8) 1GHz TPS65217C JTAG UART HDR PHY RJ45 DC HDMI HDMI FRAMER EXPANSION EagleSoC Development Board USB‐to‐UART 67MHz Cypress PSoC 5LP ARM Cortex‐M3 CPU . 64KB SDRAM, 128KB Flash, 2K EEPROM . 72 I/Os (5V, 3.3V, and Vadj) ▪ 64 GPIO, 8 SIO, 2 USBIOs Microcontroller ▪ All GPIOs are reconfigurable ▪ I2C, SPI, UART, USB, A/D, D/A, OPAmp, Timer, PWM, CAN,… 20 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Microprocessor Microcontroller Low High Performance (Single‐Core, 16MHz, (Multi‐Core, 800MHz, 1GHz…) 80MHz,…) Entire Power High Low Consumption Complex Simple Circuit Design (External Memory, I/O … chips) (On‐chip) Large Small Memory (128MB, 512MB, 1GB…) (8KB, 32KB, 64KB, 128KB…) Embedded Linux OS Supported Tiny Real‐Time OS Real‐Time OS Few I/O Interfaces Rich and flexible Need extra chips 21 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Computer OS & EE Programming Algorithms Organization Networks Fundamentals C/C++, Assembly EE‐446 Embedded Architectures (System) Control Digital Read‐ Signal Time Robotics Applications … Systems Processing Systems DSP, uCLinux, FPGA uC/OS, QNX, … 22 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Start out with a good embedded development kit (PSoC, Arduino…) Setup a hardware development environment Carefully study datasheet Fully understand communication protocols Learn digital and analog circuit design Learn Soldering and PCB layout Use equipment to debug signals . Multimeter . Digital Oscilloscope 23 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 Learn C programming before start learning Microcontroller/Embedded Systems Re‐write all the code, not just copy‐paste Get good source control (version control) Learn assembly language Study algorithms Learn the tools well for whatever chip you’re working on Build a debugging information into the code Embedded Design Proposal 24 EE‐446 Embedded Architectures (2014CSULA) 09/25/14 25.