45
Lecture 1, Slide-1 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger Embedded Systems and Software Artist's concept of Mars Exploration Rover. Courtesy NASA Lecture 1: Introduction

55:036 Embedded Systems and Systems Softwares-iihr64.iihr.uiowa.edu/MyWeb/Teaching/ECE3360_2016/Lectures/... · Lecture 1, SlideA. Kruger Embedded Systems and Software, ECE:3360

  • Upload
    others

  • View
    19

  • Download
    0

Embed Size (px)

Citation preview

Lecture 1, Slide-1 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Embedded Systems and Software

Artist's concept of Mars Exploration Rover. Courtesy NASA

Lecture 1: Introduction

Lecture 1, Slide-2 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Organizational

• Class Website (be sure to check it often):

• http://s-

iihr64.iihr.uiowa.edu/MyWeb/Teaching/ECE3360_2016/Ind

ex.php

• Syllabus: see class website under “Resources”

• Reference text and development board

First lab: assemble teams, purchase

Kit A from Electronic Shop, build and

test the development board.

Lecture 1, Slide-3 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Organizational

• There are 2 T.A.s and they will hold office hours in the lab.

• The labs are located in 2244 SC

• There are six labs, 2 – 3 weeks in duration

– Labs have a pre-lab and post-lab component

– Labs overlap

– T.A.s must sign off on labs

• There is also larger project with in-class demonstration at the

end of the semester

• Labs and project will count 50% towards the course grade

• Students work in teams of two

– Think carefully about who would make a good lab partner

– We can also assign a partner for you

• In this class, students commonly get into trouble because they

underestimate the time it takes to complete labs

Lecture 1, Slide-4 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Organizational

• No scheduled lab times (except Lab 1)

– You may use the lab any time there an open slot (24 x 7)

– Access via key card

– T.A.s will hold office hours in lab

• Pre-and post lab check off

– Students work in teams.

– However, checkoff is individually. When ready to check off, print

a check off sheet, find a T.A. and be prepared to answer pertinent

and in-depth questions

– Late check off are penalized by 10% per day

Lecture 1, Slide-5 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Office Hours & Duties

• T.A.s will hold office hours in lab. Their responsibilities

are

– Help students with equipment.

– Answer general, conceptual questions

– Check off labs and assign lab grades

• T.A.s will not/can not

– Will not help debug code beyond simple troubleshooting

– Can not reset time stamps for penalties for late lab reports

• My office hours and contact information are on the class

website will be on the class website

Lecture 1, Slide-6 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Exams & Grades

• No homework

• One midterm exam (just before Spring Break)

• One final exam, focusing on material covered in latter

part of class

• Grade Calculation

– Better of midterm exam, final exam scores: 25%

– Poorer of midterm exam, final exam scores: 20%

– Labs: 35% Project: 20%

– Impromptu class quiz – 5%

• Exam details

– No redo exam

– Open book, open notes

• A sample exam will be posted on the class website

Lecture 1, Slide-7 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

The First Lab

• Activities – Learn how to solder

– Assemble development board

– Assemble a supplied program and load that into the development board

– Make small changes

– Write and submit the first lab report

• Each team: purchase a Kit A from CoE Electronics Shop

• The Electronics Shop technicians will conduct introductory sessions on Thursday and Friday afternoons. – Soldering skills

– Tips for board assembly and testing

• See class website/Labs/Lab1 for session times

• There is not a signup for the lab – just show up

Lecture 1, Slide-8 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

What is a Computer?

• Acknowledgement: the bulk of the material in this lecture

is adapted from:

Embedded System Design– A Unified Hardware/Software

Introducton, by Frank Vahid and Tony Givargis, John Wiley &

Sons Inc., 2002

Lecture 1, Slide-9 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

What is a Computer?

• Acknowledgement: the bulk of the material in this lecture

is adapted from:

Embedded System Design– A Unified Hardware/Software

Introducton, by Frank Vahid and Tony Givargis, John Wiley &

Sons Inc., 2002

• Most of us think of “desktop” computers

– PC’s, Laptops

– Servers, Mainframes

• But, there is another kind of computing system that is far

more common: embedded systems

Lecture 1, Slide-10 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Computers are in here...

Embedded Systems

• Hard to define Embedded Computing System precisely

• Computing systems embedded within electronic devices

• Nearly any computing system other than a desktop

computer, mainframe, server “traditional computers”

• Billions of units produced yearly, versus millions of

desktop units

• Perhaps 50 per household and per automobile

and here…

and here… and many other places…

Lecture 1, Slide-11 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Embedded Systems are Everywhere

Picture is from the cover of Embedded Systems Design, A Unified Hardware/Software Approach, by Frank

Vahid and Tony Givargis

Lecture 1, Slide-12 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Anti-lock brakes

Auto-focus cameras

Automatic teller machines

Automatic toll systems

Automatic transmission

Avionic systems

Battery chargers

Camcorders

Cell phones

Cell-phone base stations

Cordless phones

Cruise control

Curbside check-in systems

Digital cameras

Disk drives

Electronic card readers

Electronic instruments

Electronic toys/games

Factory control

Fax machines

Fingerprint identifiers

Home security systems

Life-support systems

Medical testing systems

Modems

MPEG decoders

Network cards

Network switches/routers

On-board navigation

Pagers

Photocopiers

Point-of-sale systems

Portable video games

Printers

Satellite phones

Scanners

Smart ovens/dishwashers

Speech recognizers

Stereo systems

Teleconferencing systems

Televisions

Temperature controllers

Theft tracking systems

TV set-top boxes

VCR’s, DVD players

Video game consoles

Video phones

Washers and dryers

A “Short List” of Embedded Systems

Today, almost all nontrivial electronic systems have at least one embedded processor

Lecture 1, Slide-13 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Embedded Systems vs. Desktop Computing

• Most Embedded Systems are single-functioned

– Executes a single program, repeatedly

• Generally, Embedded Systems are tightly-constrained

– Low cost, low power, small, fast, etc.

• Most Embedded Systems are reactive and real-time

– Continually react to changes in the system’s environment

– Must compute results in “real-time” as opposed to “batch” or

“off-line”

Lecture 1, Slide-14 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Microcontroller

CCD preprocessor Pixel coprocessor

A2D

D2A

JPEG codec

DMA controller

Memory controller ISA bus interface UART LCD ctrl

Display ctrl

Multiplier/Accum

Digital camera chip

lens

CCD

An Embedded System Example: Digital Camera

Imaging pipeline

Other embedded system in digital camera: focus (motors)

Lecture 1, Slide-15 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Embedded Design Challenge: Optimizing Design Metrics

• Obvious design goal:

– Construct an implementation with desired functionality

• Key design challenge:

– Simultaneously optimize numerous design metrics

• Design metric

– A measurable feature of a system’s implementation

– Optimizing design metrics is a key challenge

Lecture 1, Slide-16 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Embedded Systems Design Metrics

• NRE cost (Non-Recurring Engineering cost)

– One-time monetary cost of designing the system

• Unit cost

– Monetary cost of manufacturing each copy of the system,

excluding NRE cost

• Size

– Physical space required by the system

• Performance

– Execution time or response time of the system

• Memory

– Amount of memory required to hold the program and data

• Power

– Amount of power consumed by the system

Lecture 1, Slide-17 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Embedded Systems Design Metrics

• Flexibility

– Ability to change functionality without incurring heavy NRE cost

• Time-to-prototype

– Time needed to build a working version of the system

• Time-to-market (TTM)

– Time required to develop a system to the point that it can be

released and sold to customers

• Maintainability

– Ability to modify the system after its initial release

• Robustness

– System stability and reliability

• Safety

– Assurance that the system will not expose people to dangers

Lecture 1, Slide-18 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Design Metrics are Often at Odds

• Expertise with both software and hardware is needed to

optimize design metrics

• Not just a hardware or software expert, as is common

• A designer must be comfortable with various

technologies in order to choose the best for a given

application and constraints

Microcontroller

CCD preprocessor Pixel coprocessor A2D

D2A

JPEG codec

DMA controller

Memory controller ISA bus interface UART LCD ctrl

Display ctrl

Multiplier/Accum

Digital camera chip

lens

CCD

Software Hardware

Lecture 1, Slide-19 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Time-to-Market (TTM): Critical Design Metric

• Time required to develop a product to the point it can be

sold to customers

• Market window

– Period during which the product would have highest sales

• Average time-to-market constraint is about 8 months

• Delays can be costly

Lecture 1, Slide-20 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

NRE and Unit Cost Metrics

• Costs: – Unit cost: the monetary cost of manufacturing each copy of the

system, excluding NRE cost

– NRE cost: one-time monetary cost of designing the system

– total cost = NRE cost + Unit cost × # of units

– per-product cost = total cost / # of units

– = (NRE cost / # of units) + unit cost

Example

– NRE = $2000, unit = $100

– For 10 units

– Total cost = $2,000 + 10×$100 = $3,000

– Per-product cost = $2,000/10 + $100 = $300

Amortizing NRE cost over the units

results in an additional $200 per unit

Lecture 1, Slide-21 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

NRE and Unit Cost Metrics

• Compare technologies by costs -- best depends on

quantity

– Technology A: NRE=$2,000, unit=$100

– Technology B: NRE=$30,000, unit=$30

– Technology C: NRE=$100,000, unit=$2

• Must also consider Time-To-Market

$0

$40,000

$80,000

$120,000

$160,000

$200,000

0 800 1600 2400

A B C

$0

$40

$80

$120

$160

$200

0 800 1600 2400 Number of units (volume)

A B C

Number of units (volume)

tota

l cos

t (x1

000)

per

prod

uct c

ost

Lecture 1, Slide-22 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

The Performance Design Metric

• Widely-used performance measure, widely-abused

– Clock frequency, instructions per second – not good measures

– Digital camera example – a user cares about how fast it

processes images, not clock speed or instructions per second

• Latency (response time)

– Time between task start and end

– e.g., Camera’s A and B process images in 0.25 seconds

• Throughput

– Tasks per second, e.g. Camera A processes 4 images per second

– Throughput may involve more than just latency due to

concurrency, e.g., Camera B may process 8 images per second

(by capturing a new image while previous image is being stored).

• Speedup of B over A = B’s performance / A’s

performance

– Throughput speedup = 8/4 = 2

Lecture 1, Slide-23 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Embedded Processor Technologies

• General-Purpose

• Single-Purpose

• Application-Tailored

Lecture 1, Slide-24 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

General-Purpose Processor

• Programmable device used in a variety of applications – Also known as “microprocessor”

• Features – Program memory

– General data path with large register file and general ALU

• User benefits – Low time-to-market and NRE

costs

– High flexibility

• Intel “Pentium” the most well-known, but there are hundreds of others

Data Path Controller

IR PC

Register

file

General

ALU

Program memory

Assembly code for:

total = 0

for i =1 to

Control

logic and State

register

Data

memory

Lecture 1, Slide-25 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Single-Purpose Processor

• Digital circuit designed to

execute exactly one

program

– a.k.a. coprocessor, accelerator

or peripheral

• Features

– Contains only the components

needed to execute a single

program

– No program memory

• Benefits

– Fast

– Low power

– Small size

Data Path Controller

Control logic

State register

Data

memory

index

total

+

Lecture 1, Slide-26 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Application-Tailored Processors

• Programmable processor

optimized for a particular class

of applications having common

characteristics

– Compromise between general-

purpose and single-purpose

processors

• Features

– Program memory

– Optimized data path

– Special functional units

• Benefits

– Some flexibility, good performance,

size and power

Data Path Controller

IR PC

Register

Custom

ALU

Program memory

Assembly code for:

total = 0

for i =1 to

Control

logic and State

register

Data

memory

Lecture 1, Slide-27 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Key Player in Embedded Design: Microcontroller

• Compromise between general-purpose and application-

tailored processor

• Simple processor architecture

– Reduced instruction set (RISC) and functionality

– Small data path (often only 4 or 8 bits vs. 32 or 64 bits for typical

general purpose processor)

• On-board memory (volatile and non-volatile)

• Multiple on-chip devices to support embedded

applications

– Timers

– Digital and I/O serial I/O

– Support for various interfacing protocols—e.g. I2C

• Available in many different configurations, performance

levels, etc.

Lecture 1, Slide-28 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Processor Clock Peripherals Bus Width MIPS Power Trans. Price

General Purpose Processors

Intel PIII 1 GHz 2x16 K

L1, 256K

L2, MMX

32 ~900 97W ~7M $900

IBM

PowerPC

750X

550 MHz 2x32 K

L1, 256K

L2

32/64 ~1300 5W ~7M $900

MIPS

R5000

250 MHz 2x32 K

2 way set assoc.

32/64 NA NA 3.6M NA

StrongARM

SA-110

233 MHz None 32 268 1W 2.1M NA

Microcontrollers

Intel

8051

12 MHz 4K ROM, 128

RAM, 32 I/O,

Timer, UART

8 ~1 ~0.2W ~10K $7

Motorola

68HC811

3 MHz 4K ROM, 192

RAM, 32 I/O,

Timer, WDT, SPI

8 ~.5 ~0.1W ~10K $5

Digital Signal Processors

TI C5416 160 MHz 128K, SRAM, 3 T1

Ports, DMA, 13

ADC, 9 DAC

16/32 ~600 NA NA $34

Lucent

DSP32C

80 MHz 16K Inst., 2K Data,

Serial Ports, DMA

32 40 NA NA $75

Sources: Intel, Motorola, MIPS, ARM, TI, and IBM Website/Datasheet; Embedded Systems Programming, Nov. 1998

Processor Comparison

Lecture 1, Slide-29 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

The Advantages of Microcontrollers

• Low cost due to high volume production

• Low “chip count” due to integrated on-board features

• Good development tools and environments

• Extensive product families allow tailoring of processor to

system design metrics

• Short product design cycles (compared to custom

hardware design).

• Compatible with hardware/software co-design

– Many microcontrollers are available as “VHDL Cores” for

integration into a custom VLSI chip

Lecture 1, Slide-30 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Many/Most Embedded Applications Require Modest

Computational Power

Source: Renesas

Lecture 1, Slide-31 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

A Low End Microcontroller: ATtiny25/45/85

Pinout for ATtiny25/45/85

PDIP

SOIC

Up to 20 MHz clock

$1, $2 in Large quantities Vcc for some variants as low as 1.8 V Isupply at 1 MHz, 1.8 V: 300 μA

Most pins have multiple uses

Built-in 10-bit A/D

Internal Oscillator

Built-in Analog Comparator

In-Circuit

Programming (ISP)

Lecture 1, Slide-32 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

A Low End Microcontroller: ATtiny25/45/85

Block Diagram of ATtiny25/45/85

Lecture 1, Slide-33 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

A Low End Microcontroller: ATtiny25/45/85

ATtiny25/45/85 Features

Lecture 1, Slide-34 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

A Low End Microcontroller: ATtiny25/45/85

ATtiny25/45/85 Features

Lecture 1, Slide-35 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

A Low End Microcontroller: ATtiny25/45/85

ATtiny25/45/85 Features

Lecture 1, Slide-36 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

A Low End Microcontroller: ATtiny25/45/85

ATtiny25/45/85 Features

Lecture 1, Slide-37 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

A Low End Microcontroller: ATtiny25/45/85

ATxmega128A4 Features

Lecture 1, Slide-38 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

A Low End Microcontroller: ATtiny25/45/85

ATxmega128A4 Features

Lecture 1, Slide-39 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

A Low End Microcontroller: ATtiny25/45/85

ATxmega128A4 Features

Lecture 1, Slide-40 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

A High-End Microcontroller: ATxmega128A4

Block Diagram of ATxmega128A4

Lecture 1, Slide-41 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

A High-End Microcontroller: ATxmega128A4

ATxmega128A4 Features

Lecture 1, Slide-42 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

“Smaller” Microntroller: ATmega48P/88P/168P/328P

Pinout for ATmega48P/88P/168P/328P

Lecture 1, Slide-43 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

“Smaller” Microntroller: ATmega48P/88P/168P/328P

Block Diagram for ATmega48P/88P/168P/328P

Lecture 1, Slide-44 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger

Some ATmega48P/88P/168P/328P Features

• Clock rate up to 20 MHz

• Up to 20 MIPS throughput at 20 MHz

• 4/8/16/32K Bytes of In-System Self-Programmable Flash Program Memory

• 512/1K/1K/2K Bytes Internal SRAM

• 256/512/512/1K Bytes EEPROM

• 35 digital I/O

• 4 timers

• 2 PWM/Capture/Compare modules

• UART for serial I/O

• 6-channel 10-bit ADC in PDIP Package

• Interrupt sources

• Cost: Approx $2.30 in quantity

Lecture 1, Slide-45 Embedded Systems and Software, ECE:3360. The University of Iowa, 2016 A. Kruger