ARM University Program
Copyright © ARM Ltd 2013 1
Introduce yourself to the class!
Your introduction should include the
following:
• Your name
• Your profession
• Your work experience
• Why are you pursing your degree
• One fact about yourself
ARM University Program
Copyright © ARM Ltd 2013 2
ARM University Program
Copyright © ARM Ltd 2013 4
ARM University Program
Copyright © ARM Ltd 2013 5
Curriculum Overview
▪ Introductory Course: Building an Embedded System with an MCU
▪ Microcontroller concepts
▪ Software design basics
▪ ARM Cortex M0+ architecture and interrupt system
▪ C as implemented in assembly language
▪ Peripherals and interfacing
ARM University Program
Copyright © ARM Ltd 2013 7
CHAPTER 1:
Introduction to
Embedded Systems Design
ARM University Program
Copyright © ARM Ltd 2013 9
CHAPTER 1:
Introduction to
Embedded Systems Design
ARM University Program
Copyright © ARM Ltd 2013 10
CHAPTER 1:
Introduction to
Embedded Systems Design
ARM University Program
Copyright © ARM Ltd 2013 11
Chapter 1 Contents
▪ Overview
▪ The basic motivations and key concepts for embedding a computer
into another system.
▪ The design of the hardware and software for the embedded systems
▪ The constraints that designers face.
▪ The target hardware platform we will use in this course.
ARM University Program
Copyright © ARM Ltd 2013 16
Concepts - Why Control a System?
• Improving how a system is controlled can provide
• better performance
• extra features
• reduced purchase or operating costs
• more dependability
ARM University Program
Copyright © ARM Ltd 2013 20
Concepts - Why Control a System?
• Embedded computer system:
• a computer that has been embedded into a larger system in
order to improve it in some way,
• typically by controlling it.
ARM University Program
Copyright © ARM Ltd 2013 21
Concepts - Why Control a System?
The control
knob on the
front allows
the user to
turn on or off
the hot plate
and to set its
temperature.
Figure 1.1 Electric hot plate for cooking food. Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 22
Concepts - Why Control a System?
• a black control
knob
• a heating element
(covered by a silver
metal circle)
• a red indicator
lamp
• a temperature
control system
Figure 1.2 Internal components of hot plate. Photo by author
ARM University Program
Copyright © ARM Ltd 2013 23
Concepts - Why Control a System?
1. One of the switch
contacts is made
from two different
types of metal so
that it bends as it
grows hotter.
Figure 1.3 A detailed view of the thermostatic switch used to control the
heating element. Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 24
Concepts - Why Control a System?
2. When the switch gets hot enough,
the contact bends so far that the switch
disconnects the heating element from
the power.
1. One of the switch
contacts is made
from two different
types of metal so
that it bends as it
grows hotter.
Figure 1.3 A detailed view of the thermostatic switch used to control the
heating element. Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 25
Concepts - Why Control a System?
2. When the switch gets hot enough,
the contact bends so far that the switch
disconnects the heating element from
the power.
3. The heating
1. One of the switch element and
contacts is made then the switch
from two different start to cool
types of metal so down.
that it bends as it Eventually the
grows hotter. switch will cool
down enough to
bend back and
make contact.
Figure 1.3 A detailed view of the thermostatic switch used to control the
heating element. Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 26
Concepts - Why Control a System?
• How Good Is the Hot Plate’s Temperature Control?
Figure 1.4 Hot plate temperatures measured over time.
• At time t = 0:00, the control knob is set to Low to turn on the heating element.
• The temperature rises to nearly 300°C over the next 5 minutes.
• The heating element turns off briefly at t = 4:00 and then for a longer time at t = 5:00.
ARM University Program
Copyright © ARM Ltd 2013 27
Concepts - Why Control a System?
• How Good Is the Hot Plate’s Temperature Control?
Figure 1.4 Hot plate temperatures measured over time.
• At time t = 0:00, the control knob is set to Low to turn on the heating element.
• The temperature rises to nearly 300°C over the next 5 minutes.
• The heating element turns off briefly at t = 4:00 and then for a longer time at t = 5:00.
• The hot plate then takes the next 10 minutes to cool down to about 150°C at about t
= 14:40.
ARM University Program
Copyright © ARM Ltd 2013 28
Concepts - Why Control a System?
• How Good Is the Hot Plate’s Temperature Control?
Figure 1.4 Hot plate temperatures measured over time.
• The actual temperature swings wildly in the first 15 minutes.
• Variations in temperature will make it harder to cook food consistently.
• The temperature finally starts to stabilize after 15 or 20 minutes,
• which is a long time to wait before starting to cook.
ARM University Program
Copyright © ARM Ltd 2013 29
Concepts - Why Control a System?
• How Good Is the Hot Plate’s Temperature Control?
Figure 1.4 Hot plate temperatures measured over time.
• The actual temperature of the hot plate cooking surface is not measured.
• Instead, the switch measures a combination of the temperatures of the metal shield and
the internal air.
ARM University Program
Copyright © ARM Ltd 2013 30
Concepts - Why Control a System?
• How Good Is the Hot Plate’s Temperature Control?
Figure 1.4 Hot plate temperatures measured over time.
• There is a delay between
• when the metal shield and the internal air temperatures change
• and when the switch temperature changes,
• as the heat must be conducted to the switch contact.
• The control system is not calibrated.
ARM University Program
Copyright © ARM Ltd 2013 31
Concepts - Why Use Electronics and an Embedded
Computer?
Using electronics can improve the temperature control of this hot plate
in many ways:
• Reduce the delay
ARM University Program
Copyright © ARM Ltd 2013 34
Concepts - Why Use Electronics and an Embedded
Computer?
Using electronics can improve the temperature control of this hot plate
in many ways:
• Reduce the delay
• Mount a smaller temperature sensor
ARM University Program
Copyright © ARM Ltd 2013 35
Concepts - Why Use Electronics and an Embedded
Computer?
Using electronics can improve the temperature control of this hot plate
in many ways:
• Reduce the delay
• Mount a smaller temperature sensor
▪ Switch the heating element on and off more frequently
ARM University Program
Copyright © ARM Ltd 2013 36
Concepts - Why Use Electronics and an Embedded
Computer?
Using electronics can improve the temperature control of this hot plate
in many ways:
• Reduce the delay
• Mount a smaller temperature sensor
▪ Switch the heating element on and off more frequently
• An electronic approach allows us to measure the temperature precisely
ARM University Program
Copyright © ARM Ltd 2013 37
Concepts - Why Use Electronics and an Embedded
Computer?
Using electronics can improve the temperature control of this hot plate
in many ways:
• Reduce the delay
• Mount a smaller temperature sensor
▪ Switch the heating element on and off more frequently
• An electronic approach allows us to measure the temperature precisely
▪ Adding multiple temperature sensors would allow us to monitor temperatures at
multiple locations on the hot plate, not just one.
ARM University Program
Copyright © ARM Ltd 2013 38
Concepts - Why Use Electronics and an Embedded
Computer?
Using electronics can improve the temperature control of this hot plate
in many ways:
• Reduce the delay
• Mount a smaller temperature sensor
▪ Switch the heating element on and off more frequently
• An electronic approach allows us to measure the temperature precisely
▪ Adding multiple temperature sensors would allow us to monitor temperatures at
multiple locations on the hot plate, not just one.
We could design a dedicated electronic control circuit to apply these methods
ARM University Program
Copyright © ARM Ltd 2013 39
Concepts - Why Use Electronics and an Embedded
Computer?
• More practical to use an embedded computer
• it provides greater flexibility with low cost
• a quick development time
ARM University Program
Copyright © ARM Ltd 2013 40
Concepts - Why Use Electronics and an Embedded
Computer?
Integrated Circuit (IC)
Electronic circuit with components built into a single piece of silicon,
enabling extreme miniaturization, mass production, and cost reduction
Central Processing unit (CPU)
Hardware circuit that executes a program’s instructions
Instruction
Command for processor to execute. Consists of an operation and zero
or more operands.
MicroController Unit (MCU)
Integrated circuit containing CPU, peripherals, support circuits, and
often memory
ARM University Program
Copyright © ARM Ltd 2013 41
Microcontroller vs. Microprocessor
▪ Both have a CPU core to
execute instructions
▪ Microcontroller has
peripherals for
concurrent embedded
interfacing and control
▪ Analog
▪ Non-logic level
signals
▪ Timing
▪ Clock generators
▪ Communications
▪ point to point
▪ network
▪ Reliability and safety
ARM University Program
Copyright © ARM Ltd 2013 42
Concepts - Why Use Electronics and an Embedded
Computer?
• An MCU makes it easier to add sophisticated control methods at a
low cost per product:
• We customize the computer to our application
• writing software for the application
• designing simple hardware to interface with the system
• The recurring hardware costs are low
• embedded computers typically use MCUs,
• inexpensive (produced in such high volumes)
• include circuits to interface with the system
• The main cost for embedded systems
• development of the control software, not the hardware itself
ARM University Program
Copyright © ARM Ltd 2013 43
Options for Building Embedded Systems
Implementation Design Unit Upgrades Size Weight Power System
Cost Cost & Bug Speed
Dedicated Hardware Fixes
Discrete Logic low mid hard large high ? very fast
ASIC high very hard tiny - 1 very low low extremely
($500K low die fast
/ mask
set)
Programmable logic – low mid easy small low medium very fast
FPGA, PLD to high
Software Running on
Microprocessor + low to mid easy small to low to medium moderate
Generic Hardware
memory + mid med. moderate
peripherals
Microcontroller (int. low mid easy small low medium slow to
memory & to moderate
low
peripherals)
Embedded PC low high easy medium moderate medium fast
to high to high
ARM University Program
Copyright © ARM Ltd 2013 44
Concepts - Why Use Electronics and an Embedded
Computer?
• Once there is an MCU in the system, it becomes much easier to
add other useful features to improve and differentiate the product:
• Automatically turn off the hot plate for safety
• after a fixed time with no temperature knob changes
• Provide calibrated temperature control
• with actual temperatures on the knob rather than low, med, or hot.
• Flash the lamp
• to indicate when the hot plate temperature is at or near the set point
• Display
• the current temperature
• the desired (set-point) temperature on a panel display.
ARM University Program
Copyright © ARM Ltd 2013 45
Why Use Electronics and an Embedded Computer?
Questions?
ARM University Program
Copyright © ARM Ltd 2013 46
Why Use Electronics and an Embedded Computer?
True or False - A microcontroller unit (MCU) has a central processing
unit (CPU) that runs a program made of instructions.
ARM University Program
Copyright © ARM Ltd 2013 47
Why Use Electronics and an Embedded Computer?
True or False - A microcontroller unit (MCU) has a central processing
unit (CPU) that runs a program made of instructions.
ARM University Program
Copyright © ARM Ltd 2013 48
Why Use Electronics and an Embedded Computer?
True or False - Embedded computers use specialized integrated
circuits (ICs) called microcontrollers that have features to simplify the
monitoring and control of a system.
ARM University Program
Copyright © ARM Ltd 2013 49
Why Use Electronics and an Embedded Computer?
True or False - Embedded computers use specialized integrated
circuits (ICs) called microcontrollers that have features to simplify the
monitoring and control of a system.
ARM University Program
Copyright © ARM Ltd 2013 50
Why Use Electronics and an Embedded Computer?
True or False - The main cost for embedded systems is generally the
development of the hardware, not the control software itself.
ARM University Program
Copyright © ARM Ltd 2013 51
Why Use Electronics and an Embedded Computer?
True or False - The main cost for embedded systems is generally the
development of the hardware, not the control software itself.
• The main cost for embedded systems is generally the development
of the control software, not the hardware itself.
ARM University Program
Copyright © ARM Ltd 2013 52
Concepts - How to Embed a Computer?
Figure 1.5 Block diagram of a computer-controlled hot plate.
• MCU: the controller
• to read the desired and actual temperatures
• decides on how to control the output.
ARM University Program
Copyright © ARM Ltd 2013 53
Concepts - How to Embed a Computer?
Figure 1.5 Block diagram of a computer-controlled hot plate.
• For the hot plate, the inputs include
• the temperature control knob position (desired temperature)
• the hot plate temperature.
• measured with a sensor
• provides a signal whose voltage varies proportionally with temperature
ARM University Program
Copyright © ARM Ltd 2013 54
Concepts - How to Embed a Computer?
Figure 1.5 Block diagram of a computer-controlled hot plate.
• Use a simple on/off signal to control the heating element.
• the output signals from the microcontroller are low voltage and low
current not capable of powering the heating element
• use a driver circuit
• to step up the signal from the microcontroller to an adequate level.
ARM University Program
Copyright © ARM Ltd 2013 55
Concepts - How to Embed a Computer?
Figure 1.5 Block diagram of a computer-controlled hot plate.
• The heating element and the indicator lamp operate at a line voltage,
such as 110 V or 220 V.
• the microcontroller operates at a much lower level: 3.3 V.
• use a power supply to convert the input voltage down to 3.3 V.
ARM University Program
Copyright © ARM Ltd 2013 56
Concepts - How to Embed a Computer?
Figure 1.5 Block diagram of a computer-controlled hot plate.
• The main job of the software in the controller
• to compute the error
• between the desired temperature (the set point), as indicated by the
control knob,
• the actual temperature, as measured by the temperature sensor.
• The controller will then adjust the amount of power delivered to the
heating element in order to reduce that error.
ARM University Program
Copyright © ARM Ltd 2013 57
Concepts - Examples of Embedded Systems
The user flies the
quadcopter using a The quadcopter
wireless remote has four motors
control that sends that drive four
commands to rotors to provide
change: lift.
• altitude; By adjusting the
• rotate; speed of the
• travel forward, motors
back, or individually, the
sideways; quadcopter can be
• or even flip over made to move in
180° different ways.
• fly upside
down.
Figure 1.6 A remote-controlled quadcopter toy. Photo by author
ARM University Program
Copyright © ARM Ltd 2013 58
Concepts - Examples of Embedded Systems
The quadcopter has a
The quadcopter’s set of accelerometer
embedded sensors to detect
computer acceleration in three
translates the directions (up/down,
left/right,
user’s remote
forward/back) and
control a set of gyroscopic
commands into sensors to detect
motor speed rotation in three
commands. directions (roll,
pitch, yaw).
Figure 1.6 A remote-controlled quadcopter toy. Photo by author
ARM University Program
Copyright © ARM Ltd 2013 59
Concepts - Examples of Embedded Systems
Figure 1.7 A refrigerator with a freezer, an ice maker, and a dispenser
for water and ice (not shown). Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 60
Concepts - Examples of Embedded Systems
The refrigerator needs to maintain temperatures within specified ranges in
two compartments.
Other features include sounding a chime if the door is left open for too
long and indicating when the water filter needs to be replaced.
Figure 1.8 A user control panel above the chilled water and ice
dispenser. Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 61
Concepts - How to Embed a Computer?
Looking at the Hardware Inside
▪ printed circuit board (PCB)
▪ Board which holds electronic components and conductive traces for
interconnection
▪ light-emitting diode (LED)
▪ Electronic component which emits light.
▪ Used for indicators, backlighting, and general illumination.
ARM University Program
Copyright © ARM Ltd 2013 64
Concepts - How to Embed a Computer?
Looking at the Hardware Inside
Figure 1.9 The front of a quadcopter
controller board. Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 65
Concepts - How to Embed a Computer?
Looking at the Hardware Inside
Figure 1.10 The back of a quadcopter controller board.
Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 66
Concepts - How to Embed a Computer?
Looking at the Hardware Inside
The MCU is located on
the back of the PCB and
is just one of many
electronic components.
These other components
• convert power,
• amplify and
condition signals
from input devices,
• and drive output
devices.
Figure 1.11 The front of a refrigerator controller board. Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 67
Concepts - How to Embed a Computer?
Looking at the Hardware Inside
Inputs:
Switches: user control
panel, compressor overload
protection, freezer door,
refrigerator door, ice bucket
full, water/ice dispenser
lever, cube motor position,
ice maker test, ice route
motor position.
Temperature sensors:
external air, freezer, freezer
defroster, refrigerator,
refrigerator defroster.
Figure 1.11 The front of a refrigerator controller board. Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 68
Concepts - How to Embed a Computer?
Looking at the Hardware Inside
Outputs:
Lights: freezer, refrigerator,
dispenser.
Indicators: user control panel.
Heaters: freezer defroster,
refrigerator defroster, water
pipe, door cap, dispenser,
water tank.
Motors: compressor, ice route,
auger, cube, ice grinder, freezer
fan, condenser fan, refrigerator
fan.
Water valves: water solenoid,
icemaker solenoid, water
stepper motor.
Figure 1.11 The front of a refrigerator controller board. Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 69
Concepts - How to Embed a Computer?
Looking at the Hardware Inside
Figure 1.12 The back of a refrigerator controller board.
The microcontroller is the large black diamond. Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 70
Benefits of Embedded Computer Systems
▪ Greater performance and efficiency
▪ Software makes it possible to provide sophisticated control
▪ Lower costs
▪ Less expensive components can be used
▪ Manufacturing costs reduced
▪ Operating costs reduced
▪ Maintenance costs reduced
▪ More features
▪ Many not possible or practical with other approaches
▪ Better dependability
▪ Adaptive system which can compensate for failures
▪ Better diagnostics to improve repair time
ARM University Program
Copyright © ARM Ltd 2013 71
Looking at the Hardware Inside
▪ Questions ?
ARM University Program
Copyright © ARM Ltd 2013 72
Looking at the Hardware Inside
▪ A ________ _______ _______ is a board which holds
electronic components and conductive traces for
interconnection
ARM University Program
Copyright © ARM Ltd 2013 73
Looking at the Hardware Inside
▪ A printed circuit board (PCB) is a board which holds
electronic components and conductive traces for
interconnection
ARM University Program
Copyright © ARM Ltd 2013 74
Looking at the Hardware Inside
▪ True or False - light-emitting diodes (LED) are used for indicators,
backlighting, and general illumination.
ARM University Program
Copyright © ARM Ltd 2013 75
Looking at the Hardware Inside
▪ True or False - light-emitting diodes (LED) are used for indicators,
backlighting, and general illumination.
ARM University Program
Copyright © ARM Ltd 2013 76
Concepts - How to Embed a Computer?
Typical Embedded System Software Operations
▪ Closed-loop control
▪ Sequencing
▪ Signal conditioning and processing
▪ Communications and networking
ARM University Program
Copyright © ARM Ltd 2013 77
Typical Embedded System Software Operations
▪ Closed-loop control
▪ Monitors a process,
▪ adjusts an output to maintain desired set point (temperature, speed,
direction, etc.)
▪ For example,
▪ the refrigerator controller maintains the temperature
▪ by turning on the compressor if the refrigerator compartment is too warm
▪ and turning it off if it is too cold.
▪ the quadcopter controller keeps the craft flat and stable
▪ by adjusting the power to its rotor motors
• based on measurements of acceleration and rotation.
ARM University Program
Copyright © ARM Ltd 2013 78
Typical Embedded System Software Operations
▪ Sequencing
▪ Steps through different stages based on environment and system
▪ For example,
▪ the icemaker follows several steps to make ice:
▪ Fill the ice tray with water.
▪ Chill the ice tray until the water is frozen.
▪ Heat the ice tray to allow the ice to separate from the tray.
▪ Eject the ice from the tray.
ARM University Program
Copyright © ARM Ltd 2013 79
Typical Embedded System Software Operations
▪ Signal conditioning and processing
▪ average together multiple sensor readings
▪ Removes noise,
▪ selects desired signal features
▪ For example,
▪ the quadcopter’s four motors vibrate as they run, introducing noise into the
acceleration and rotation readings.
▪ Taking multiple readings and averaging them
• can reduce the impact of this noise, improving accuracy.
ARM University Program
Copyright © ARM Ltd 2013 80
Typical Embedded System Software Operations
▪ Communications and networking
▪ Exchange information reliably and quickly with subsystems or other systems
▪ Example:
▪ The quadcopter receives packets of control data sent by radio from the
controller.
▪ The MCU decodes each packet of data to determine which commands and
parameters have been sent.
ARM University Program
Copyright © ARM Ltd 2013 81
Typical Embedded System Software Operations
▪ Questions?
ARM University Program
Copyright © ARM Ltd 2013 82
Typical Embedded System Software Operations
▪ True or False - To do their work, embedded systems typically perform one
or more of these types of operations:
a) Closed-loop control
b) Sequencing
c) Signal conditioning and processing
d) Communications and networking
ARM University Program
Copyright © ARM Ltd 2013 83
Typical Embedded System Software Operations
▪ True or False - To do their work, embedded systems typically perform one
or more of these types of operations:
a) Closed-loop control
b) Sequencing
c) Signal conditioning and processing
d) Communications and networking
ARM University Program
Copyright © ARM Ltd 2013 84
Concepts - Embedded System Attributes
▪ Interfacing with Inputs and Outputs
▪ Concurrency
▪ Responsiveness
▪ Reliability and Fault Handling
▪ Diagnostics
▪ Constraints
ARM University Program
Copyright © ARM Ltd 2013 86
Concepts - Embedded System Attributes
Interfacing with Inputs and Outputs
▪ Embedded computers typically need
▪ to sense the environment
▪ and then control devices in response.
▪ Specialized circuits are needed
▪ to get the information to and from the CPU, which executes instructions.
▪ MCUs consist of
▪ a CPU surrounded by specialized peripheral hardware circuits that perform
much of this interfacing.
▪ Peripheral
▪ Hardware that helps CPU by interfacing or providing special functionality
ARM University Program
Copyright © ARM Ltd 2013 87
Concepts - Embedded System Attributes
Interfacing with Inputs and Outputs
▪ Many of the external devices use analog signals
▪ the voltage (or current) can take on a continuous range of values to convey
information.
▪ For example:
▪ a temperature sensor might indicate its reading by setting its output signal’s
voltage to 0.05 V/°C.
▪ A reading of 0.5 V would indicate a temperature of 10°C:
▪ 0.05 V/°C = 0.5 V at 10°C
▪ analog
▪ Capable of taking on an infinite number of values
ARM University Program
Copyright © ARM Ltd 2013 88
Concepts - Embedded System Attributes
Interfacing with Inputs and Outputs
▪ An analog signal must be converted to a digital value for the program to
process it
▪ this is done using an analog-to-digital converter (ADC).
▪ analog-to-digital converter (ADC)
▪ Circuit which converts an analog value (e.g. voltage) to its corresponding
digital value
▪ digital
▪ Capable of taking on a limited number of values
ARM University Program
Copyright © ARM Ltd 2013 89
Concepts - Embedded System Attributes
Interfacing with Inputs and Outputs
▪ To generate sounds accurately,
▪ the MCU must generate analog voltage signals to drive headphones or
speakers.
▪ The digital values representing the sound signal can be converted to an
analog voltage using a digital-to-analog converter.
▪ digital-to-analog converter (DAC)
▪ Circuit which converts a digital value to its corresponding analog value (e.g.
voltage)
ARM University Program
Copyright © ARM Ltd 2013 90
Concepts - Embedded System Attributes
Interfacing with Inputs and Outputs
▪ Often signals must be processed before they are converted to the digital domain for
the CPU.
▪ For example,
▪ weak signals need to be amplified,
▪ high-voltage signals need to be scaled down to safe levels,
▪ noise must be filtered out.
▪ The MCU may not be capable of driving power-hungry output devices (e.g. motors
and solenoids),
▪ amplification is needed.
ARM University Program
Copyright © ARM Ltd 2013 92
Concepts - Embedded System Attributes
Interfacing with Inputs and Outputs
▪ Consider again the refrigerator controller’s main PCB, as shown in Figures 1.11
and 1.12.
▪ The MCU is not powerful enough to drive the heaters, motors, and valves
directly,
▪ it uses various devices (e.g. the black blocks and the white block along the top
of the PCB) to do the job.
▪ This also protects the circuit by isolating low-voltage components
▪ like the MCU (which operates at 3.3 V) from the mains voltage (e.g. 120 V or
220 V).
ARM University Program
Copyright © ARM Ltd 2013 93
Interfacing with Inputs and Outputs
Questions?
ARM University Program
Copyright © ARM Ltd 2013 94
Interfacing with Inputs and Outputs
True or False – An analog-to-digital converter (ADC) is a circuit
which converts a digital value to its corresponding analog value (e.g.
voltage)
ARM University Program
Copyright © ARM Ltd 2013 95
Interfacing with Inputs and Outputs
True or False – An analog-to-digital converter (ADC) is a circuit
which converts a digital value to its corresponding analog value (e.g.
voltage)
▪ digital-to-analog converter (DAC)
▪ Circuit which converts a digital value to its corresponding analog value
(e.g. voltage)
ARM University Program
Copyright © ARM Ltd 2013 96
Concepts - Embedded System Attributes
Concurrency
▪ Embedded controllers must typically manage multiple activities concurrently, often
with precise control of the timing:
▪ For example,
▪ the quadcopter MCU must accept user commands by radio while also
▪ monitoring rotation (about three axes) and acceleration (in three axes),
▪ controlling the speeds of four motors to maintain stable flight,
▪ flashing indicator lights,
▪ and monitoring battery voltage.
▪ The refrigerator must control
▪ the temperature in the refrigerator compartment,
▪ the temperature in the freezer compartment,
▪ manage the ice-making process,
▪ display information on the front panel,
▪ accept user commands,
▪ and perform diagnostics.
ARM University Program
Copyright © ARM Ltd 2013 100
Concepts - Embedded System Attributes
Concurrency
▪ Adding more features to a system increases the software’s
complexity.
▪ A graphical liquid crystal display (LCD) may require several
software components to
(1) manage the user interface’s windows, menus, and screens
(2) translate text, graphics, and images into pixel values
(3) update the display’s memory with these pixel values
ARM University Program
Copyright © ARM Ltd 2013 102
Concepts - Embedded System Attributes
Concurrency
▪ Other examples
▪ WiFi and Bluetooth communication
▪ removable storage devices such as
▪ Secure Digital flash cards and USB drives.
▪ The maker of a complex peripheral IC may provide a software
module (driver) to make interfacing easier.
ARM University Program
Copyright © ARM Ltd 2013 103
Concepts - Embedded System Attributes
Concurrency
▪ Microcontroller units provide concurrency
▪ by sharing the CPU among different parts of the software
▪ including interrupt handlers, tasks, threads, and processes
▪ by performing some processing in hardware peripherals that run
independently of the CPU.
ARM University Program
Copyright © ARM Ltd 2013 104
Concepts - Embedded System Attributes
Concurrency
▪ The scheduler
▪ determines what piece of software to run next on the processor
▪ switches execution contexts as needed to make it happen correctly.
ARM University Program
Copyright © ARM Ltd 2013 105
Concepts - Embedded System Attributes
▪ Concurrency
▪ Real-time operating systems (e.g. RTX from Keil) typically use such
schedulers.
▪ they require more of the processor’s time and memory
▪ A full-fledged operating system (e.g. Linux)
▪ provides a wide range of features and services to help the embedded
system developer.
▪ Such an operating system (OS) requires even more processor time
and memory, so a much more powerful MCU is required.
ARM University Program
Copyright © ARM Ltd 2013 106
MCU Hardware & Software for Concurrency
▪ CPU executes
instructions from one or
more thread of execution
▪ Specialized hardware
peripherals add
dedicated concurrent
processing
▪ DMA - transferring data
between memory and
peripherals
▪ Watchdog timer
▪ Analog interfacing
▪ Timers
▪ Communications with
other devices
▪ Detecting external signal
events
▪ Peripherals use
interrupts to notify CPU
ARM University Program
Copyright © ARM Ltd 2013of events 107
Concurrent Hardware & Software Operation
Software Hardware Software Hardware Software
Time
▪ Embedded systems rely on both MCU hardware peripherals and
software to get everything done on time
ARM University Program
Copyright © ARM Ltd 2013 109
Concurrency
Questions?
ARM University Program
Copyright © ARM Ltd 2013 110
Concurrency
True or False - Microcontroller units provide concurrency
by sharing the CPU among different parts of the software (including
interrupt handlers, tasks, threads, and processes),
ARM University Program
Copyright © ARM Ltd 2013 111
Concurrency
True or False - Microcontroller units provide concurrency
by sharing the CPU among different parts of the software (including
interrupt handlers, tasks, threads, and processes),
ARM University Program
Copyright © ARM Ltd 2013 112
Concurrency
▪ The ________ determines what piece of software to run next on the
processor
ARM University Program
Copyright © ARM Ltd 2013 113
Concurrency
▪ The scheduler determines what piece of software to run next on the
processor
ARM University Program
Copyright © ARM Ltd 2013 114
Concepts - Embedded System Attributes
▪ Interfacing with Inputs and Outputs
▪ Concurrency
▪ Responsiveness
▪ Reliability and Fault Handling
▪ Diagnostics
▪ Constraints
ARM University Program
Copyright © ARM Ltd 2013 115
Concepts - Embedded System Attributes
Responsiveness
▪ There are two aspects to making a system responsive:
1. raw processing speed
2. task scheduling
▪ First, the processor must be fast enough to complete the critical processing before
its deadline.
▪ There are different ways to approach this.
▪ One is to make the code efficient so it can do the necessary work with very few
instructions.
▪ Making the code efficient is called optimization
• a common task in embedded system development.
▪ Another approach is to use a fast processor so that those instructions are executed
very quickly.
ARM University Program
Copyright © ARM Ltd 2013 118
Concepts - Embedded System Attributes
Responsiveness
▪ Second, the processor needs to stay focused on the critical processing
▪ If possible, the critical processing should be performed by hardware peripherals
▪ to prevent any software interference.
▪ Otherwise, some kind of software scheduling approach is needed.
▪ Simple scheduling approaches provide moderate responsiveness,
▪ to get the best responsiveness, a system needs to use interrupts and a preemptive
scheduler (e.g. a real-time kernel or a real-time OS).
▪ Stepping up to an OS (e.g. Linux) reduces the system’s responsiveness
▪ because now there are many activities that could delay the critical processing.
ARM University Program
Copyright © ARM Ltd 2013 120
Responsiveness
Questions?
ARM University Program
Copyright © ARM Ltd 2013 122
Responsiveness
▪ True or False - If an embedded controller does not respond to
commands and changes in the environment quickly enough, the
system may damage itself, people, or other equipment.
ARM University Program
Copyright © ARM Ltd 2013 123
Responsiveness
▪ True or False - If an embedded controller does not respond to
commands and changes in the environment quickly enough, the
system may damage itself, people, or other equipment.
ARM University Program
Copyright © ARM Ltd 2013 124
Responsiveness
▪ There are two aspects to making a system responsive: raw
processing speed and ____________.
ARM University Program
Copyright © ARM Ltd 2013 125
Responsiveness
▪ There are two aspects to making a system responsive: raw
processing speed and task scheduling
ARM University Program
Copyright © ARM Ltd 2013 126
Concepts - Embedded System Attributes
Reliability and Fault Handling
▪ Embedded systems are expected to work correctly and reliably.
▪ Unlike personal computers,
▪ the user does not expect to have to reboot an embedded computer.
▪ If something fails,
▪ the system should minimize the impact of that failure rather than cause further
problems.
ARM University Program
Copyright © ARM Ltd 2013 128
Concepts - Embedded System Attributes
Reliability and Fault Handling
▪ Providing reliability and appropriate fault handling are very much dependent on
the specific application.
▪ Which components are most likely to fail?
▪ There may be methods to detect actual or impending failures and shut down the
system before there is more trouble.
▪ For example,
▪ sensors can be added
▪ a thermal sensor to detect an overheating motor,
▪ a current sensor to detect short-circuited output
▪ the circuit can be designed in a way to make failures easy to detect in software,
▪ the software may be able to analyze historical data to determine failures.
▪ Embedded systems software typically contains large amounts of fault-handling
code to deal with these exceptional cases.
ARM University Program
Copyright © ARM Ltd 2013 129
Embedded System Attributes
▪ Fault handling
▪ Many systems must operate independently for long periods of time,
▪ Often fault-handling code is larger and more complex than the normal-case
code
ARM University Program
Copyright © ARM Ltd 2013 131
Reliability and Fault Handling
Questions?
ARM University Program
Copyright © ARM Ltd 2013 132
Reliability and Fault Handling
True or False - Embedded systems software typically does not
contain large amounts of fault-handling code to deal with
exceptional cases.
ARM University Program
Copyright © ARM Ltd 2013 133
Reliability and Fault Handling
True or False - Embedded systems software typically does not
contain large amounts of fault-handling code to deal with
exceptional cases.
Embedded systems software typically contains large amounts of
fault-handling code to deal with these exceptional cases.
ARM University Program
Copyright © ARM Ltd 2013 134
Concepts - Embedded System Attributes
▪ Diagnostics
▪ Help service personnel determine problem quickly
Figure 1.13 The label on the back of a refrigerator provides diagnostic and
connection information for service personnel. Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 136
Concepts - Embedded System Attributes
▪ Diagnostics
▪ Help service personnel determine problem quickly
The left half of
the label shown
is dedicated to
explaining the
refrigerator’s
self-diagnosis
capabilities.
Figure 1.13 The label on the back of a refrigerator provides diagnostic and
connection information for service personnel. Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 137
Concepts - Embedded System Attributes
▪ Diagnostics
▪ Help service personnel determine problem quickly
Most connections are
labeled and a legend
labeled “SENSOR
Check-Point”
explains where to
measure the eight
different temperature
sensors.
Figure 1.11 The front of a refrigerator controller board.
Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 138
Diagnostics
Questions?
ARM University Program
Copyright © ARM Ltd 2013 139
Concepts - Embedded System Attributes
▪ Interfacing with Inputs and Outputs
▪ Concurrency
▪ Responsiveness
▪ Reliability and Fault Handling
▪ Diagnostics
▪ Constraints
ARM University Program
Copyright © ARM Ltd 2013 140
Concepts - Embedded System Attributes
Constraints
1. Cost
1. Size and weight limits
1. Power and energy limits
1. Environment
ARM University Program
Copyright © ARM Ltd 2013 142
Concepts - Embedded System Attributes
Constraints
▪ Most embedded systems do not use a complex OS such as Linux to
share the computer’s resources among the parts of the program.
▪ the Linux OS requires large amounts of memory and a fast processor for
good performance.
ARM University Program
Copyright © ARM Ltd 2013 144
Concepts - Embedded System Attributes
Constraints
▪ Some embedded systems have constraints on power.
▪ Power constraints limit the system’s rate of energy use.
▪ For example,
▪ the amount of power that a photovoltaic (PV) cell can generate depends on
the ambient light.
▪ If the circuit tries to use more power than the PV cell can provide,
▪ the cell’s voltage drops and the system stops working.
ARM University Program
Copyright © ARM Ltd 2013 145
Concepts - Embedded System Attributes
Constraints
▪ Energy constraints limit the total amount of energy that can be used.
▪ For example,
▪ a battery holds a limited amount of energy.
▪ That energy can be used quickly or slowly,
▪ but there is only a limited amount available.
▪ Flying the quadcopter faster will discharge its battery faster,
▪ reducing the maximum flight time possible.
▪ So one goal for its developers
▪ to use energy-efficient motors, lights, radios, and MCUs.
ARM University Program
Copyright © ARM Ltd 2013 146
Concepts - Embedded System Attributes
Constraints
▪ Some applications are weight-sensitive.
▪ For the quadcopter, lightness is important because a heavier quadcopter
uses energy faster.
▪ In order to lift a heavier quadcopter, more lift is needed,
▪ so the motors will need to spin faster, drawing more power, and discharging
the battery sooner.
▪ The quadcopter uses very small components in order to reduce the weight.
ARM University Program
Copyright © ARM Ltd 2013 147
Concepts - Embedded System Attributes
Constraints
▪ The quadcopter also has size constraints.
▪ Notice how small the components on the PCB are and how closely packed
together they are.
The refrigerator’s MCU is about 35 mm × 35
mm and takes about 1,225 mm2 of the PCB
area
This is far larger than the quadcopter’s MCU,
which at 10 mm × 10 mm takes only 100
mm2.
ARM University Program
Copyright © ARM Ltd 2013 148
Concepts - Embedded System Attributes
Constraints
▪ Embedded systems are often expected to operate reliably over a wide
range of temperatures.
▪ Electronic components for consumer applications are expected to operate
with ambient temperatures of 0°C to 70°C.
▪ Components for the more demanding industrial and automotive
applications are expected to handle ranges from –40°C to 85°C.
ARM University Program
Copyright © ARM Ltd 2013 149
Impact of Constraints
▪ Microcontrollers used
▪ Include peripherals to interface with other devices, respond efficiently
▪ On-chip RAM, ROM reduce circuit board complexity and cost
▪ Programming language
▪ Programmed in C rather than Java (smaller and faster code, so less expensive
MCU)
▪ Some performance-critical code may be in assembly language
▪ Operating system
▪ Typically no OS, but instead simple scheduler (or even just interrupts + main
code)
▪ If OS is used, likely to be a lean RTOS
ARM University Program
Copyright © ARM Ltd 2013 151
Constraints
▪ Questions?
ARM University Program
Copyright © ARM Ltd 2013 152
Constraints
▪ Which constraints are normally placed on the resulting embedded
system design when trying to meet the system’s functional
requirements?
ARM University Program
Copyright © ARM Ltd 2013 153
Constraints
▪ Which constraints are normally placed on the resulting embedded
system design when trying to meet the system’s functional
requirements?
1. Cost
1. Size and weight limits
1. Power and energy limits
1. Environment
ARM University Program
Copyright © ARM Ltd 2013 154
Chapter 1 Contents
▪ Overview
▪ Concepts
▪ Why Control a System?
▪ Why Use Electronics and an Embedded Computer?
▪ How to Embed a Computer?
▪ Examples of Embedded Systems
▪ Typical Embedded System Software Operations
▪ Embedded System Attributes
▪ Target Platform
▪ Overview
▪ Processor
▪ Microcontroller
▪ Development Board
ARM University Program
Copyright © ARM Ltd 2013 155
ARM University Program
Copyright © ARM Ltd 2013 156
ARM University Program
Copyright © ARM Ltd 2013 157
ARM University Program
Copyright © ARM Ltd 2013 158
ARM University Program
Copyright © ARM Ltd 2013 159
Target Platform - Overview
The processor executes the instructions of the program.
Figure 1.14 An overview of a processor, microcontroller, and development
board. Courtesy of ARM Ltd. and NXP Semiconductors N.V.
ARM University Program
Copyright © ARM Ltd 2013 160
Target Platform - Overview
Figure 1.15 FRDM-KL25Z
development board from NXP
Semiconductors N.V. Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 162
Target Board - FRDM-KL25Z
This PCB
adds a debug
interface,
power
supplies, and
various input
and output
devices.
Figure 1.15 FRDM-KL25Z development board from NXP
Semiconductors N.V. Photo by author.
ARM University Program
Copyright © ARM Ltd 2013 163
Target Board - FRDM-KL25Z
▪ 32-bit Cortex M0+ Processor Core
▪ Freescale Kinetis MKL25Z128VLK4
processor
▪ Extremely low power use
▪ 48 MHz max clock
▪ On-chip 128 KB ROM, 16 KB RAM
▪ Wide range of peripherals, including
USB on-the-go
▪ FRDM-KL25Z board
▪ $13 (USD)
▪ Peripherals: 3-axis accelerometer, RGB
LED, capacitive touch slider
▪ Expansion ports are compatible with
Arduino shield ecosystem – endless
opportunities, low-cost hardware
▪ mbed.org enabled - online software
development toolchain, reusable code
ARM University Program
Copyright © ARM Ltd 2013 165
Target Platform - Processor
Interrupts come to the processor core through the Nested
Vectored Interrupt Controller (NVIC), which prioritizes
and filters them as needed.
Figure 1.16 ARM Cortex-M0+ processor and its associated components. Courtesy of ARM Ltd.
ARM University Program
Copyright © ARM Ltd 2013 166
Target Platform - Processor
The optional Wakeup
Interrupt Controller
(WIC)
• cuts power
consumption by
letting the NVIC and
the rest of the
processor go to a
low-power sleep
mode and waking
them up if an
interrupt is requested.
Figure 1.16 ARM Cortex-M0+ processor and its associated components. Courtesy of ARM Ltd.
ARM University Program
Copyright © ARM Ltd 2013 167
Target Platform - Processor
Several modules provide debug support,
• including downloading code to the MCU’s memory,
• setting break points to control program execution,
• and tracing the sequence of instructions actually executed.
Figure 1.16 ARM Cortex-M0+ processor and its associated components. Courtesy of ARM Ltd.
ARM University Program
Copyright © ARM Ltd 2013 168
Target Platform - Microcontroller
There are typically two types of memory provided:
• The flash memory retains its contents even without power,
so it holds the program and fixed data.
• The SRAM does not retain its contents if there is no power
and is used for temporary data storage.
The microcontroller
augments the ARM
Cortex-M0+ processor
by adding
• memory
• supporting circuitry
• peripheral devices
Figure 1.17 NXP Kinetis KL25Z family microcontroller (MCU).
ARM University Program
Copyright © ARM Ltd 2013 169
Target Platform - Microcontroller
The MCU used here (KL25Z128VLK4) features
• a Cortex-M0+ processor capable of running up to 48 MHz
• contains 128 KB of flash ROM,
• 16 KB of RAM,
• and a wide range of peripherals.
The support circuitry
is required to make the
processor operate.
The processor requires
a clock signal, and the
MCU adds multiple
clock generators.
These clocks have
different levels of
accuracy, speed,
power consumption,
and configurability.
Figure 1.17 NXP Kinetis KL25Z family microcontroller (MCU).
ARM University Program
Copyright © ARM Ltd 2013 170
Target Platform - Microcontroller
Peripheral devices off-load work from the program (which executes on the processor)
and perform it in hardware.
Timer peripherals
allow precise time
measurement of
events or input
signals.
They also enable
generation of
repetitive signals
without software
overhead.
Figure 1.17 NXP Kinetis KL25Z family microcontroller (MCU).
ARM University Program
Copyright © ARM Ltd 2013 171
Target Platform - Microcontroller
Peripheral devices off-load work from the program (which executes on the processor)
and perform it in hardware.
Communication
interfaces translate
digital data between
the processor’s
format and the
formats which
external devices
Figure 1.17 NXP Kinetis KL25Z family microcontroller (MCU).
use.
ARM University Program
Copyright © ARM Ltd 2013 172
Target Platform - Microcontroller
Peripheral devices off-load work from the program (which executes on the processor)
and perform it in hardware.
Analog
interfaces translate
data between the
processor’s digital
format and the
analog domain, in
which signals vary
across a continuous
range of voltages,
rather than the
binary 1/0 of digital
Figure 1.17 NXP Kinetis KL25Z family microcontroller (MCU).
electronics.
ARM University Program
Copyright © ARM Ltd 2013 173
Target Platform - Microcontroller
Peripheral devices off-load work from the program (which executes on the processor)
and perform it in hardware.
Other peripherals are
used to
• reset an out-of-control
program (watchdog),
• accelerate and
automate memory
transfers (DMA),
• and perform other
tasks.
Figure 1.17 NXP Kinetis KL25Z family microcontroller (MCU).
ARM University Program
Copyright © ARM Ltd 2013 174
Target Platform - Development Board
The microcontroller is mounted on an FRDM-KL25Z development board
This board adds
• power supplies,
• a debug interface,
• and various input
and output devices.
An 8-MHz clock
source provides a
stable, accurate timing
reference.
Figure 1.18 NXP FRDM-KL25Z development board. Courtesy of NXP Semiconductors N.V.
ARM University Program
Copyright © ARM Ltd 2013 175
Target Platform - Development Board
The microcontroller is mounted on an FRDM-KL25Z development board
The board is normally
powered by the 5 V
supplied by the USB
connection.
A voltage regulator drops
this to 3.3 V in order to
operate the board’s
components.
There is space to mount a
small 3 V coin cell and
holder, allowing the board
to operate without a
connection to USB power.
Figure 1.18 NXP FRDM-KL25Z development board. Courtesy of NXP Semiconductors N.V.
ARM University Program
Copyright © ARM Ltd 2013 176
Target Platform - Development Board
The microcontroller is mounted on an FRDM-KL25Z development board
A separate debug
microcontroller (in the
green box labeled
OpenSDA) translates
commands and data
between the
development PC (via a
USB connection) and the
KL25Z MCU (the target
microcontroller).
OpenSDA is an Open-
standard Serial and
Debug Adapter
Figure 1.18 NXP FRDM-KL25Z development board. Courtesy of NXP Semiconductors N.V.
ARM University Program
Copyright © ARM Ltd 2013 177
Target Platform - Development Board
The microcontroller is mounted on an FRDM-KL25Z development board
Two input devices are
provided.
• A three-axis inertial
sensor (accelerometer) is
used to detect motion.
Because it also senses the
force of gravity, it can be
used to determine the
inclination (tilt) of the
board.
• A touch-pad slider
measures the position of a
fingertip using a
capacitive sensor.
Figure 1.18 NXP FRDM-KL25Z development board. Courtesy of NXP Semiconductors N.V.
ARM University Program
Copyright © ARM Ltd 2013 178
Target Platform - Development Board
The microcontroller is mounted on an FRDM-KL25Z development board
A three-in-one output
device is included:
• three high-brightness
LEDs (Red, Green, and
Blue).
These LEDs can be lit
with varying levels of
brightness to produce a
full range of colors.
Figure 1.18 NXP FRDM-KL25Z development board. Courtesy of NXP Semiconductors N.V.
ARM University Program
Copyright © ARM Ltd 2013 179
Target Platform - Development Board
QUESTIONS?
ARM University Program
Copyright © ARM Ltd 2013 181
SOFTWARE DEVELOPMENT
TOOLS
ARM University Program
Copyright © ARM Ltd 2013 182
ARM University Program
Copyright © ARM Ltd 2013 183
CMSIS: Cortex Microcontroller
Software Interface Standard
DAP: Debug Access Port
ARM University Program
Copyright © ARM Ltd 2013 184
Why Are We…?
▪ Using C instead of Java (or Python, or your other favorite language)?
▪ C is the de facto standard for embedded systems because of:
▪ Precise control over what the processor is doing.
▪ Modest requirements for ROM, RAM, and MIPS, so much cheaper system
▪ Predictable behavior, no OS preemption
ARM University Program
Copyright © ARM Ltd 2013 186
Why Are We…?
▪ Learning assembly language?
▪ The compiler translates C into assembly language.
▪ To understand whether the compiler is doing a reasonable job, you need to
understand what it has produced.
▪ Sometimes we may need to improve performance by writing assembly versions
of functions.
ARM University Program
Copyright © ARM Ltd 2013 187
Why Are We…?
▪ Required to have a microcontroller board?
▪ The best way to learn is hands-on.
ARM University Program
Copyright © ARM Ltd 2013 188
Target Platform
▪ Questions?
ARM University Program
Copyright © ARM Ltd 2013 189
Target Platform
▪ The _________ executes the instructions of the program.
ARM University Program
Copyright © ARM Ltd 2013 190
Target Platform
▪ The processor executes the instructions of the program.
ARM University Program
Copyright © ARM Ltd 2013 191
Target Platform
True or False - There are typically two types of memory
provided with the FRDM KL25Z: flash memory and SRAM
ARM University Program
Copyright © ARM Ltd 2013 192
Target Platform
True or False - There are typically two types of memory
provided with the FRDM KL25Z: flash memory and SRAM
ARM University Program
Copyright © ARM Ltd 2013 193
1. INTRODUCTION TO EMBEDDED SYSTEMS DESIGN - QUIZ
Which of the following includes on-chip peripherals?
a) Microprocessor (CPU)
a) Microcontroller (MCU)
ARM University Program
Copyright © ARM Ltd 2013 194
1. INTRODUCTION TO EMBEDDED SYSTEMS DESIGN - QUIZ
Which of the following includes on-chip peripherals?
a) Microprocessor (CPU)
a) Microcontroller (MCU)
ARM University Program
Copyright © ARM Ltd 2013 195
1. INTRODUCTION TO EMBEDDED SYSTEMS DESIGN - QUIZ
Which programming language is most commonly used for
programming microcontrollers?
a) Assembly language
b) C and assembly language
c) Java/Swift 3
a) All of the above
ARM University Program
Copyright © ARM Ltd 2013 198
1. INTRODUCTION TO EMBEDDED SYSTEMS DESIGN - QUIZ
Which programming language is most commonly used for
programming microcontrollers?
a) Assembly language
b) C and assembly language
c) Java/Swift 3
a) All of the above
ARM University Program
Copyright © ARM Ltd 2013 199
1. INTRODUCTION TO EMBEDDED SYSTEMS DESIGN - QUIZ
How does an embedded system usually represent logic values
physically?
a) Different voltage levels
b) Different current levels
a) None of the above
a) Both (a) and (b) are correct
ARM University Program
Copyright © ARM Ltd 2013 200
1. INTRODUCTION TO EMBEDDED SYSTEMS DESIGN - QUIZ
How does an embedded system usually represent logic values
physically?
a) Different voltage levels
b) Different current levels
a) None of the above
a) Both (a) and (b) are correct
ARM University Program
Copyright © ARM Ltd 2013 201
1. INTRODUCTION TO EMBEDDED SYSTEMS DESIGN - QUIZ
In which of the following applications can the MCU not be used as
the main processor?
a) Application server
b) Automotive (brakes, speed control, etc)
c) Electronic home devices (washing machines, microwaves, etc)
a) None of the above
ARM University Program
Copyright © ARM Ltd 2013 202
1. INTRODUCTION TO EMBEDDED SYSTEMS DESIGN - QUIZ
In which of the following applications can the MCU not be used as
the main processor?
a) Application server
b) Automotive (brakes, speed control, etc)
c) Electronic home devices (washing machines, microwaves, etc)
a) None of the above
ARM University Program
Copyright © ARM Ltd 2013 203
1. INTRODUCTION TO EMBEDDED SYSTEMS DESIGN - QUIZ
How can a peripheral notify a CPU of events?
a) Using exceptions
b) Using polling
c) Using interrupts
a) None of the above
ARM University Program
Copyright © ARM Ltd 2013 204
1. INTRODUCTION TO EMBEDDED SYSTEMS DESIGN - QUIZ
How can a peripheral notify a CPU of events?
a) Using exceptions
b) Using polling
c) Using interrupts
a) None of the above
ARM University Program
Copyright © ARM Ltd 2013 205
Summary
▪ Embedding a computer to control a system can provide benefits such as better
performance and sophisticated features.
▪ We have seen three examples of applications: a hot plate for cooking food, a toy
quadcopter aircraft, and a refrigerator.
▪ The embedded computer is typically made from a microcontroller that runs
specialized control software which monitors the critical aspects of the system and
its environment and then adjusts its outputs so the system behaves as needed.
▪ The computer uses special hardware to interface with the inputs and outputs.
▪ To meet application requirements, embedded systems must provide sufficient
concurrency, responsiveness, reliability, fault handling, and diagnostic help while
meeting constraints on cost, size, weight, power, energy, and temperature.
▪ Finally, we have seen the target platform for this textbook:
▪ the ARM Cortex-M0+ processor core within the KL25Z128VKL4 MCU on the
NXP FRDM-KL25Z development board.
ARM University Program
Copyright © ARM Ltd 2013 207
References
▪ [1]KL25 Sub-Family Reference Manual, KL25P80M48SF0RM, rev. 3rd ed.,
NXP Semiconductor, B.V., 2016.
▪ [2]Kinetis KL25 Sub-Family Data Sheet, KL25P80M48SF0, rev. 5th ed.,
NXP Semiconductor, B.V., 2016.
▪ [3]FRDM-KL25Z User’s Manual, rev. 2.0, NXP Semiconductor, B.V., 2016.
▪ [4]P. Koopman, Better embedded system software, Pittsburgh:
Drumnadrochit Education LLC, 2010.
▪ [5]J. Ganssle, The art of designing embedded systems, 2nd ed. Elsevier
Inc., 2008.
▪ [6]J. K. Peckol, Embedded systems: A contemporary design tool, John
Wiley & Sons, Inc., 2008.
▪ [7]L. Simone, If I only changed the software, why is the phone on fire?
Embedded debugging methods revealed: technical mysteries for
engineers, Elsevier Inc., 2007.
ARM University Program
Copyright © ARM Ltd 2013 209
Chapter 1 Assignments Due Next Week
Chapter 1 – Homework
On Canvas
ARM University Program
Copyright © ARM Ltd 2013 219
Chapter 1 Assignments Due Next Week
▪ Chapter 1 – Lab
▪ Get your ARM Development Kit
▪ Install Keil MDK Software
▪ Create your own MDK 5 project from scratch
▪ Submit a lab report on Week 2
ARM University Program
Copyright © ARM Ltd 2013 221
Chapter 1 Lab Instructions 1 of 3
Write a lab report to show your results after completing the following
instructions:
1. Open Document: appnt_232_v3.8.pdf
2. Install Keil MDK Software per instructions on page 3, section 4 on C
drive:
▪ 4) Install Keil MDK Software
▪ C:\Keil_v5
▪ C:\00MDK
3. Compile and run Blinky example per instructions on page 6, section 8
▪ To do this you will need the KL25Z development board
1. Creating your own MDK 5 project from scratch, per instructions on
pages 21-23, section 24 (BlinkyNEW)
ARM University Program
Copyright © ARM Ltd 2013 223
Chapter 1 Lab Instructions 2 of 3
▪ If you encounter the warning:
▪ “#1-D: Last line of file ends without a newline”
▪ Just add a couple of lines at the end of the code, i.e. the closing brace
(})
ARM University Program
Copyright © ARM Ltd 2013 224
Chapter 1 Lab Instructions 3 of 3
▪ If you encounter too many errors or a license issue go to:
▪ File/License Management/FlexLM License and click the box Use FLexLM
ARM University Program
Copyright © ARM Ltd 2013 225
Chapter 1 Lab Videos (for reference only)
▪ Setup-Keil-MDK for Simulation
▪ https://www.youtube.com/watch?v=d_O2tu5CMbQ
▪ Building a project in Keil using FRDM-KL25Z board
▪ https://www.youtube.com/watch?v=YXVEGyJDDa8
ARM University Program
Copyright © ARM Ltd 2013 227
CHAPTER 1 - 15-MINUTE QUIZ
▪ On Canvas
▪ Starts Next Tuesday at 5:30 pm
▪ Class lecture starts at 5:46 pm
ARM University Program
Copyright © ARM Ltd 2013 231
ARM University Program
Copyright © ARM Ltd 2013 232
CHAPTER 1:
Introduction to
Embedded Systems Design
END
ARM University Program
Copyright © ARM Ltd 2013 233