Introduction to Embedded
Systems
ARM University Program
Copyright © ARM Ltd 2013 1
Module Outline
Introduction to Embedded Systems
CPUs vs. MCUs vs. Embedded Systems
Examples of Embedded Systems
Options for Building Embedded Systems
Features of Embedded Systems
Introduction to Internet of Things (IoT)
What is IoT?
Why IoT?
Challenges of IoT
Building Embedded Systems
Building Embedded System using MCUs
Introduction to the mbedTM Platform
ARM University Program
Copyright © ARM Ltd 2013 2
Introduction to Embedded
Systems
ARM University Program
Copyright © ARM Ltd 2013 3
Introduction to Embedded Systems
What is an Embedded System?
Application-specific computer system
Built into a larger system
Often with real-time computing constraints
Why add a computer to a larger system? Embedded
System
Better performance
More functions and features
Lower cost e.g. through automation
More dependability
Embedded Computer
Input from Software Output to
Environment Environment
Hardware
User Interface Link to other Systems
ARM University Program
Copyright © ARM Ltd 2013 4
CPUs vs. MCUs vs. Embedded Systems
Microprocessor (CPU)
Defined typically as a single processor core that supports at least
instruction fetching, decoding, and executing
Normally can be used for general purpose computing, but needs to
be supported with memories and Input/Outputs(IOs)
To memory
Instruction fetcher Memory Interface
blocks
Instruction decoder
Register banks
ALU
Microprocessor
ARM University Program
Copyright © ARM Ltd 2013 5
CPUs vs. MCUs vs. Embedded Systems
Microcontroller (MCU)
Typically has a single processor core
Has memory blocks, Digital IOs, Analog IOs, and other basic
peripherals
Typically used for basic control purpose, such as embedded
applications
Program Data
Microprocessor
Memory Memory
System Bus
Other
Digital IO Analog IO Timer
peripheral
Microcontroller
ARM University Program
Copyright © ARM Ltd 2013 6
CPUs vs. MCUs vs. Embedded Systems
Embedded System
Typically implemented using MCUs
Often integrated into a larger mechanical or electrical system
Usually has real-time constraints
Embedded
System
ARM University Program
Copyright © ARM Ltd 2013 7
Example Embedded System: Bike Computer
Functions
Speed and distance measurement Input:
Constraints Wheel rotation
Mode key
Size
Cost
Power and Energy
Weight
Inputs
Wheel rotation indicator
Mode key
Output Output:
Liquid Crystal Display Display speed and
distance
Use Low Performance Microcontroller
8-bit, 10 MIPS
ARM University Program
Copyright © ARM Ltd 2013 8
Gasoline Automobile Engine Control Unit
Functions Many Inputs and Outputs
Fuel injection Discrete sensors & actuators
Air intake setting Network interface to rest of car
Spark timing
Exhaust gas circulation Use High Performance
Electronic throttle control Microcontroller
Knock control E.g. 32-bit, 3 MB flash memory,
150 - 300 MHz
Constraints
Reliability in harsh environment
Cost
Weight
ARM University Program
Copyright © ARM Ltd 2013 9
Options for Building Embedded Systems
Implementation Design Unit Upgrades Size Weight Power System
Cost Cost & Bug Speed
Fixes
Dedicated Hardware
Discrete Logic low mid hard large high ? very fast
ASIC high very hard tiny - 1 die very low low extremely
($500K/ low fast
mask
set)
Programmable low to mid easy small low medium to very fast
logic – FPGA, mid high
PLD
Microprocessor + low to mid easy small to low to medium moderate
memory + mid med. moderate
peripherals
Software Running on
Generic Hardware
Microcontroller low mid to easy small low medium slow to
(int. memory & low moderate
peripherals)
Embedded PC low high easy medium moderate to medium to fast
high high
ARM University Program
Copyright © ARM Ltd 2013 10
Benefits of Embedded 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 11
Functions of Embedded Systems
Closed-loop control system
Monitor a process, adjust an output to maintain desired set point
(temperature, speed, direction, etc.)
Sequencing
Step through different stages based on environment and system
Signal processing
Remove noise, select desired signal features
Communications and networking
Exchange information reliably and quickly
ARM University Program
Copyright © ARM Ltd 2013 12
Attributes of Embedded Systems
Interfacing with larger system and environment
Analog signals for reading sensors
Typically use a voltage to represent a physical value
Power electronics for driving motors, solenoids
Digital interfaces for communicating with other digital devices
Simple - switches
Complex – displays
Concurrent, reactive behaviours
Must respond to sequences and combinations of events
Real-time systems have deadlines on responses
Typically must perform multiple separate activities concurrently
ARM University Program
Copyright © ARM Ltd 2013 13
Attributes of Embedded Systems
Fault handling
Many systems must operate independently for long periods of time,
requiring them to handle likely faults without crashing
Often fault-handling code is larger and more complex than the
normal-case code
Diagnostics
Help service personnel determine problems quickly
ARM University Program
Copyright © ARM Ltd 2013 14
Constraints of Embedded Systems
Cost
Competitive markets penalize products which don’t deliver adequate
value for the cost
Size and weight limits
Mobile (aviation, automotive) and portable (e.g. handheld) systems
Power and energy limits
Battery capacity
Cooling limits
Environment
Temperatures may range from -40°C to 125°C, or even more
ARM University Program
Copyright © ARM Ltd 2013 15
Impact of Constraints
Microcontrollers used (rather than microprocessors)
Include peripherals to interface with other devices, respond efficiently
On-chip RAM, ROM reduce circuit board complexity and cost
Programming language
Programmed in the C language rather than the Java language
(resulting in smaller and faster code, so less expensive MCU)
Some performance-critical code may be in assembly language (a
lower level language)
Operating system
Typically no OS, but instead simple scheduler (or even just interrupts
+ main code (foreground/background system)
If OS is used, likely to be a lean RTOS
ARM University Program
Copyright © ARM Ltd 2013 16
Introduction to Internet of
Things
(IoT)
ARM University Program
Copyright © ARM Ltd 2013 17
Internet of Things
Internet of Things (IoT)
IoT as a term generally refers to a world in which
a large range of objects are addressable via the
network
Objects can include
Smart buildings and home appliances, e.g.
washing machines, TVs, fridges, cookers,
doors, chairs… IoT
Civil engineering structures, e.g. bridges,
railways …
Wearable devices, e.g. smart watches,
smart glasses, rings, clothes …
Medical devices, e.g. embedded pills
And possibly every THING in the world…
ARM University Program
Copyright © ARM Ltd 2013 18
Internet of Things
Why IoT?
Items can have more functionalities and become more intelligent
Items can be managed in an easier way
More information become available
Why IoT is becoming more realistic?
Embedded chips are becoming
Cheaper
Smaller
Lower power
Communication is becoming faster
ARM University Program
Copyright © ARM Ltd 2013 19
Challenges of Internet of Things
Large amount of chips required
Chips have to become even more cheaper, smaller
Big data demand
Large volume of data will be generated, data centre storage needs to be
increased
Computation requirement
Requires high performance e.g. for cloud computing
Power consumption
Low power chips, longer battery life, and maybe wireless charging…
Security
Large amount of private data need to be protected
Standards
Official standards are required, such as network protocol
ARM University Program
Copyright © ARM Ltd 2013 20
Building Embedded Systems
ARM University Program
Copyright © ARM Ltd 2013 21
Building Embedded Systems using MCUs
In most embedded systems, MCUs are chosen to be the best solution,
since they offer:
Low development and manufacturing cost
Easy porting and updating
Light footprint
Relatively low power consumption
Satisfactory performance for low-end products
In the following labs, we will learn how to develop a variety of embedded
systems, using an easy-to-start MCU design suite: mbedTM platform
Open software library tools
Low cost hardware platforms, e.g. NXP mbed LPC1768 board,
Bluetooth Smart ARM® Cortex®-M0-based nRF51822-mKIT
development kit from Nordic Semiconductor
mbed LPC1768 board
Online Integrated development environment (IDE)
ARM University Program
Copyright © ARM Ltd 2013 22
What is mbed Platform
mbed is a platform used for developing applications based on ARM
Cortex-M microprocessors
The mbed platform includes:
mbed Software Development Kit (SDK), consists of
C/C++ software libraries, such as peripheral drivers, networking, RTOS and
runtime environment
Software tools, such as build tools, test and debug scripts
mbed Hardware Development Kit (HDK), consist of
Recipes to build custom hardware devices, such as interface firmware and
schematics that can be used to easily create development boards
mbed hardware platforms – off-the-shelf development boards, such as mbed NXP
LPC1768 board, Bluetooth Smart ARM Cortex-M0-based nRF51822-mKIT
development kit from Nordic Semiconductor
mbed supports an online IDE, which provides a free instant-access web-based
toolchain for application development
ARM University Program
Copyright © ARM Ltd 2013 23
Coming Next…
Knowledge of embedded systems
Hardware mechanisms
Introducing the mbed platform
Introducing the ARM Cortex-M3 Architecture
Use Interrupt for low power design
Software programming
Programming basics: assembly, C/C++ programing
Learn to use software libraries: CMSIS, mbed APIs
Develop your own embedded systems
Analog IOs: ADC, DAC, PMW
Serial communication: UART, I2C, SPI
Advanced serial communication: USB, CAN, Bluetooth LE
Network: Ethernet, TCP/IP, HTTP
Real-time operating system
Prototyping applications for Internet of Things
ARM University Program
Copyright © ARM Ltd 2013 24
Useful Resources
ARM University Program
Copyright © ARM Ltd 2013 25