ecs642u: embedded systems introduction william marsh
TRANSCRIPT
![Page 1: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/1.jpg)
ECS642U: Embedded Systems
Introduction
William Marsh
![Page 2: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/2.jpg)
Outline
• What is an embedded system?– Applications– Hardware– Software
• Introducing the ARM Cortex-M0+– Hardware capabilities– Programming
• Course aims, topics and organisation
![Page 3: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/3.jpg)
Personal Introductions
William
• Software developer– Minicomputer SCADA– Expert systems– Software analysis tools
• Safety consultancy– Rail / defence
• At QMUL since 2000• Research interests
– Modelling system risk– Decision support
systems
Michael
• Embedded Systems are fun!– Lego+Simulink for Profit– RC cars
• Software development– Award-winning software
verification tools– Amazon Web Services
• At QMUL since 2013• Research
– Formal verification, testing
– Concurrency
![Page 4: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/4.jpg)
Embedded System Examples
Anti-lock brakingEngine Control (VW)
![Page 5: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/5.jpg)
Videos
• Anti-lock braking http://www.youtube.com/watch?v=mKiTAcXK6M4
• Volkswagen engine control• http://www.vox.com/2015/9/21/9365667/
volkswagen-clean-diesel-recall-passenger-cars
![Page 6: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/6.jpg)
Article in NY Times
“If you look at all the code in this car,” Dr. Patel said, “it’s easily as much as a smartphone if not more.”
http://www.nytimes.com/2015/09/27/business/complex-car-software-becomes-the-weak-spot-under-the-hood.html
New high-end cars are among the most sophisticated machines on the planet, containing 100 million or more lines of code. Compare that with about 60 million lines of code in all of Facebook or 50 million in the Large Hadron Collider.
![Page 7: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/7.jpg)
Jobs in Embedded Systems
• Medical• Automotive• Aerospace• Industrial control and automation• …
http://www.indeed.co.uk/Embedded-Software-Engineer-jobs
![Page 8: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/8.jpg)
Embedded System Concepts
… and related
![Page 9: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/9.jpg)
Characteristics of Embedded Systems
• Computer as part of another system– Automotive, aerospace, medical, domestic
appliance, …, toys– Sensors and actuators – monitor and control
• Single purpose (‘dedicated’)– Cheap as possible – smallest processors are
very cheap
• Real-time and reactive• Quality concern
– Complexity and cost of correction
![Page 10: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/10.jpg)
I/O
• What do embedded computers do?– Actuators: open, close, start, stop
– Sensors: temperature, vision, touch
![Page 11: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/11.jpg)
CPU Microcontroller (MCU)
• CPU– Instruction set– Buses – data and addresses– Memory
• MCU– Digital I/O– Analog I/O– Counter timers
• Typical MCU has no external data or address bus
• 8-bit MCU still widely used
![Page 12: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/12.jpg)
Best Computer?
• Cheapest for application• Cost
– Component costs– Manufacturing costs
• Integration – how many external components?• Number of pins
• Power• Performance
– I/O– Processing
![Page 13: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/13.jpg)
Real-time & Reactive System
• Requirement for response at a particular– Time– Interval
• Reactive– Responses to inputs
• Performance– Bandwidth: how much data / sec– Latency: how quick to respond– Timing: how accurate the intervals
Controller Equipment
![Page 14: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/14.jpg)
Practical Work
H/W Overview
• ARM Cortex-M0+• MKL25Z128VLK4 Microcontroller• Freescale Freedom (FRDM-KL25Z) dev board
![Page 15: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/15.jpg)
Target Board - FRDM-KL25Z• 32-bit Cortex M0+ Processor Core• Freescale Kinetis MKL25Z128VLK4
micro-controller– 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– £10– Peripherals: 3-axis accelerometer,
RGB LED, capacitive touch slider– Expansion ports are compatible
with Arduino shield ecosystem– On board debug system
![Page 16: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/16.jpg)
Board – MCU – CPU
Freescale Freedom Development Board
MKL25Z128VLK4 Microcontroller (MCU)
ARM Cortex-M0+
CPU
![Page 17: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/17.jpg)
ARM: History and Products
• Created in 1990 from Acorn Computers• http://www.arm.com/about/company-profile/milestones.php
Smart phone / tablet
Embedded systems
http://www.arm.com/products/processors/index.php
![Page 18: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/18.jpg)
Inside an iPhoneEmbeddedProcessors
ApplicationProcessors
![Page 19: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/19.jpg)
Microcontroller vs. Microprocessor
• CPU core to execute instructions
• Peripherals for interfacing and control– Analog– Timing– Clock generators– Communications
• point to point• network
– Reliability and safety
• Memory internal– No memory bus of
the chip
![Page 20: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/20.jpg)
MCU – How Fast?
![Page 21: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/21.jpg)
Claims for L Series MCU
Fast Cost
Power
![Page 22: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/22.jpg)
![Page 23: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/23.jpg)
Freescale KL2 MCU
![Page 24: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/24.jpg)
Freedom Development Board
![Page 25: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/25.jpg)
Target Board: FRDM-KL25Z
![Page 26: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/26.jpg)
MCU Components
![Page 27: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/27.jpg)
Memory
• 128 KB flash– Non-volatile– Used for program
• 16 KB SRAM– Use for data variables– … and stack
![Page 28: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/28.jpg)
Interfaces
• GPIO (General Purpose I/O)• ADC (Analog to Digital Convertor)
– Analog inputs
• DAC– Analog output
• Real-time clock• Interval timers• Pulse width modulator• Interrupt controller
![Page 29: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/29.jpg)
Multiplexed Pins
• Pins add to cost
• Each pin has multiple uses
• Pins must be configured
![Page 30: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/30.jpg)
MCU Pin Configuration• Part of the MCU pin configuration table
– Shows alternative uses– Do not confuse with Freedom Board headers
![Page 31: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/31.jpg)
• Connect MCU pins to external devices
Freedom Board Headers
![Page 32: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/32.jpg)
Development Software
![Page 33: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/33.jpg)
Course Aims, Topics and Organisation
![Page 34: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/34.jpg)
Aims
• Practice and theory• How to use a micro-controller
– Simple digital I/O timers
• How to structure software– No Operating System
• Polling• Interrupts• State machines
– Real-time OS
• How to debug, test and measure– Software and hardware
![Page 35: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/35.jpg)
Course Topics
Digital & analog I/OInterruptsState machinesReal-time operating sysConcurrency & schedulingTimersTestingEnergy usage
Catch-up / skillsMain Topics
C programming(Very) basic electronicsPrinciples of OSComputer architectureAssembly code
![Page 36: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/36.jpg)
Labs (20% of module)
• Assessed weekly labs• 6 basic lab in weeks 1 – 6
– Attempt all
• 4 advanced labs, after week 7– Attempt at least 2; count double
• Marking– Complete answer sheet– Lab viva then hand-in in the lab– Grade A-E
• Submission by 3rd week – Week 1 lab by end of lab in week 3
![Page 37: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/37.jpg)
2 Short Written Exercises (5%)
• Exam practice• Not timed• Submit on QMPlus
![Page 38: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/38.jpg)
Books and Resources
• Books
• C programming resources• Documentation from
– ARM– Freescale
![Page 39: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/39.jpg)
Communication
• QMPlus Forums
1.Announcements– Only I can post
2.Q&A– Anyone can post– USE THIS – no emails please
![Page 40: ECS642U: Embedded Systems Introduction William Marsh](https://reader034.vdocuments.net/reader034/viewer/2022051315/56649ef05503460f94c00b1c/html5/thumbnails/40.jpg)
Summary
• Embedded systems– Inside a system– Reacting to events in real-time
• Course includes practical work