43
Embedded System Design Stephen A. Edwards Columbia University Spring 2013

Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Embed Size (px)

Citation preview

Page 1: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Embedded System Design

Stephen A. Edwards

Columbia University

Spring 2013

Page 2: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Spot the Computer

Page 3: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Embedded Systems: Ubiquitous Computers

iPhone Laser Keyboard Nikon D300 Video Watch

GPS Playstation 3 PC Keyboard SD Card

Page 4: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Is Your Current Embedded Project...

Real-time

Networked

Ruggedized

Battery-powered

Wireless

0% 15% 30% 45% 60% 75%

Source: 2009 Embedded Market Study

Page 5: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Is Your Current Embedded Project...

Real-time

Networked

Ruggedized

Battery-powered

Wireless

0% 15% 30% 45% 60% 75%

Source: 2009 Embedded Market Study

Page 6: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Digital Camera Block Diagram

Page 7: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Design An Optimal Device that MeetsConstraints On

Price Functionality

Performance Size

Power Time-to-market

Maintainability Safety

Page 8: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Embedded System Technologies

Integrated Circuits

Processing elements

Design tools

Page 9: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

IC Technology

1947: First transistor (Shockley, Bell Labs)

1958: First integrated circuit (Kilby, TI)

1971: First microprocessor (4004: Intel)

Today: eight wire layers, 45 nm features

Page 10: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Moore’s Law: Transistors per chip

1970 1980 1990 2000 2010

1k

10k

100k

1M

10M

100M

1G

10G

≈ 1.5× /

year

“The complexity for minimum com-ponent costs has increased at arate of roughly a factor of two peryear. Certainly over the short termthis rate can be expected to con-tinue, if not to increase.”

— Gordon Moore, 1965

Source: Intel/Wikipedia

Page 11: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

$1000 Buys You This Many Cycles per Second

ElectromechanicalRelays

TubesTransistors

Integrated Circuits

1900 1920 1940 1960 1980 2000

10−4

10−2

100

102

104

106

108

Source: Ray Kurzweil, The Age of Spiritual Machines

Page 12: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

1918 Sears Roebuck Catalog

About $100 in today’s dollars.From Donald Norman, The Invisible Computer, 1998.

Page 13: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

What Percentage of Time Do You Spend...

Developing Specifications

Conceptual Design

Detailed Design

Simulation

Testing/Debugging

Prototyping

Sending to production

Documentation/meetings

0% 5% 10% 15% 20% 25%

Source: 2009 Embedded Market Study

Page 14: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

What Percentage of Time Do You Spend...

Developing Specifications

Conceptual Design

Detailed Design

Simulation

Testing/Debugging

Prototyping

Sending to production

Documentation/meetings

0% 5% 10% 15% 20% 25%

Source: 2009 Embedded Market Study

Page 15: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

If You Could Improve One Thing...

Debugging Tools

Schedule

Programming Tools

Engineering Team

Interfaces

Microprocessor

Other hardware

Operating System

IDE

0% 5% 10% 15% 20% 25% 30%

Source: 2009 Embedded Market Study

Page 16: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

If You Could Improve One Thing...

Debugging Tools

Schedule

Programming Tools

Engineering Team

Interfaces

Microprocessor

Other hardware

Operating System

IDE

0% 5% 10% 15% 20% 25% 30%

Source: 2009 Embedded Market Study

Page 17: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

If Your System Has More Than One Processor,Does It Use...

Multiple different chips

Multiple identical chips

Single chip, identical cores

Single chip, different cores

0% 15% 30% 45% 60%

Source: 2009 Embedded Market Study

Page 18: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

If Your System Has More Than One Processor,Does It Use...

Multiple different chips

Multiple identical chips

Single chip, identical cores

Single chip, different cores

0% 15% 30% 45% 60%

Source: 2009 Embedded Market Study

Page 19: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Does Your Current Project Contain FPGAs?

45% Yes

55% No

Source: 2009 Embedded Market Study

Page 20: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Does Your Current Project Contain FPGAs?

45% Yes

55% No

Source: 2009 Embedded Market Study

Page 21: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Why Won’t Your Next Project Use FPGAs?

Don’t need them

Too expensive

Too power-hungry

Hard to use

Too slow

Too small

Unreliable

Don’t Know

0% 15% 30% 45% 60% 75%

Source: 2009 Embedded Market Study

Page 22: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Why Won’t Your Next Project Use FPGAs?

Don’t need them

Too expensive

Too power-hungry

Hard to use

Too slow

Too small

Unreliable

Don’t Know

0% 15% 30% 45% 60% 75%

Source: 2009 Embedded Market Study

Page 23: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Your Nemesis: The Altera DE2

Page 24: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

DE2 Peripherals

Page 25: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Class Structure

Three Introductory Labs: 2 weeks each

1. Access, modify, and display memory in VHDL2. An Ethernet chat client (software only)3. Either

É an FM audio synthesizer; orÉ a video bouncing ball.

The project: Design-your-own

Page 26: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Custom Project Ideas

Broadly: C + VHDL + peripheral(s)

Video game (e.g., Pac-Man)

Digital Video Project - Stephen Edwards Block Diagram

TDA8708VideoADC

TDA8708VideoADC

Luminance/Composite In

Chrominance In

SAA9051Digital

MultiStandardDecoder

8

8

SAA9057ALine-Locked

Clock Generator

7

4

MUX

7

’374s ’374s

SAA7192Digital

ColorspaceConverter

8

8

8

Bt101VideoDAC

Red Analog OutGreen Analog OutBlue Analog Out

DSP 56001Digital Signal

Processor

Data

Address

VRAM256K X 24

X 2

24

4

LUMM

UVM

MUX

LUMO

UVO

LUML

UVL

LUMH

UVH

12

12

Control Block

I2C Bus

RS-232 PORT Video effects processor

Digital photo frame

Very fancy digital clock

Page 27: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

More Ideas

Digital tone control

Real-time audio spectrum analyzer

Internet radio

Speech Synthesizer

Page 28: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Projects from 2004

MIDI synthesizer

Line-following robot with video vision

SAE student vehicle telemetry system

Stereo video vision system

Internet video camera

Pac-man-like video game

Page 29: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Projects from 2005

Scrabble Timer

Scorched Earth

SAE Auto Shifter

Internet Radio

Broadcaster

3D Maze Game

VoIP Telephone

JPEG decoder

Rally-X video

game

Page 30: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Projects from 2006

Video-guided Lego Robot

360◦ camera de-warper

Videogame with accelerated line-drawing

Voice recorder

JPEG decoder

Page 31: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Projects from 2007

Pac-Edwards

Button Hero Videogame

Digital Picture Frame: SD card with JPEG to

VGA

Networked game of Clue

Conway’s Game of Life (60 gps)

Page 32: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Projects from 2008

Real-time ray tracer

Video-camera-controlled pool game

Real-time video decryption

WiiMote-controlled maze game

Page 33: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Projects from 2009

Lightsaber video overlay

Networked Video Phone

Sound-controlled videogame

Visual object tracker

Page 34: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

The Three Main Challenges of EmbeddedSystems

É Coping with Real-world Sensor DataÉ Algorithm DesignÉ Implementation Details

Page 35: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

What Does this Circuit Do When You Press theSwitch?

GND

100K

Vcc

Vout

Page 36: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

What Does this Circuit Do When You Press theSwitch?

GND

100K

Vcc

Vout

Page 37: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Inside a Pushbutton Switch

A – View of moveablecontact mounted onback side of actuator

ThermoplasticActuator Button Thermoplastic

Case and Cover

StainlessSteel Spring

Terminals

Mounting Posts

Shorting Bar

Source: Cherry CS series data sheet

Page 38: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Raw Data from a CCD (zoomed in)

Page 39: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Corrected Image (zoomed in)

Page 40: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Correcting Data from CCDs

Raw

Dark Frame

Flat Field

Bias

=

Color−→Temp.−→

Exposure−→

Page 41: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Correcting Data from CCDs

Raw

Dark Frame

Flat Field

Bias

=

Color−→Temp.−→

Exposure−→

Page 42: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Where Does This Noise Come From?

Digital camera sensors are remarkablysensitive.My high-end Nikon D300 has a 23.6 mm ×15.8 mm 12.3 megapixel CMOS sensorwhose pixels are 5.5 μm on a side. Wheneach pixel is sampled with the 12-bit A/Dconverter, the sensor efficiency is

ISO: LO 200 400 800 1600 3200G 7.1 5.5 2.7 1.3 0.65 0.33B 5.8 4.6 2.3 1.1 0.55 0.27R 4.7 4.5 2.2 1.1 0.54 0.26

The units: electrons per ADU (digital unit).

Emil Martinec, A comparison of the Nikon D300 and Canon 40Dsensors, 2007.

Page 43: Embedded System Design - Columbia Universitysedwards/classes/2013/4840/embedded-systems.pdfEmbedded Systems: Ubiquitous Computers iPhone Laser Keyboard Nikon D300 Video Watch GPS Playstation

Development Plan

1. Obtain some representative raw sensor data2. Develop an algorithmic prototype using your

favorite language (e.g., Java, C, Matlab)3. Plan how to implement it4. Implement while constantly testing