Chapter 2 - Develop A Project of Embedded System Design
Chapter 2 - Develop A Project of Embedded System Design
om
1. Design Process
2. Design Specification
3. Design Issues
.c
4. Project plan
ng
co
1
an
th
ng
SW development
HW design
•Application SW
om
Interface design
•HW architecture
•Device Driver •User interface
•Physical design
•Operating System
.c
SW developer HW designer
Integration and testing Reused
ng
components
No Meet
requirement?
co
Yes
Delivery and maintenance
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 3
an
th
ng
Design Goals
om
Manufacturing cost 4. Software Specification
.c
Power consumption 5. Test Specification
ng
Other requirements (physical size, etc.)
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 5
an
th
ng
Stepwise Refinement
o
du
5. Test Specification
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 7
an
th
ng
Requirements
o
WHAT:
HOW:
Requirements
om
Requirements end up being the specification
.c
Containing enough information to begin designing
the system architecture
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 9
an
th
Requirements
o
du
Functional requirements
output as a function of input
u
cu
Non-functional requirements
time required to compute output
cost
size, weight, etc.
power consumption
reliability
Non-functional Requirements
Performance
Major consideration for the usability of the system and
its ultimate cost
May be a combination of soft performance metrics and
hard deadlines
Cost
Manufacturing costs (e.g. components, assembly)
om
Nonrecurring engineering (NRE) costs (e.g. personnel,
designing the system)
Environment and Installation
.c
The environment that the device will operate
How to install the device
ng
Those requirements are important for designing the
PCB, the enclosure.
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 11
an
th
ng
Non-functional Requirements
o
Certification
For international market, device need to have
certification to enter the market.
Several important certifications are UL, FCC, CE,
ROHS, IP
om
may be executed on a PC
• Physical, nonfunctional models of devices can
.c
also help
better idea of size and weight
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 13
an
th
ng
•
du
name • power
• purpose • physical size/weight
u
• Installation
• Use cases • Certification
• functions
• performance
• manufacturing costs
• name
• purpose
one- or two-line description
• inputs and outputs
om
types of data: analog? digital? mechanical?. . .
data characteristics: periodic? occasional? how many
.c
bits?. . .
types of I/O devices: buttons? A/D converters? video
ng
displays?. . .
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 15
an
th
ng
• Use case
u
• functions
more detailed description of the system
when the system receives an input, what does it do?
how do interface inputs affect these functions?
how do different functions interact?
• performance
must be identified earlier to ensure that the system
works properly
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 16
• manufacturing costs
• cost has substantial influence on architecture
• work with some idea of the cost range
• power
• battery powered? plugged into a wall?
om
• physical size/weight
.c
• more or less flexibility in the components to use
• Installation
ng
• Device is fixed, wall mounted or on desk, etc
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 17
an
th
ng
• Certification
u
Use Cases
“Specifies a sequence of actions, including Specifies a
om
an yields an observable result of value to an actor ”
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 19
an
th
ng
Use cases
o
du
om
Single event or message
Event or action internal to the system that is not
.c
externally observable or does not produce a result
external to the system
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 21
an
th
ng
• Name
du
Actors
• Definition
– Represents what interacts with the system
– Any object outside the system under development
that has a significant interaction with the system
• Characteristics
om
– One or more per use case
.c
– Not necessarily involved in all use cases
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 23
an
th
ng
Actor examples
o
du
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 25
an
th
ng
om
– A PPM value is computed based on the measured value
and display on the LED
.c
– If the value is more than 20%, the alarm speaker turn on
• Requirements
ng
– The PPM value is limited to values between 0 to 999
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 27
an
th
ng
Requirements
o name
• The requirements form should be the
introductory of a longer document o purpose
u
input/output? o performance
om
• The Clock will be used indoor, put on desk or bed side
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 29
an
th
ng
Inputs
o
du
• inputs:
u
Output
• Display:
• LCD with back light
• Date is display as Day/Month/Year
• Time can be display as am/pm or 24h, up to second.
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 31
an
th
ng
Output
o
du
• Display (cont)
u
Output
• Display (cont)
Power Saving Mode
Day/Night Mode
Adaptive Brightness mode
om
• Sound
The speaker can generate a sound at the volume of
.c
87dB, measured by a microphone placed 1 meter
away
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 33
an
th
ng
Use Cases
o
• Normal run
du
Brief Description
u
Use Cases
• Change mode
Brief Description
Perform the mode changing.
Basic Flow
This use case is initiated if user press MENU button
When power on, the clock enter run mode. If user press
om
MENU, it display SETTIME mode. If user Press ENTER, it will
enter SETTIME mode. If user press MENU again, it display
.c
SETDATE mode. If user press MENU again, it display
SETTIMEMODE mode. If user press MENU again, it display
SETALARM MODE mode. . If user press MENU again, it return
ng
to RUN MODE mode
Requirement: Time to press the button is longer than 0.5s.
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 35
an
th
ng
Use Cases
o
• Set Time
du
Brief Description
Perform the set current time function.
u
cu
Basic Flow
This use cases will initiate is user enter SETTIME mode
from CHANGEMODE use case.
First, the Hours display will blink. If user press Up button,
it will increase. If user press Down button, it will decrease. If
user press Enter Button, the current value is saved and the
Minute display is blink. The same thing happen and if user
press Enter, the Minute value is saved and the Second display
is Blink. If user press Enter, the Hour display will blink again.
Use Cases
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 37
an
th
ng
Use Cases
o
• Set Time
du
Brief Description
………………………
u
cu
Basic Flow
……………………….
Requirement
……………………….
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 39
an
th
ng
• Alarm
Description
u
If the Alarm time is reached, the Clock will sound and vibrate
cu
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 41
an
th
ng
• performance:
• Can save 100 Alarm tone, maximum length of each
u
tone is 10 sec.
cu
• Manufacturing Cost
40 USD per piece for 1000 in quantity
om
battery.
• Installation and working environments
.c
• Put on desk and bed.
• Indoor
ng
• Temperature range: 10 – 80 Celcius
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 43
an
th
ng
standards
• FCC, CE.
MTBF: 3 years
(Mean time between failures)
Requirements Validation
• Validity checks: The functions proposed by stakeholders
should be aligned with what the system needs to perform.
• Consistency checks: Requirements in the document shouldn’t
conflict or different description of the same function
• Completeness checks: The document should include all the
requirements and constrains.
• Realism checks: Ensure the requirements can actually be
om
implemented using the knowledge of existing technology, the
budget, schedule, etc.
.c
• Verifiability: Requirements should be written so that they can
be tested. This means you should be able to write a set of
tests that demonstrate that the system meets the specified
ng
requirements. co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 45
an
th
ng
EXERCISE
o
du
• Group discussion
– Finish the Digital Alarm Clock requirement
u
cu
2. Design Specification
• System description
– Written from a designer point of view
– System architecture
– Block diagram if appropriate
• First order functional decomposition
• System behavior
om
– Control flow
– Data flow
.c
– Signal flow
– Timing requirements
ng
– State diagrams
– Constraints
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 47
an
th
ng
2. Design Specification
o
du
– Signal levels
– Timing / critical timing
– Command, Control, Data Formatting
• Memory Maps
• Major modules and their interfaces
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 49
an
th
ng
System partitioning
o
parts:
– Hardware (HW): microcontrollers, memories, peripherals,
u
om
• External Environment:
• The Clock will be used indoor, put on desk or bed side
.c
• Temperature range is 10-35 Celcius
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 51
an
th
ng
System Connectivity
o
12:34
Time
Sounder
Update
om
Tone Configurati Alarm Vibrator
storage on Control
.c
POWER SYSTEM
ng
Voltage Battery
Charger Battery
co regulator Monitor
HW
cu
EEPROM Configurat
EEPROM
Driver ion
DAC Speaker
driver
Vibrator
Time Alarm Vibrator motor
Motor
Update Control driver
Battery
Monitor
POWER SYSTEM
Battery
Voltage
Charger Battery level
regulator
monitor
Button Interface
• Purpose
– This module provide interface to 5 buttons.
• Requirement
– Stable, long life button
– Connector must be tight
om
– Buttons are push buttons.
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 55
an
th
ng
Button interface
o
• Hardware
Hardware:
du
2mm pitch
STOPALARM button Single end, GPIO, Button is off-board,
3.3V/0V connect by wires
and pin header
– Interface circuit: 2mm pitch
3.3V
R1
4.7K
J1
1
2
HEADER 2
EEPROM
• Purpose
– This module contain alarm tones data and
configuration data (alarm time, alarm volume,
vibration volume).
• Requirement
– Contains 10 tones, each tone is 10sec long, 8 bit,
om
fs=8k.
– Contains 10 alarm data (alarm time, alarm
.c
volume, vibration volume) .
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 57
an
th
ng
EEPROM
o
du
component number
cu
om
.c
ng
http://www.icstation.com/voice-recorder-chip-seconds-music-audio-recordable-
board-voice-module-electronic-gift-p-9495.html
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 59
an
th
ng
LCD
o
• Purpose
du
• Requirement
– 3.5 inch.
– 16 bits colour
– Wide angle
LCD
Hardware Interface Component part Note
component number
Serial SPI 2.8" inch SPI, 3.3V supply https://www.ebay.c
TFT LCD Display ER-TFT028-4(RTP) om/itm/Serial-SPI-
320x240 2-8-inch-TFT-LCD-
Display-320x240-
Resistive-Touch-
Panel-w-Tutorial-
/291019691582
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 61
an
th
ng
Time Update
o
du
u
component number
EEPROM I2C, 3.3V supply DS1307+ Realtime Clock, DIP
footprint
Sounder
• Purpose
– This module generate alarm sound.
• Requirement
– Can generate 87 Decibel sound at the distance of
1m.
.
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 63
an
th
ng
Sounder
o
du
• Alarm (cont)
u
Vibrator
• Purpose
– This module generate vibration.
• Requirement
– Can generate 0.6g vibration
.
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 65
an
th
ng
Vibrator
o
du
• Alarm (cont)
u
Power supply
• Purpose
– This module charges the battery and regulate
voltage to supply the system.
• Requirement
– Input voltage: 5-6VDC
– Output voltage: 3.3V
om
– Maximum current supply: 200 mA.
.c
– Battery: 4.2V Li-Po
– Automatic switch to battery when power is lost.
ng
.
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 67
an
th
ng
Power supply
o
du
u
Charger IC MCP738312
Regulator to 3.3V DC/DC, LDO MCP1702 Low quiescence
current
Battery DC, 4.2V
Battery monitor
• Purpose
– This module measure the battery level
• Requirement
– Input voltage: battery voltage, maximum 4.4V
– Output voltage: 0-3V
om
.c
.
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 69
an
th
ng
Battery monitor
o
du
u
Button driver
• Purpose
– This module provide software function to
interface 5 buttons.
• Requirement
– Implement the debounce
– Deadline to detect button presses/released is 0.5s
om
• Estimated CPU resource requirement
.c
– maximum 100Byte RAM.
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 71
an
th
ng
EEPROM driver
o
• Purpose
du
• Requirement
– Can read upto 8KByte per sec.
• Estimated CPU resource requirement
– maximum 20Byte RAM.
Alarm control
• Purpose
– This module provide software function to:
• Check if an alarm time is met.
• Get sound data from EEPROM, put to buffer and generate the
sound
• Control the vibrator
• Monitor and notify when battery level is low
om
• Requirement
– Can put 8KByte sound data to buffer
.c
– Generate the sound with correct sampling rate
• Estimated CPU resource requirement
ng
– maximum 10KByte RAM. co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 73
an
th
ng
1 Buttons GPIO 5 5
cu
om
3
…..
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 75
an
th
ng
Hardware Considering
o
du
audio processor
RTC Realtime clock Must have 1 USD
MCU STM32F103 3USD
Group discussion
– Finish the System Specification for the digital clock
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 77
an
th
ng
1. Constraint issues
cu
om
4 Response time for control < 1ms ?
5 Support remote control by smartphones ?
6 Easy to install ?
.c
Constraints are limitations or restrictions of some parameters
ng
of the system
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 79
an
th
ng
2. Functional issues
du
– safety-critical applications
– damage to life, health, economy
u
cu
om
current
4 Support 3 charging modes ?
.c
5 Apply efficient algorithm for fast charging and increase ?
battery life cycle
Functional issues are problems which can affect to life, health,
ng
economy, environment, society, politics, ethics.
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 81
an
th
ng
3. Real-time issues
du
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
– ?
om
Multi-functions:
– Read temperature values from the sensor
.c
– Write data to memory
– Display data on LCD
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 83
an
th
ng
5. Reactive issues
du
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 85
an
th
ng
4. Project plan
o
du
• Build a team
u
cu
• Build a plan
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
om
by authority
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 87
an
th
ng
Team Contract
o
TEAM CONTRACT
du
Build a plan
• Project planning activities
om
Plan tasks
.c
Refine plan Approve Cancel plan
plan
ng
Proceed plan
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 89
an
th
ng
Project planning
Team name BK_DEE
Product name Home security system
u
-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
om
3. Develop software part
3.1. Develop control algorithm
3.2. Develop driver, user interface
.c
3.3. Implement software program
4. Integrate and test
ng
4.1. Simulate operations
4.2. Verify system
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 91
an
th
ng
Group discussion
o
du
Group discussion
2. Consider the project car door mechanism
Write team contract and plan for the project
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 93
an
th
o ng
du
u
cu