ecs642u: embedded systems introduction william marsh

40
ECS642U: Embedded Systems Introduction William Marsh

Upload: jonah-jones

Post on 03-Jan-2016

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ECS642U: Embedded Systems Introduction William Marsh

ECS642U: Embedded Systems

Introduction

William Marsh

Page 2: 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

Page 3: ECS642U: Embedded Systems Introduction William Marsh

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

Embedded System Examples

Anti-lock brakingEngine Control (VW)

Page 5: ECS642U: Embedded Systems Introduction William Marsh

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

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

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

Embedded System Concepts

… and related

Page 9: ECS642U: Embedded Systems Introduction William Marsh

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

I/O

• What do embedded computers do?– Actuators: open, close, start, stop

– Sensors: temperature, vision, touch

Page 11: ECS642U: Embedded Systems Introduction William Marsh

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

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

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

Practical Work

H/W Overview

• ARM Cortex-M0+• MKL25Z128VLK4 Microcontroller• Freescale Freedom (FRDM-KL25Z) dev board

Page 15: ECS642U: Embedded Systems Introduction William Marsh

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

Board – MCU – CPU

Freescale Freedom Development Board

MKL25Z128VLK4 Microcontroller (MCU)

ARM Cortex-M0+

CPU

Page 17: ECS642U: Embedded Systems Introduction William Marsh

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

Inside an iPhoneEmbeddedProcessors

ApplicationProcessors

Page 19: ECS642U: Embedded Systems Introduction William Marsh

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

MCU – How Fast?

Page 21: ECS642U: Embedded Systems Introduction William Marsh

Claims for L Series MCU

Fast Cost

Power

Page 22: ECS642U: Embedded Systems Introduction William Marsh
Page 23: ECS642U: Embedded Systems Introduction William Marsh

Freescale KL2 MCU

Page 24: ECS642U: Embedded Systems Introduction William Marsh

Freedom Development Board

Page 25: ECS642U: Embedded Systems Introduction William Marsh

Target Board: FRDM-KL25Z

Page 26: ECS642U: Embedded Systems Introduction William Marsh

MCU Components

Page 27: ECS642U: Embedded Systems Introduction William Marsh

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

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

Multiplexed Pins

• Pins add to cost

• Each pin has multiple uses

• Pins must be configured

Page 30: ECS642U: Embedded Systems Introduction William Marsh

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

• Connect MCU pins to external devices

Freedom Board Headers

Page 32: ECS642U: Embedded Systems Introduction William Marsh

Development Software

Page 33: ECS642U: Embedded Systems Introduction William Marsh

Course Aims, Topics and Organisation

Page 34: ECS642U: Embedded Systems Introduction William Marsh

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

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

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

2 Short Written Exercises (5%)

• Exam practice• Not timed• Submit on QMPlus

Page 38: ECS642U: Embedded Systems Introduction William Marsh

Books and Resources

• Books

• C programming resources• Documentation from

– ARM– Freescale

Page 39: ECS642U: Embedded Systems Introduction William Marsh

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

Summary

• Embedded systems– Inside a system– Reacting to events in real-time

• Course includes practical work