Microsoft PowerPoint ESD Ch2 2016 8/12/2016 Chapter 2 1 ĐẠI HỌC QUỐC GIA TP HỒ CHÍ MINH TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA ĐIỆN ĐIỆN TỬ BỘ MÔN KỸ THUẬT ĐIỆN TỬ 11 Embedded System Design Chapter 2 Develop a[.]
8/12/2016 ĐẠI HỌC QUỐC GIA TP.HỒ CHÍ MINH TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA ĐIỆN-ĐIỆN TỬ BỘ MÔN KỸ THUẬT ĐIỆN TỬ Embedded System Design Chapter 2: Develop a project of embedded system design Design Process Design Issues Technology selection Project plan 1 Embedded System Design Process • Several models can be applied for embedded system design – The waterfall model: in which there is a process for developing a system in steps, where results of one step flow into the next step – The spiral model: in which there is a process for developing a system in steps, and throughout the various steps, feedback is obtained and incorporated back into the process – Consecutive refinement model • Most followed and simple model for building an Embedded System is Waterfall model Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Chapter 2 8/12/2016 Embedded System Design Process CAD tools Requirement definition Customers System specification System architects System partitioning SW development •Application SW •Compilers •Operating Interface design •SW driver •HW interface •User interface SW developer HW design •HW architecture •HW synthesis •Physical design HW designer Integration and testing Meet requirement? Yes Delivery and maintenance Bộ môn Kỹ Thuật Điện Tử - ĐHBK Reused components No Chapter 1.1 System Specification Documents for System Specification Describe how the product will be Product Specification Engineering Specification Describe what board, subsystem, and firmware will be used Hardware Specification Describe how the board will be implemented and how it works Software Specification Describe how the software will be implemented Test Specification Describe how the system will be tested Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Chapter 8/12/2016 1.1 System Specification Product Specification: – – – – – What the system is to What the user interface is What the real world I/O consists of What the external interface to other system is (if any) What are the constraints? (speed, stability, low power, cost ) • Example: Oven temperature control system – – – – Functions: control the heater and the fan of an oven I/O: temperature sensor, heater port, fan port User interface: LCD display, keypad External interface: UART Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 1.1 System Specification Engineering Specification: – What kind of hardware will be used – What are the requirements for hardware and software • Example: Oven temperature control system – 8051 microcontroller, LM35 sensor, LCD 16x2-B, ADC0809, RS232 IC – Requirements • • • • • PID control algorithm real-time processing Display current temperature value able to set operating temperature value Transfer data to computer through UART Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Chapter 8/12/2016 1.1 System Specification Hardware Specification: – The requirements from engineering documents – How the hardware implements the functionality – The software interfaces to the hardware • Example: Oven temperature control system – PIC Microcontroller 12MHz, sensor LM35, LCD 16x2-B, Keypad 16, ADC0809, FET IRF260 for heater/fan control – Microcontroller reads temperature value from LM35 through ADC, display this value to LCD, and then control heater and fan based on PID control algorithm Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 1.1 System Specification Software Specification: – The requirements from engineering specification – Interface to other software – How the software implements the requirements • Example: Oven temperature control system – Temperature control algorithm – Software functions: • void LCD_display(String str) • int PID_control(int temp, int data[]) Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Chapter 8/12/2016 1.1 System Specification Test Specification: – The device, equipment, environment for testing – Prototype – Testing process • Example: Oven temperature control system – Voltage meter, temperature meter – Prototype: bread board – Testing process: • • • • calibrate temperature sensor check LCD, keypad check output port (heater, fan) verify PID control algorithm Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 1.1 System Specification • Group discussion – Write a specification document for your own class project Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Chapter 10 8/12/2016 1.2 System partitioning • System partitioning: divide the system into three parts: – Hardware (HW): microcontrollers, memories, peripherals, – Software (SW): OS, program, application software – Interface: SW driver, HW interface, user interface • Alternative way: divide the system into HW and SW – which functions should be performed in hardware, and which in software? – the more functions in software, the lower will be the product cost Bộ môn Kỹ Thuật Điện Tử - ĐHBK 11 Chapter 1.2 System partitioning • System partitioning examples: Oven temperature control system No Functions Software Measure temperature - Sensor LM35 - AD converter -ADC reading function -Calculate temperature value from the sensor input value Display temperature value - LCD 1602 - LCD control function - Display function Heating - Heater -Heater control function Change the heating level - Button - Button reading function - Heating level setup function Change heating time - Button - Timer function Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Hardware Chapter 12 8/12/2016 1.2 System partitioning • Group discussion – Apply system partitioning for your own class project Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 13 Embedded System Design Issues • Design issues are problems that make it difficult to design an embedded system Constraint issues – – – – – cost may matter more than speed long life cycle Reliability/safety Low-power Size / weight Examples: Portable heart-beat monitor – – – – Long life cycle (10 years) Reliability (accuracy 99%) Low-power (5 using days) Light weight ( watchdog timer – Ex: Camera surveillance system, data acquisition system – Response to external periodic/non-periodic events • Events are periodic: the system needs a scheduler to capture the events • Events are non-periodic: the system needs to estimate miss event cases Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Chapter 20 10 8/12/2016 Embedded System Design Issues • Group discussion – Discuss about design issues of your own class project Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 21 Technology Selection • Technology – A manner of accomplishing a task, especially using technical processes, methods, or knowledge • Three key technologies for embedded systems – Processor technologies: general-purpose, applicationspecific, single-purpose – IC technologies: Full-custom, semi-custom, PLD – Design technologies: Compilation/synthesis, libraries/IP, test/verification 22 Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Chapter 11 8/12/2016 Technology Selection • Processor selection – – – – – – – number of IO pins required interface required memory requirements number of interrupts required real-time considerations development environment processing speed required General-purpose processor Application-specific processor Bộ môn Kỹ Thuật Điện Tử - ĐHBK Single-purpose processor 23 Chapter Processor technology • “Processor” not equal to general-purpose processor Controller Control logic and State register IR PC Datapath Register file General ALU Controller Datapath Control logic and State register IR Data memory total = for i =1 to … General-purpose (“software”) Datapath Registers Control logic index Custom ALU State register + total PC Data memory Program memory Assembly code for: Controller Data memory Program memory Assembly code for: total = for i =1 to … Application-specific Single-purpose (“hardware”) 24 Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Chapter 12 8/12/2016 IC technology • The manner in which a digital (gate-level) implementation is mapped onto an IC – IC: Integrated circuit, or “chip” – IC technologies differ in their customization to a design – IC’s consist of numerous layers (perhaps 10 or more) • IC technologies differ with respect to who builds each layer and when IC package IC gate oxide source channel drain Silicon substrate 25 Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Design technology • Compilation/synthesis: – C Compilers: CCS C, mikro C, Keil C, Code Composer Studio, • Libraries/IP – Stellarisware, Tivaware, STM32 Library, – OS: Embedded Linux, RTOS • Test/verification – Development kits – Simulation tools: Proteus, Orcad, PSIM 26 Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Chapter 13 8/12/2016 Project plan • Build a team • Build a plan Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 27 Build a team • Important points about teams – Teams bring together complementary skills and experiences – Teams establish communication to support realtime problem solving – Teams develop decisions by consensus rather than by authority Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Chapter 28 14 8/12/2016 Team Contract TEAM CONTRACT Team name: BK1 Date: 26 Aug 2014 Team member Roles Nguyễn Văn A Leader, system engineer Trần Văn B Hardware design Nguyễn Thị C Software design Tasks Signature Responsible member Develop system architecture Nguyễn Văn A Design hardware Trần Văn B Develop software Nguyễn Thị C Integrate and test All Team meeting Team rules 9AM, Wednesday, weekly Participate in all team meetings Listen carefully to all comments at meetings Complete all assigned tasks before deadlines Focus on results rather than excuses after Bộ môn Kỹ Thuật Điện Tử - ĐHBK 29 Chapter Build a plan • Project planning activities Identify the task Develop teams Develop schedule Estimate time Plan tasks Refine plan Approve plan Cancel plan Proceed plan Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Chapter 30 15 8/12/2016 Project plan example (1) Project planning Team name BK_DEE Product name Home security system Main features -Fire alarm -Door alarm -Send warning to home owner Estimated Time months (8 hours / a day) Start: 20 Aug 2014 Estimated Cost Components : 300,000 VNĐ Tools : 100,000 VNĐ Materials : 100,000 VNĐ Total : 500,000 VNĐ Team members Student 1: leader Student 2: hardware design Student 3: software design End: 20 Nov 2014 Schedule Bộ môn Kỹ Thuật Điện Tử - ĐHBK 31 Chapter Project plan example (2) Project planning Schedule Month Month2 Month Design system architecture Design hardware part 2.1 Design central control board 2.2 Design interface 2.3 Implement hardware board Develop software part 3.1 Develop control algorithm 3.2 Develop driver, user interface 3.3 Implement software program Integrate and test 4.1 Simulate operations 4.2 Verify system Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Chapter 32 16 8/12/2016 Class assignment • Design a embedded system for washing machine No Specification Describe Product specification -Washing process: soak, wash, rinse, spin -Mode: manual, fuzzy -Constraints Engineering specification -Inputs: -Outputs: -Use interface: Hardware specification -Microcontroller: -Sensors: -Actuators: Software specification -Functions: -Control algorithm: Test specification -Platform: -Test process: Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 33 Group discussion Consider the project car’s door mechanism Write system specification for this project Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Chapter 34 17 8/12/2016 Group discussion Consider the project car door mechanism Write team contract and plan for the project Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter Chapter 35 18