Embedded Systems

Post on 19-Feb-2016

221 views 1 download

Tags:

description

Lecture on Embedded Systems

Transcript of Embedded Systems

Embedded Embedded SystemsSystemsA Lecture Presented ByEngr. Gilbert R. Hufana

What are Embedded What are Embedded Systems?Systems?a special-purpose computer system

designed to perform one or a few dedicated functions

encompass a variety of hardware and software components that performs specific functions in host systems

It is usually embedded as part of a complete device including hardware and mechanical parts.

Its ApplicationIts ApplicationTelecommunications

◦Telephone switches◦Mobile phones◦Routers and bridges for networking

Consumer Electronics◦PDAs, MP3 players, mobile

phones…◦Digital cameras, DVP players…◦Household appliances…washing

machines, microwave oven etc.

Its Application…cont.Its Application…cont.Health and Medicine

◦Vital signs monitoring◦Electronic stethoscope◦Imaging (PET, MRI, CT)

Its Application…cont.Its Application…cont.Transportation systems

◦Internal guidance system and GPS in airplanes

◦Automatic 4W-drive cars◦Anti-lock braking system (ABS)◦Motor controllers◦Electronic Fuel Injection (EFI)

CharacteristicsCharacteristicsdesigned to do some specific task,

rather than be a general-purpose computer for multiple tasks

not always standalone devices◦consist of small, computerized parts within

a larger device that serves a more general purpose

program instructions written for embedded systems are referred to as firmware, and are stored in read-only memory or Flash memory chips.

FirmwareFirmwarea computer program that is

embedded in and controls a hardware device

Examples:◦BIOS in personal computers◦EPROM chips in digital music processors◦Timing and control system for washing

machines◦iPod’s control menus

User InterfacesUser InterfacesNo interface

◦Dedicated to only one taskGraphical User Interface (GUI)

◦resemble modern computer desktop operating systems.

The VNAThe VNA

MicrocontrollerMicrocontrollera special-purpose computera functional computer system-on-

a-chip (http://en.wikipedia.org/wiki/Microcontroller)◦Basically contains:

a processor core, memory, and programmable

input/output peripherals.

Basic Microcontroller Basic Microcontroller ArchitectureArchitecture

The CPU/MicroprocessorThe CPU/MicroprocessorInstruction interpreterA module of arithmetic and logic

functionsIR (Instruction Register)

◦Register inside the CPU where the fetched instruction is loaded

PC (Program Counter)◦Holds the address of the instruction

to fetched next

The Instruction CycleThe Instruction Cycle

HALT

Fetch Next Instruction

Fetch Cycle Execute Cycle

Execute Instruction

Check for Interrupt; Process Interrupt

START

Interrupts disabled

Interrupts enabled

Interrupt Cycle

Memory: RAM vs ROMMemory: RAM vs ROMRAM (Random Access Memory)

◦Volatile

ROM (Read-only Memory)◦Non-volatile

Types of ROMTypes of ROM1. PROM (Programmable ROM)

◦ Non-volatile and maybe written only once

◦ Writing process is performed electrically

2. EPROM (Erasable PROM)◦ Similar to PROM◦ Erasing is done by exposing the chip

to ultraviolet radiation◦ Holds data virtually indefinitely

Types of ROMTypes of ROM3. EEPROM (Electrically erasable PROM)

◦ Can be written into at any time without erasing prior contents

◦ Combines the advantage of flexibility and non-volatility

4. FLASH MEMORY◦ Intermediate to EPROM and EEPROM◦ Uses electrical erasing technology◦ Erases just blocks of the memory rather

than entire chip

CharacteristicsCharacteristics"embedded" inside some other

device (often a consumer product) so that they can control the features or actions of the product

dedicated to one task and run one specific program◦The program is stored in ROM (read-

only memory) and generally does not change.

……Characteristics stillCharacteristics stillLow-power devices

◦Battery operated; 50 milliwattshas a dedicated input device and

often (but not always) has a small LED or LCD display for output

small and low cost◦The components are chosen to

minimize size and to be as inexpensive as possible.

ruggedized

Programming Programming EnvironmentsEnvironmentsoriginally programmed only in

assembly language, but various high-level programming languages are now also in common use to target microcontrollers◦C – intermediate

Interpreter firmware is also available for some microcontrollers – BASIC Stamp

The BASIC StampThe BASIC StampA microcontroller with a small,

specialized BASIC interpreter built into ROM.

made by Parallax, Inc. has been quite popular with

electronics hobbyists since the early 1990s due to its low threshold of learning and ease of use (due to its simple BASIC language).

http://www.parallax.com

Technical SpecificationsTechnical SpecificationsA Microcontroller containing the

CPU, a built in ROM containing the BASIC interpreter, and various peripherals

Memory (a serial EEPROM)A clock, usually in the form

of a ceramic resonatorA power supplyExternal input and output

VersionsVersions

BASIC Stamp 1 (BS1)BASIC Stamp 2 (BS2), with six

sub-variants: ◦BS2e,BS2sx,BS2p24,BS2p40,BS2pe,B

S2pxJavelin StampSpin Stamp

BASIC Stamp 2p 24-Pin BASIC Stamp 2p 24-Pin ModuleModule$79.00 as of December 12, 2008Technical Specifications:

Processor Speed = 20 MHz Turbo Program Execution Speed = ~12,000

instructions/sec. RAM Size = 38 Bytes (12 I/O, 26 Variable) EEPROM (Program) Size = 8 x 2K Bytes, ~4,000

instructions I/O Pins = 16 +2 Dedicated Serial Voltage Requirements = 5 - 12 vdc Current Draw at 5V = 40 mA Run / 350 µA Sleep PBASIC Commands = 61 Size = 1.2"x0.6"x0.4"

Programming the BASIC Programming the BASIC StampStampYou program a BASIC Stamp

using the BASIC programming language.

If you already know BASIC, then you will find that the BASIC used in a Stamp is straightforward but a little stripped-down.

Standard BASIC Standard BASIC InstructionsInstructionsfor...next - normal looping

statement gosub - go to a subroutine goto - goto a label in the program

(e.g. - "label:") if...then - normal if/then decision let - assignment (optional) return - return from a subroutine end - end the program and sleep

Other Instructions…Other Instructions…Instructions having to do with I/O pins

◦Button, high, input, low etc.Instructions specific to the BASIC Stamp

◦Branch, debug, eeprom etc.Operators – Arithmetic, Logical and

Comparison◦+,-,*,/, and, or, not, xor, nand, =, <, >, <=,

etc.Variables are predefined but can be

changed

BASIC Stamp Starter KitBASIC Stamp Starter KitThe BASIC Stamp 1

Starter Kit includes a special BS1 Serial Adapter that allows you to program in the Windows environment.

Due to the small size (1.4"x.6"x.1") it's also perfect for fitting in tight applications.

Approx. $80.00

Things you can do with BSThings you can do with BSDigital clockDigital thermometerOthers…

Before Ending…Before Ending…Embedded systems development

is an interesting field in IT…◦It creates a lot of opportunities…◦It enhances one’s intuitiveness, logic

and creativity…◦It spawns a new dimension for higher

quality of living…I dare each one to converge for

the challenge…make a difference.

THANK YOU!!!THANK YOU!!!Embedded Systems: A Lecture