ESD-Ch2 2016

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

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

1. Design Process
2. Design Issues
3. Technology selection
4. 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 2 2

Chapter 2 1
8/12/2016

1. Embedded System Design Process


CAD tools Requirement definition Customers

System specification System


architects
System partitioning

SW development Interface design HW design


•Application SW •SW driver •HW architecture
•Compilers •HW interface •HW synthesis
•Operating •User interface •Physical design
SW developer HW designer
Integration and testing Reused
components
No Meet
requirement?
Yes
Delivery and maintenance
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 3

1.1. System Specification


Documents for System Specification

1. Product Specification Describe how the product will be.

2. Engineering Specification Describe what board, subsystem, and


firmware will be used.

3. Hardware Specification Describe how the board will be


implemented and how it works.

4. Software Specification Describe how the software will be


implemented.

5. Test Specification Describe how the system will be tested.

Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 4

Chapter 2 2
8/12/2016

1.1. System Specification


1. Product Specification:
– What the system is to do
– 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 2 5

1.1. System Specification


2. 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 2 6

Chapter 2 3
8/12/2016

1.1. System Specification


3. 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 2 7

1.1. System Specification


4. 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 2 8

Chapter 2 4
8/12/2016

1.1. System Specification


5. 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 2 9

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 2 10

Chapter 2 5
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 Chapter 2 11

1.2. System partitioning


• System partitioning examples: Oven temperature control system

No. Functions Hardware Software


1 Measure temperature - Sensor LM35 -ADC reading function
- AD converter -Calculate temperature value
from the sensor input value
2 Display temperature value - LCD 1602 - LCD control function
- Display function
3 Heating - Heater -Heater control function
4 Change the heating level - Button - Button reading function
- Heating level setup
function
5 Change heating time - Button - Timer function

Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 12

Chapter 2 6
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 2 13

2. Embedded System Design Issues


• Design issues are problems that make
it difficult to design an embedded
system
1. 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 (<1kg)

Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 1 14

Chapter 2 7
8/12/2016

2. Embedded System Design Issues


1. Constraints
Examples for smart home system
No. Constraints Note
1 Low price (< 1.000.000 dong) Correct
2 Ability to detect smoke and fire Wrong
3 Low power (100mW when idle, 3W when active) Correct
4 Response time for control < 1ms ?
5 Support remote control by smartphones ?
6 Easy to install ?

Constraints are limitations or restrictions of some parameters


of the system

Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 1 15

2. Embedded System Design Issues


2. Functional issues
– safety-critical applications
– damage to life, health, economy
– affect to environment, society, politics
Example:
• Message LED for a shop
– Display message for customers
– Malfunctions result in small damage
• Message LED for a stock market
– Display stock data
– Malfunctions could damage to economy
• Battery charger
– ?
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 1 16

Chapter 2 8
8/12/2016

2. Embedded System Design Issues


2. Functional issues
Examples for battery charger
No. Issues Note
1 Battery can be over-heat, it need to be detected by a Correct
sensor
2 Display a charging current and battery status Wrong
3 The system must have a fuse for protection of over ?
current
4 Support 3 charging modes ?
5 Apply efficient algorithm for fast charging and increase ?
battery life cycle
Functional issues are problems which can affect to life, health,
economy, environment, society, politics, ethics.

Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 1 17

2. Embedded System Design Issues


3. Real-time issues
– Determine whether the system is hard/soft/non real-time
– Determine the time constraint (delay)
Example
• Door entry alarm
– Non/soft real-time system: delay < 1-2s
• Video recorder
– Soft real-time system: delay < 1ms
• Car airbag system
– ?
• Weather temperature monitoring
– ?

Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 1 18

Chapter 2 9
8/12/2016

2. Embedded System Design Issues


4. Concurrent issues
– System and environment run concurrently
– multi-functions
– interface with other systems
– May need a scheduler to manage concurrent tasks
Examples: Weather temperature monitoring
Multi-functions:
– Read temperature values from the sensor
– Write data to memory
– Display data on LCD

Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 1 19

2. Embedded System Design Issues


5. Reactive issues
– Continuous / discontinuous interaction
• Power on demand
– Turn ON when using
– Ex: MP3 player, Tivi system
• Always ON, once started run forever
– Continuous interaction with their environment
– Termination is a bad behavior => 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 1 20

Chapter 2 10
8/12/2016

2. 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 1 21

3. 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, application-
specific, 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 2

Chapter 2 11
8/12/2016

3. 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 Application-specific Single-purpose


processor processor processor

Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 23

Processor technology
• “Processor” not equal to general-purpose processor
Controller Datapath Controller Datapath Controller Datapath

Control Control Registers Control index


Register
logic and logic and logic
file total
State State
Custom State
register register +
General ALU register
ALU
IR PC IR PC
Data Data
memory memory
Program Data Program
memory memory memory
Assembly Assembly
code for: code for:

total = 0 total = 0
for i =1 to … for i =1 to …
General-purpose (“software”) Application-specific Single-purpose (“hardware”)
24
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2

Chapter 2 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

gate
IC package IC oxide
source channel drain
Silicon substrate

25
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2

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 2

Chapter 2 13
8/12/2016

4. Project plan
• Build a team

• Build a plan

Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 27

Build a team
• Important points about teams
– Teams bring together complementary skills and
experiences
– Teams establish communication to support real-
time problem solving
– Teams develop decisions by consensus rather than
by authority

Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 28

Chapter 2 14
8/12/2016

Team Contract
TEAM CONTRACT
Team name: BK1 Date: 26 Aug. 2014
Team member Roles Signature
Nguyễn Văn A Leader, system engineer
Trần Văn B Hardware design
Nguyễn Thị C Software design
Tasks Responsible member
1. Develop system architecture Nguyễn Văn A
2. Design hardware Trần Văn B
3. Develop software Nguyễn Thị C
4. Integrate and test All
Team meeting 9AM, Wednesday, weekly
Team rules 1. Participate in all team meetings
2. Listen carefully to all comments at meetings
3. Complete all assigned tasks before deadlines
4. Focus on results rather than excuses after.
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 29

Build a plan
• Project planning activities

Identify the task

Develop Develop Estimate


teams schedule time

Plan tasks

Refine plan Approve Cancel plan


plan

Proceed plan

Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 30

Chapter 2 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 3 months (8 hours / a day)
Start: 20 Aug. 2014 End: 20 Nov. 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
Schedule

Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 31

Project plan example (2)


Project planning
Schedule Month 1 Month2 Month 3
1. Design system architecture
2. Design hardware part
2.1. Design central control board
2.2. Design interface
2.3. Implement hardware board
3. Develop software part
3.1. Develop control algorithm
3.2. Develop driver, user interface
3.3. Implement software program
4. Integrate and test
4.1. Simulate operations
4.2. Verify system

Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 32

Chapter 2 16
8/12/2016

Class assignment
• Design a embedded system for washing machine
No. Specification Describe
1 Product -Washing process: soak, wash, rinse, spin
specification -Mode: manual, fuzzy
-Constraints
2 Engineering -Inputs:
specification -Outputs:
-Use interface:
3 Hardware -Microcontroller:
specification -Sensors:
-Actuators:
4 Software -Functions:
specification -Control algorithm:
5 Test -Platform:
specification -Test process:
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 33

Group discussion
1. Consider the project car’s door mechanism
Write system specification for this project

Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 34

Chapter 2 17
8/12/2016

Group discussion
2. 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 2 35

Chapter 2 18

You might also like