see 3223: microprocessors dr. izzeldin ibrahim mohamed p08-117/ vecad lab ext.: 36117, hp:...

48
SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: [email protected] Department of Microelectronics and Computer Engineering (MiCE) Faculty of Electrical Engineering Universiti Teknologi Malaysia Consultation: Tuesday 11:00 – 12:55 a.m. Thursday 11:00 – 12:55 a.m.

Upload: bryana-bissell

Post on 15-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

SEE 3223: MicroprocessorsDr. Izzeldin Ibrahim Mohamed

P08-117/ VeCAD LABExt.: 36117, HP: 0127363635

Email: [email protected]

Department of Microelectronics and Computer Engineering (MiCE)Faculty of Electrical Engineering

Universiti Teknologi Malaysia

Consultation:Tuesday 11:00 – 12:55 a.m.Thursday 11:00 – 12:55 a.m.

Page 2: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

MODULE 0

IntroductionPlasticcase

Pins

Chip

Page 3: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Microprocessor SEE3223

AimThis subject introduces the principle and the usage of microprocessor. Few topics that are emphasized are processor architecture, assembly language and basic interfacing in a microprocessor-based systems.

Learning OutcomesAt the end of this course, students will be able to : Describe and differentiate all the component of microprocessor-

based systems. Analyze and design AVR Atmega32 assembly language programs. Analyze and design AVR Atmega32 microprocessor systems. Work with AVR Studio and communicate effectively in a team to

solve complex AVR Atmega32 design problems.

Page 4: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

SEE3223 Microprocessor Systems

What’s in this course:– Assembly language programming– Microprocessor concepts– Hardware interfacing

Pre-Requisites– Number representation, coding, registers, state machines– Realization of simple logic circuits– Integrated circuit technologies– Designing with MSI components– Flip-Flops– Counters and sequential MSI components– Register transfer logic

Page 5: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Course Policy

Attendance is compulsory.

You are responsible for whatever is taught in the lecture. If you miss a class, it is your responsibility to find out about assignment, quizzes and exam from elearning.

Punctuality is expected.

Makeup quizzes will not be given except in the case of actual emergencies with written evidence.

You are encouraged to collaborate (not copy) on assignment problems with your "study buddies.”

Page 6: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Grading Policy

Assessment Breakdown:

– 4 Quizzes x 10% = 30%

– 1 Group Assignment = 20%

– Final = 50%

Page 7: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Material

Lecture notes

Will be posted

Textbooks

Muhammad Ali Mazidi and, Sarmad Naimi and Sepehr Naimi (2010), The AVR Microcontroller and Embedded Systems: Using Assembly and C, 1st Ed., Prentice Hall.

Page 8: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

MODULE 1

Microprocessor-Based Systems

Plasticcase

Pins

Chip

Page 9: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Microprocessor-Based Systems

Aims

– To review the main elements of a microprocessor system.

Intended Learning Outcomes

– At the end of this module, students should be able to:

• Define and explain important terms associated with both hardware and software elements of a microprocessor system

• Tell the difference between general purpose computing and embedded computing

• List down the major components inside a computer & processor• Tell the difference between computer, processor, microprocessor and

microcontroller• Explain instruction execution cycles of a generic microprocessor

Page 10: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Computer Data Processing

Data Storage

What is Computer ?

Page 11: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Basic Functions of Computer

• Data Processing• Data Storage• Data Movement• Control

Page 12: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Microprocessor-Based Systems

20102011-I 12

Whenever the word microprocessor is mentioned, it conjures up a picture of a desktop or laptop PC running an application such as a word processor or a spreadsheet.

While this is a popular application for microprocessors, it is not the only one and the fact is most people use them indirectly in common objects and appliances without realizing it. Without the microprocessor, these products would not be as sophisticated or cheap as they are today.

Page 13: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Microprocessor-Based Systems

20102011-I 13

Computing systems are everywhere. Its probably no surprise that millions of computing systems are built every year destined for desktop computers (Personal Computers, or PCs), workstations, mainframes and servers. What may be surprising is that billions of computing systems are built every year for a very different purpose: they are embedded within larger electronic devices, repeatedly carrying out a particular function, often going completely unrecognized by the devices user. Creating a precise definition of such embedded computing systems, or simply embedded systems, is not an easy task.

Page 14: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Computer Classifications

• Classification of computers:– Servers:

• Big, expensive, available 24x7 (read “24 by 7” or 24 hours a day, 7 days a week. Mainframes are old servers made by IBM.

– Desktops: • computers on your desk

– Laptops: • computers you carry in your bag

– PDA (personal digital assistants): • computers you carry in your pocket

– Embedded systems: • computers that don’t look like computers!

• An embedded system is a type of computer

Page 15: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

What is an Embedded System?

20102011-I 15

An embedded system is a microprocessor-based system that is built to control a function or range of functions and is not designed to be programmed by the end user in the same way that a PC is.

SOFTWARE PROGRAM

#include <16f876a.h>#use delay (clock=20000000)#byte PORTB=6main(){set_tris_b(0);portb=255; //decimaldelay_ms(1000);portb=0x55; //hexadecimaldelay_ms(1000);portb=0b10101010; //binarydelay_ms(500);}

System

An embedded system is a special-purpose computer system designed to perform certain dedicated functions. It is usually embedded as part of a complete device including hardware and mechanical parts

Page 16: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Embedded System: Example

20102011-I 16

Embedded microprocessors are more deeply ingrained into everyday life than any other electronic circuit that is made. A car may have over 50 microprocessors controlling functions such as the engine through engine management systems, brakes with electronic anti-lock brakes, transmission with traction control and electronically controlled gearboxes, safety with airbag systems, electric windows, air-conditioning and so on.

Page 17: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Other Processors in Embedded Systems

• Embedded Controllers:– More powerful (32 bits) than microcontrollers (8 bits)– Normally contains only processor and input/output, memory is

external

• Digital Signal Processors:– Embedded processors optimized for digital signal processing– Commonly found in hand-phones, modems, communications systems

• Graphics Processors:– Very powerful processors found in graphics cards of workstations

• Programmable Logic Controllers:– Microprocessor boards usually found in industrial applications

Page 18: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

General Purpose Computing vs Embedded Systems

General Purpose EmbeddedIntended to run a fully general set of applications

Runs a few applications often known at design time

End-user programmable Not end-user programmable

Faster is always better Operates in fixed run-time constraints, additional performance may not be useful/valuable

Differentiating features:• Speed (need not be fully

predictable)• Software compatibility• Cost (eg RM3k vs RM5k per

laptop)

Differentiating features:• Power• Cost (eg RM2 vs RM2.50)• Size• Speed (must be predictable)

Page 19: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

To design a µP System, we must know…

• Fundamentals:– What’s inside a computer– What’s inside a processor

• Programming:– What happens in the processor when it’s running a program– What do we need to write a program– How to create a program– How to run a program– How to fix a program error

• Hardware design:– Timing diagrams– Interfacing with other chips

Page 20: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

20112012-I 20/Module 1

A Computer System – Simplified View

Page 21: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Control bus

A Computer System – Simplified View

Address bus

Data bus

An embedded system also has the same structure but at a smaller size

CPU Memory Input/Output

Stores and retrieves data

Controls the operation of the computer Performs its data processing functions

Provides communication

among CPU, main memory and I/O

Moves data between the computer

and its external environment

Page 22: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

What is Microprocessor ?

CPU

Central Processing Unit (CPU): Control the

operation of the computer and performs its data

processing functions; often simply referred to as

PROCESSPR

Page 23: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Processor or Central Processing Unit (CPU)

Unit kawalan

ALU

Menyimpan maklumat

Mengawal

Memproses

Daftar

Bas kawalan

Ba

s d

ala

ma

n

Bas data

Bas alamat

Page 24: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Control Unit & Instruction Decoder

Arithmetic/Logic Unit

Registers

To synchronize and control the overall operation of the P system

To decode instruction and pass the necessary control signals to CU

Processor (CPU): Control Unit (CU)

The Central Processing Unit (or P)

To perform the arithmetic and logical operations within the CPU

A set of internal storagelocations within the CPU

Page 25: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Control & Instruction Registers

Program Counter

User-Visible Registers

Instruction Register

...

General-Purpose Reg.

Address Register

Data Register

Flag Register...

Processor (CPU): Registers

Page 26: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Microprocessor – Basic concept

Microprocessor, by-itself, completely useless – must have external peripherals toInteract with outside world

CPU

Control bus

16-bit / 32-bit / 64-bit wide

Timing signals, ready signals,interrupts etc

bidirectional8-bit / 16-bit / 32-bit / 128-bit

Data bus

Address bus

Page 27: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Microprocessor – Basic concept

BootROM

Used at startup

Instruction(program)

ROM

DataRAM

Trans-ducers

KeyboardScreenUART

Parallelinterface

etc

CPU

Address

Control

Data

Microprocessor, by-itself, completely useless – must have external peripherals toInteract with outside world

Page 28: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Memory

Memory Address-1

Memory Address-2

Memory Location-nMemory Address-n

Memory Location-1

Memory Location-2

5 6 7 81 2 3 4

1 byte = 8-bit data 1 word= 2 bytes

1 double = 2 words

Number of addresses 2N (where N is an integer)

Page 29: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Memory Devices• Read-Only Memory

– Non-volatile memory: contents is retained even without power– In embedded systems, used to store application programs and test routines– Contents can be set by fixing it during manufacturing or “burning” it using a

programming device– Common types include MROM, PROM, EPROM and flash memory– Erasable types can only be rewritten a fixed number of times

• Random Access Memory– Contents lost without power (volatile memory)– Used to store temporary data. In embedded system, very little RAM is

required. Some systems don’t even have RAM at all!– No limit to number of writes the device can handle– Fast writes (unlike EPROM/EEPROM)– Two major types are SRAM and DRAM

Page 30: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Data & Address Buses

015

224-1= 8M locations

Address bus 24 bits

0x000000

0xFFFFFF

24-bit address bus

16-bit data bus

Data bus 16 bits

CPU Memory

1. Smallest transferable amount of data from memory to CPU (and vice versa) is one byte.

2. Each byte has a unique location or address.

3. The address of each byte is written in hexadecimal (hex). For AVR, the prefix ‘0x’ means a hex value.

4. The range of addresses accessible by the processor is the memory space. (Limited by the size of the address bus).

5. The Atmega32 (and many other AVR models) does not have direct support for an external memory interface.

Page 31: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

20112012-I 31/Module 1

Microcontroller – Basic concept

Page 32: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Microcontroller – Basic concept

Microcontroller - put a limited amount of most commonly used resources inside one chip

BootROM

ProgramROM

DataRAM

Trans-ducers

Some I/OCPU

Address

Control

Data

Page 33: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Microprocessor vs Microcontroller

• Microcontroller:

– A chip that contains all the components of a computer – processor, memory and input/output

– Less flexibility– Less component count in

system– Less powerful

• Microprocessor:

– A chip that contains only the processor

– Need other chips to make a working system

– More flexible– Can have very few I/O or

many I/O devices using the same processor chip

No matter what is the system size, the most important component is still the processor.

Page 34: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Software

• Computer software– Computer programs are known as software

• Program: – Sequence of instructions that perform a task

• Instruction: – The simplest operation performed by the processor– Think of it as a note coming from a musical instrument

• How the computer works:– Fetch an instruction from memory– Decode the instruction– Execute the instruction– Repeat

Page 35: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Machine & Assembly Language

• Machine instruction– A sequence of binary digits which can be executed by the processor, e.g. 0001 1011.– Hard to understand for human being

• Assembly language– An assembly program consists of assembly instructions– An assembly instruction is a mnemonic representation of a machine instruction e.g.

MUL may stand for “multiply”– Assembly programs must be translated into object code before it can be executed --

translated by an assembler.– Assemblers can be of two types: cross assembler and native assembler.– Cross assembler runs on one computer and generates machine instructions that will

be executed by another computer that has different instruction set, e.g. freeware ASM68K.

– Native assembler runs and generates instructions for the same computer. – Drawbacks of assembly programs are:

• dependent on hardware organization, difficult to understand long programs, low programmer productivity

Page 36: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

High-level language (HLL)

• High-Level Language

– Syntax of a high-level language is similar to English

– A translator is required to translate the program written in a high-level language into object code -- done by a compiler.

– There are cross compilers that run on one computer but translate programs into machine instructions to be executed on a computer with a different instruction set.

– Main drawback is slower execution speed of the machine code obtained after compiling an HLL program.

– However, C language has been extensively used in microcontroller programming in industry.

Page 37: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Instruction Cycle (Fetch-Execute)

• The processor executes instructions one-by-one according to the sequence found in memory

• Everything is controlled by, what else, the control unit in the CPU.• To execute an instruction, the processor must fetch it from

memory.• The complete steps the processor takes to execute one instruction

is the instruction cycle or the fetch-execute cycle

Fetch Execute

Page 38: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Instruction Cycle Details• On program start:

0. Load the program counter (PC) with the address of the first instruction

• Fetch phase:1. Read the instruction and put it into the instruction register (IR)2. Control unit decodes the instruction; updates the PC for the

next instruction

• Execute phase:3. Find the data required by the instruction.4. Perform the required operation.5. Store the results.6. Repeat from Step 1.

Page 39: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Instruction Cycle

1-39

Page 40: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

How computers work

VC

CG

ND

A0-

An-

1

D0-

D7

CS

OE

WE

CPUALU B

A

D

C

registersInst. Dec.I/O 16 I/O 17 I/O 18 I/O n

Logic circuit

PC: 01

Address bus

Data bus

Control bus WriteRead

0

0

1

2

3

4

5

6

7

31h

C4h

26h

81h

EAh

0h

5h

A [17]B AA [6]AA+B[7]A

Page 41: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

How computers work

VC

CG

ND

A0-

An-

1

D0-

D7

CS

OE

WE

CPUALU B

A

D

C

registersInst. Dec.I/O 16 I/O 17 I/O 18 I/O n

Logic circuit

PC: 1

Address bus

Data bus

Control bus WriteRead

0

1

2

3

4

5

6

7

31h

C4h

26h

81h

EAh

0h

5h

31

A [17]B AA [6]AA+B[7]A

17

9

Page 42: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

How computers work

VC

CG

ND

A0-

An-

1

D0-

D7

CS

OE

WE

CPUALU B

A

D

C

registersInst. Dec.I/O 16 I/O 17 I/O 18 I/O n

Logic circuit

PC: 12

Address bus

Data bus

Control bus WriteRead

1

0

1

2

3

4

5

6

7

31h

C4h

26h

81h

EAh

0h

5h

C4 A [17]B AA [6]AA+B[7]A

17

99

2

26

3

6

5

Page 43: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

How computers work

VC

CG

ND

A0-

An-

1

D0-

D7

CS

OE

WE

CPUALU B

A

D

C

registersInst. Dec.I/O 16 I/O 17 I/O 18 I/O n

Logic circuit

PC:

Address bus

Data bus

Control bus WriteRead

0

1

2

3

4

5

6

7

31h

C4h

26h

81h

EAh

0h

5h

A [17]B AA [6]AA+B[7]A

5

9

81

334

5

9+

E

4

EA

E

7

Eh

5

Page 44: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Review Questions 1

Page 45: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Review Questions 2

Page 46: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Review Questions 2 (Cont’d)

Page 47: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Selecting a Microprocessor

• Choose the right one for your application– Primary criteria: Cost, Power, Size, Speed– Others: package options, integrated peripherals, potential for future growth

• Choose one with good software development support– development environment - good compiler and debugger availability– evaluation boards– in-circuit emulators for those with deep pockets– Operating system availability

• Other considerations– Code density: affects power consumption, performance and system cost– Hardware availability: make sure you can actually purchase the microcontroller

before designing it in– Prior expertise, licensing, etc

Page 48: SEE 3223: Microprocessors Dr. Izzeldin Ibrahim Mohamed P08-117/ VeCAD LAB Ext.: 36117, HP: 0127363635 Email: izzeldin@fke.utm.myizzeldin@fke.utm.my Department

Summary

• Microprocessors and embedded controllers are a ubiquitous part of life today

• Concept of a microprocessor & microcontroller• Understand how a µP works• Headhunters report that EEs familiar with µC, µP design are in the

highest possible demand• Web Resources:

– How Microprocessors Work:• http://computer.howstuffworks.com/microprocessor.htm• http://www.intel.com/education/mpworks/• http://www.cse.psu.edu/~cg471/03f/hw/pj5/how-micro.html

– Great Microprocessors of the Past and Present:• http://www.sasktelwebsite.net/jbayko/cpu.html

– Great Moments in Microprocessor History:• http://www-128.ibm.com/developerworks/library/pa-microhist.html