ECS642U: Embedded Systems Introduction William Marsh
Outline What is an embedded system? –Applications –Hardware –Software Introducing the ARM Cortex-M0+ –Hardware capabilities –Programming Course aims, topics and organisation
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
Embedded System Examples Anti-lock braking Engine Control (VW)
Videos Anti-lock braking 6M4 6M4 Volkswagen engine control kswagen-clean-diesel-recall-passenger-carshttp:// kswagen-clean-diesel-recall-passenger-cars
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.” 015/09/27/business/compl ex-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.
Jobs in Embedded Systems Medical Automotive Aerospace Industrial control and automation … Software-Engineer-jobs
Embedded System Concepts … and related
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
I/O What do embedded computers do? –Actuators: open, close, start, stop –Sensors: temperature, vision, touch
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
Best Computer? Cheapest for application Cost –Component costs –Manufacturing costs Integration – how many external components? Number of pins Power Performance –I/O –Processing
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
Practical Work H/W Overview ARM Cortex-M0+ MKL25Z128VLK4 Microcontroller Freescale Freedom (FRDM-KL25Z) dev board
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
Board – MCU – CPU Freescale Freedom Development Board MKL25Z128VLK4 Microcontroller (MCU) ARM Cortex-M0+ CPU
ARM: History and Products Created in 1990 from Acorn Computers Smart phone / tablet Embedded systems
Inside an iPhone Embedded Processors Application Processors
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
MCU – How Fast?
Claims for L Series MCU Fast Cost Power
Freescale KL2 MCU
Freedom Development Board
Target Board: FRDM-KL25Z
MCU Components
Cortex-M0+ Processor Coe
Memory 128 KB flash –Non-volatile –Used for program 16 KB SRAM –Use for data variables –… and stack
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
Multiplexed Pins Pins add to cost Each pin has multiple uses Pins must be configure d
MCU Pin Configuration Part of the MCU pin configuration table –Shows alternative uses –Do not confuse with Freedom Board headers
Connect MCU pins to external devices Freedom Board Headers
Development Software
Course Aims, Topics and Organisation
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
Course Topics Digital & analog I/O Interrupts State machines Real-time operating sys Concurrency & scheduling Timers Testing Energy usage Catch-up / skillsMain Topics C programming (Very) basic electronics Principles of OS Computer architecture Assembly code
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 3 rd week –Week 1 lab by end of lab in week 3
2 Short Written Exercises (5%) Exam practice Not timed Submit on QMPlus
Books and Resources Books C programming resources Documentation from –ARM –Freescale
Communication QMPlus Forums 1.Announcements –Only I can post 2.Q&A –Anyone can post –USE THIS – no s please
Summary Embedded systems –Inside a system –Reacting to events in real-time Course includes practical work