0% found this document useful (0 votes)
43 views

Chapter 2 - Develop A Project of Embedded System Design

1. The document discusses the process of developing an embedded system design project using the waterfall model. It describes steps like requirement definition, system specification, design issues, and project planning. 2. It explains how to write a system specification including product requirements, design specifications, hardware specifications, software specifications, and test specifications. 3. The design process involves stepwise refinement where the design is analyzed and refined at each level of abstraction to add more details while verifying goals are met.

Uploaded by

anhbazoca
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Chapter 2 - Develop A Project of Embedded System Design

1. The document discusses the process of developing an embedded system design project using the waterfall model. It describes steps like requirement definition, system specification, design issues, and project planning. 2. It explains how to write a system specification including product requirements, design specifications, hardware specifications, software specifications, and test specifications. 3. The design process involves stepwise refinement where the design is analyzed and refined at each level of abstraction to add more details while verifying goals are met.

Uploaded by

anhbazoca
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

8/22/2019

ĐẠ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

om
1. Design Process
2. Design Specification
3. Design Issues

.c
4. Project plan

ng
co
1
an
th
ng

1. Embedded System Design Process


o
du

• 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.
u

– The spiral model: in which there is a process for developing a system


cu

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 CuuDuongThanCong.com https://fb.com/tailieudientucntt 1


8/22/2019

1. Embedded System Design Process


CAD tools Requirement definition Customers

System specification System


architects
System partitioning

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

1.1. System Specification


o
du

Documents for System Specification

1. Product Requirement Describe how the product will be.


u
cu

2.Design Specification Describe hardware modules,


subsystem, and functions 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 CuuDuongThanCong.com https://fb.com/tailieudientucntt 2


8/22/2019

Design Goals

Performance 1. Product Requirement


Overall speed, deadlines 2.Design Specification

Functionality and user interface 3. Hardware Specification

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

• At each level of abstraction, we must


u

analyze the design to determine


cu

characteristics of the current state of the 1. Product Requirement


design
refine the design to add detail 2.Design Specification
verify that it meets all system goals
3. Hardware Specification
cost, speed, . . .
4. Software Specification

5. Test Specification

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 3


8/22/2019

Identifying the Requirements

om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 7
an
th
ng

Requirements
o

A user requirement is a statement that specifies WHAT a product


du

should do, but it does not define HOW it should do it


u
cu

WHAT:

The device shall decrease the temperature of the


skin

HOW:

The device shall apply moisture to cool down the


skin.

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 4


8/22/2019

Requirements

May be developed in several ways


Talking directly to customers
Talking to marketing representatives
Providing prototypes to users for comment

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

Functional vs. Non-functional


ng

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

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 5


8/22/2019

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

Physical size and weight


du

Depends on the application


Power consumption
u
cu

Important not only in battery-powered systems


Specified in terms of battery life or Wh

Certification
For international market, device need to have
certification to enter the market.
Several important certifications are UL, FCC, CE,
ROHS, IP

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 6


8/22/2019

Validating The Requirements

• Requires understanding what people want


and how they communicate it
• User interface requirements can be refined by
using a mock-up

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

Sample Requirements Form (1/3)


o


du

name • power
• purpose • physical size/weight
u

• inputs and outputs


cu

• Installation
• Use cases • Certification
• functions
• performance
• manufacturing costs

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 7


8/22/2019

Sample Requirements Form (2/3)

• 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

Sample Requirements Form


o
du

• Use case
u

How user will interact with the system


cu

• 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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 8


8/22/2019

Sample Requirements Form

• 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

Sample Requirements Form


o
du

• Certification
u

• Need to meet standards for safety, compatibility.


cu

• Some Certification is UL, CE, FCC, IP

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 9


8/22/2019

Use Cases
“Specifies a sequence of actions, including Specifies a

sequence of actions, including variants, that the system


can perform and that variants, that the system can
perform and that yields an observable result of value to

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

• Describes what the systems does


u

• A collection of operational scenarios that


cu

identify the role played by the in response to


stimulus, and the output produced by the
system
• Initiated by external events that precipitate a
system action

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 10


8/22/2019

What a Use Case Isn’t

• Description of the internal structure of the


system
– Data structures –Data base
Low level interface

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

Use Case Composition


o

• Name
du

Summarizes the usage of the system it models


u

Description or Sequence of Steps


cu

Description of goal to be achieved


Describe the sequence of interactions between the
system and the actors that transpire from the input
system
Actors
Object outside the system that interact with the
system
Assumptions
Assumptions, preconditions, and post conditions
required for the use case to execute
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 22

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 11


8/22/2019

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

• Users, other systems, subsystems, hardware


u

or software components, etc.


cu

• Microcontroller peripherals such as A/D


converter, serial interfaces, sensors
• Hardware components, LCD, push buttons,
sensors

Depend on the perspective, a device can be actor or not

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 12


8/22/2019

Use case diagram

om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 25
an
th
ng

Identifying Use Cases


o
du

• List the primary capabilities of the system,


u

then the actors, then identify specific then the


cu

actors, then identify specific scenarios within


each use case.
• Identify the actors to the system and their
interaction.
• Begin with a system scenario, identify the
actors, and combine those into use cases.

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 13


8/22/2019

Use Case: Monitor CO Level


• Brief Description
– This use case is initiated periodically, measures the CO
sensor level, and computes the CO PPM value.
• Basic Flow
– This use case is initiated every 30 seconds.
– The raw sensor voltage is measured.

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

Validating The Requirements


o
du

Requirements
o name
• The requirements form should be the
introductory of a longer document o purpose
u

• After writing the requirements you should o inputs and outputs


cu

check for internal inconsistency o Use case

• forget to assign functions to an o functions

input/output? o performance

• considered all modes of operation? o manufacturing

• unrealistic number of features into a costs

battery-powered, low-cost machine? o power


o physical
size/weight
o Installation
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 o Certification 28

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 14


8/22/2019

Digital Alarm Clock Requirements


• Description:
• This specification describes and defines the basic
requirements of a digital alarm clock. The clock
resolution is second, with error rate of 1 sec per day.
The clock can have 10 Alarm time.
• External Environment:

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

4 small buttons: MENU, UP,DOWN, ENTER


cu

1 big button: Stop Alarm

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 15


8/22/2019

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

The display should be readable in direct sunlight


cu

and from wide angle.


The display will appear similar to this one

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 16


8/22/2019

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

This mode is the normal mode of the clock, where


cu

continuously update the time/date on the display and


check for alarm.
Basic Flow
This use case is initiated every 1s
The display is updated.
If the alarm time is reached, the clock will sound and
vibrate according to the configuration.
Requirement
None
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 34

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 17


8/22/2019

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.

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 18


8/22/2019

Use Cases

Basic Flow (cont)


If user press MENU, it go to the SETTING mode (Change
mode use case)
Requirement
Time to press the button is longer than 0.5s.

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
……………………….

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 19


8/22/2019

System Functional Specification


• Display time
Description
Depend on the display mode, time is displayed by 24h or am/pm
mode
Requirement
Time is updated on the LCD every second

om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 39
an
th
ng

System Functional Specification


o
du

• Alarm
Description
u

If the Alarm time is reached, the Clock will sound and vibrate
cu

with the set volume.


Requirement
Sound is 87 Db at 1m away
Vibrate is 0.6g

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 20


8/22/2019

System Functional Specification


• Time Count
Description
………………………………….
Requirement
………………………………….

om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 41
an
th
ng

Non Functional Specification


o
du

• 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

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 21


8/22/2019

Non Functional Specification


• Physical size/weight
• Maximum 250g (including battery, enclosure)
• Maximum outer size of the clock is 20x20 mm.
• Power supply
• Adaptor 5V
• Operate for a minimum of 7 days on a fully charged

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

Non Functional Specification


o
du

• Reliability and Safety Specification :


u

The Clock shall comply with the appropriate


cu

standards
• FCC, CE.
MTBF: 3 years
(Mean time between failures)

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 22


8/22/2019

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

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 23


8/22/2019

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

• Format, structure, and type of the system


u

inputs and outputs


cu

– Signal levels
– Timing / critical timing
– Command, Control, Data Formatting
• Memory Maps
• Major modules and their interfaces

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 24


8/22/2019

Hardware first approach

om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử - ĐHBK Chapter 2 49
an
th
ng

System partitioning
o

• System partitioning: divide the system into three


du

parts:
– Hardware (HW): microcontrollers, memories, peripherals,
u

– Software (SW): OS, program, application software


cu

– 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 50

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 25


8/22/2019

Design Specification Example


• Description:
• This specification describes and defines the system
level architecture of a digital alarm clock. The clock
resolution is second, with error rate of 1 sec per day.
The clock can have 10 Alarm time. It supports sound
alarm and vibration.

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

The Clock can be powered by an 12V adaptor or by internal battery.


du
u
cu

12:34

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 26


8/22/2019

System Block Diagram

Button Mode Display


Interface Control

Time
Sounder
Update

om
Tone Configurati Alarm Vibrator
storage on Control

.c
POWER SYSTEM

ng
Voltage Battery
Charger Battery
co regulator Monitor

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


an
th
ng

System Block Diagram in detail


o
du

Button LCD hardware


Buttons Mode LCD
Interface
driver Control Driver
u

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

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 27


8/22/2019

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

Interface Component part Note


component number
MENU, UP,DOWN, Single end, GPIO, Button is off-board,
u

ENTER button 3.3V/0V connect by wires


and pin header
cu

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

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 28


8/22/2019

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

Hardware Interface Component part Note


u

component number
cu

EEPROM SPI, 3.3V supply M95M02- EEPROM capacity is


DWMN3TP/K 256KByte

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 29


8/22/2019

Alternative solution for sound data

Is there another alternative solution?

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

– This module display the current time, date or


mode of the clock.
u
cu

• Requirement
– 3.5 inch.
– 16 bits colour
– Wide angle

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 30


8/22/2019

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

Hardware Interface Component part Note


cu

component number
EEPROM I2C, 3.3V supply DS1307+ Realtime Clock, DIP
footprint

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 31


8/22/2019

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

Hardware Interface Component part Note


component number
cu

Speaker 1W 8Ohm 2 pins header


Audio power Mono input.3.3V MAX4295
amplifier supply
DAC onchip 8 bit

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 32


8/22/2019

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

Hardware Interface Component part Note


component number
cu

Motor 3.3V DC https://vi.aliexpres


s.com/item/100-
Original-Vibrator-
Vibrate-Motor-For-
iPhone-5-5G-
Vibrator-Motor-
Replacement-Free-
Shipping/32587435
712.html

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 33


8/22/2019

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

Hardware Interface Component part Note


component number
cu

Charger IC MCP738312
Regulator to 3.3V DC/DC, LDO MCP1702 Low quiescence
current
Battery DC, 4.2V

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 34


8/22/2019

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

Hardware Interface Component part Note


component number
cu

Resistive Bridge ADC


ADC ADC Onchip

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 35


8/22/2019

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

– This module provide software function to


interface with EEPROM.
u
cu

• Requirement
– Can read upto 8KByte per sec.
• Estimated CPU resource requirement
– maximum 20Byte RAM.

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 36


8/22/2019

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

Micro Controller Selection


o
du

Function Interface /onchip Quantity Pincount Requireme


hardware nt
u

1 Buttons GPIO 5 5
cu

2 Sound DAC 1 1 8 bits DAC


3 EEPROM SPI 1 3 Can read
8KB per
sec
4 Battery ADC 1 1
monitor
….

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 37


8/22/2019

Micro Controller Selection

Functions Speed RAM Special Hardware


Requirement (FPU, etc)

1 Button driver 100Byte


2 Alarm control 10Kbyte

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

Item Hardware Description Importance Cost


EEPROM 256MB Must have 0.5USD
u

Audio Codec High quality Nice to have 2USD


cu

audio processor
RTC Realtime clock Must have 1 USD
MCU STM32F103 3USD

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 38


8/22/2019

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

3. Embedded System Design Issues


o

• Design issues are problems that make


du

it difficult to design an embedded


system
u

1. Constraint issues
cu

– 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 2 78

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 39


8/22/2019

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

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

3. Embedded System Design Issues


o

2. Functional issues
du

– safety-critical applications
– damage to life, health, economy
u
cu

– 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 2 80

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 40


8/22/2019

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

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. Embedded System Design Issues


o

3. Real-time issues
du

– Determine whether the system is hard/soft/non real-time


– Determine the time constraint (delay)
u
cu

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 41


8/22/2019

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

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

3. Embedded System Design Issues


o

5. Reactive issues
du

– Continuous / discontinuous interaction


• Power on demand
u

– Turn ON when using


cu

– 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 2 84

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 42


8/22/2019

3. Embedded System Design Issues


• Group discussion
– Discuss about design issues of your own class
project

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

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 43


8/22/2019

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

Team name: BK1 Date: 26 Aug. 2014


Team member Roles Signature
u

Nguyễn Văn A Leader, system engineer


cu

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 88

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 44


8/22/2019

Build a plan
• Project planning activities

Identify the task

Develop Develop Estimate


teams schedule time

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 plan example (1)


o
du

Project planning
Team name BK_DEE
Product name Home security system
u

Main features -Fire alarm


cu

-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 90

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 45


8/22/2019

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

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

1. Consider the project car’s door mechanism


Write system specification for this project
u
cu

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 46


8/22/2019

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

Chapter 2 CuuDuongThanCong.com https://fb.com/tailieudientucntt 47

You might also like