Mbed BK Ed2 CH 1
Mbed BK Ed2 CH 1
If you use or reference these slides or the associated textbook, please cite the original authors’ work as follows:
Toulson, R. & Wilmshurst, T. (2016). Fast and Effective Embedded Systems Design - Applying the ARM mbed
(2nd edition), Newnes, Oxford, ISBN: 978-0-08-100880-5.
www.embedded-knowhow.co.uk
What is an Embedded System?
An embedded system is a product which is controlled by a
computer inside it, but whose overall function is not computing.
Examples are near endless, and include washing machines,
office equipment, and car engine management.
An Example Embedded System
A snack vending machine is a good example of an embedded system. At its
heart is a single microcontroller. As the diagram shows, this accepts a number
of input signals, from the user keypad, the coin counting module, and from the
dispensing mechanism itself. It generates output signals dependent on those
inputs.
The Segway Personal Transporter
Essentials
Essentials of a computer
of a computer
The Microcontroller
A microcontroller takes the essential features of the computer, and adds to these the
features that are needed for it to perform its control functions. It’s useful to think of it as
being made up of three parts: core, memory and peripherals,
Development Processes - what’s so Special about C/C++?
As programmers, it is our ultimate goal to produce a program which makes the
microcontroller do what is needed. That program must be a listing of instructions, in
binary, drawn from the instruction set. We sometimes call the program in this raw binary
form machine code.
It’s tedious, to the point of being near impossible, for us as humans to work with the
binary numbers which form the instruction set. A step to programming sanity is to use a
High Level Language (HLL), which generates the machine code through a compiler.
C is a HLL with clear advantages. This is because it is simple, and has features which
allow access to the hardware when needed. A step up from C is C++, which is also
widely used for more advanced embedded applications.
The Development Cycle
The RISC approach looks like a "back to basics" move. A simple RISC CPU can
execute code fast, but it may need to execute more instructions to complete a
given task, compared to its CISC cousin. Characteristic of the RISC approach
include:
• each instruction is contained within a single binary word.
• every instruction normally takes the same amount of time to execute.
• Other useful design features can then be implemented, for example
pipelining - an approach by which as one instruction is being executed, the
next is already being fetched from memory.
The world of ARM - The Cortex core