microprocessor & microcontroller by sanat

42
Presented by Nitesh Kumar Singh BME 7 th sem Microprocessor and Microcontroller

Upload: nitesh-kumar

Post on 06-May-2015

1.010 views

Category:

Education


4 download

TRANSCRIPT

Page 1: Microprocessor & microcontroller by sanat

Presented byNitesh Kumar Singh

BME 7th sem

Microprocessor and Microcontroller

Page 2: Microprocessor & microcontroller by sanat

Microprocessor

Page 3: Microprocessor & microcontroller by sanat

IntroductionThe microprocessor also known as the

central processing unit, is the brain of all computers and many household and electronic devices. Multiple microprocessors, working together, are the "hearts" of datacenters, super-computers, communications products, and other digital devices.

Page 4: Microprocessor & microcontroller by sanat

HistoryFairchild Semiconductors (founded in 1957)

invented the first IC in 1959.In 1968, Robert Noyce, Gordan Moore,

Andrew Grove resigned from Fairchild Semiconductors.

They founded their own company Intel (Integrated Electronics).

The first microprocessor invented was of 4-bit, after that 8-bit,16-bit,.32-bit & 64-bit are founded

Page 5: Microprocessor & microcontroller by sanat

History 4-bit microprocessor• Intel 4004• Intel 40408-bit microprocessor• Intel 8008• Intel 8080• Intel 808516-bit microprocessor• Intel 8086• Intel 8088• Intel 80186 & 80188

Page 6: Microprocessor & microcontroller by sanat

History • Intel 8028632-bit microprocessor• Intel 80386• Intel 80486• Intel pentium• Intel pentium pro• Intel pentium II• Intel pentium II xeon• Intel pentium III• Intel pentium IV• Intel dual core

Page 7: Microprocessor & microcontroller by sanat

History 64-bit microprocessors• Intel core 2• Intel core i7• Intel core i5• Intel core i3

Page 8: Microprocessor & microcontroller by sanat

Microprocessor (MPU)MPU (CPU)

Read instructionsProcess binary data

330_018

Page 9: Microprocessor & microcontroller by sanat

MemoryStorage Device

AddressesRegisters

Major CategoriesRead/Write Memory

(R/W)Read-only-Memory

(ROM)

330_019

D7 D0

Page 10: Microprocessor & microcontroller by sanat

Input/Output (I/O)Input Devices

Switches and Keypads Provide binary information to the MPU

Output devicesLEDs and LCDsReceive binary information from the MPU

330_0110

Page 11: Microprocessor & microcontroller by sanat

Microprocessor ArchitectureThe MPU communicates with Memory and

I/O using the System BusAddress bus

UnidirectionalMemory and I/O Addresses

Data busBidirectionalTransfers Binary Data and Instructions

Control linesRead and Write timing signals

330_0111

Page 12: Microprocessor & microcontroller by sanat

Microprocessor – Basic concept

CPU

containsCCUALU

data registersand

pointer registers

ADDRESS BUS 32-bit / 64-bit wide

CONTROL BUSTiming signals, ready signals,interrupts etc

DATA BUS – bidirectional8-bit / 16-bit / 32-bit / 128-bit

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

Page 13: Microprocessor & microcontroller by sanat

Microcontroller

Page 14: Microprocessor & microcontroller by sanat

Micro controllerA self-contained system in which a processor,

support, memory, and input/output (I/O) are all contained in a single package.

A small computer system on a single IC

14

Page 15: Microprocessor & microcontroller by sanat

History of Microcontroller

First used in 1975(Intel 8048)The introduction of EEPROM in 1993, allowed

microcontrollers to be electrically erased The same year, Atmel introduced the first

microcontroller using Flash memory.

Page 16: Microprocessor & microcontroller by sanat

Microcontroller

Page 17: Microprocessor & microcontroller by sanat

Types of microcontroller

Page 18: Microprocessor & microcontroller by sanat

Basic Features of Microcontroller

Processor resetDevice clockingCentral processorProgram and Variable Memory (RAM)I/O pinsInstruction cycle timers

Page 19: Microprocessor & microcontroller by sanat

More Sophisticated Features

Built-in monitor/debugger programInterrupt capabilityAnalog I/O (PWM and variable dc I/OSerial I/O (synchronous, a synchronous)Parallel I/O (including direct interface to a

master processorExternal memory interface

Page 20: Microprocessor & microcontroller by sanat

Basic microcontroller architecture (1/3)

Page 21: Microprocessor & microcontroller by sanat

Basic microcontroller architecture (2/3)Memory

RAMROMStore data and code

CPUMathematical and logical operationMemory units are called Register

Page 22: Microprocessor & microcontroller by sanat

Basic microcontroller architecture (3/3)• BUS

– Group of 8,16 or more wires– Three type, address bus, data bus and control

bus• Input-output unit

– port A, port B, port C … …– Input, output and bidirectional ports

• Serial communication• Timer unit• Watchdog

– Automatic reset to prevent stall• Analog to Digital Converter (ADC)

Page 23: Microprocessor & microcontroller by sanat

Processor ArchitectureCISC

Large amount of instructions each carrying out a different permutation of the same operation

Functionality of the instructions is more dependent upon the processor’s designer.

RISCFundamental set of instructions More control for users to design their own

operations

Page 24: Microprocessor & microcontroller by sanat

Von Neumann Architecture

Page 25: Microprocessor & microcontroller by sanat

Processor Architecture

Princeton (Van Neumann) architectureCommon memory for program and data

Simple chip designExecution of an instruction can take multiple cycles

Page 26: Microprocessor & microcontroller by sanat

Processor Architecture

Princeton architecture example

Mov acc, reg

Cycle 1 Read instructionCycle 2 Read data out of

Ram and put into Acc

Page 27: Microprocessor & microcontroller by sanat

Processor Architecture

Harvard architectureSeparate memory space program and data

Instructions are executed in one cycle

Easier timing of loops and delays

Page 28: Microprocessor & microcontroller by sanat

Harvard Architecture

Page 29: Microprocessor & microcontroller by sanat

Processor Architecture

Harvard architecture exampleMov acc, reg

Cycle 1 Execute previous instructionRead “move acc, reg”

Cycle 2 Execute “move acc, reg” instruction

Page 30: Microprocessor & microcontroller by sanat

Block diagram of Microcontroller

Page 31: Microprocessor & microcontroller by sanat

Memory The memory in a computer system stores the data and

instructions of the programs.

Adress decoder Storage

Area

Adress bus

Data bus

Other signals (Vcc,Gnd, CS, etc.)

Page 32: Microprocessor & microcontroller by sanat

Microcontrollers Memory Types

Variable Area (RAM)Control Store (ROM)Program Counter StackI/O Space (Hardware interface Registers)

Page 33: Microprocessor & microcontroller by sanat

I/O Space

- Memory Mapped I/O Versus Programmed I/OProgrammed I/O

Special instructions such as IN and OUT are used to transfer data between a CPU register and an external device.

Memory Mapped I/O Standard instructions are used to transfer

data between a CPU register and an external device.

I/O ports appear as memory addresses.

Page 34: Microprocessor & microcontroller by sanat

Interrupts

Instruction support for interrupts Internal CPU handling of interrupts Interruptible instructions

36

Page 35: Microprocessor & microcontroller by sanat

Instruction support for interrupts

Processors provide two instructions, enable priority interrupt (EPI) and for disable priority interrupt (DPI).

These are atomic instructions that are used for many purposes, such as buffering, within interrupt handlers, and for parameter passing.

Page 36: Microprocessor & microcontroller by sanat

Internal CPU handling of interrupts

38

Step 1: finish the currently executing macroinstruction. Step 2: save the contents of the program counter to the interrupt return location. Step 3: load the address held in the interrupt handler location into the program counter. Resume the fetch and execute

sequence.

Single interrupt support

Page 37: Microprocessor & microcontroller by sanat

Internal CPU handling of interrupts

Step 1: complete the currently executing instruction. Step 2: save the contents of PC to interrupt return location i. Step 3: load the address held in interrupt handler location i into the

PC. Resume the fetch-execute cycle.

Multiple interrupt support

Page 38: Microprocessor & microcontroller by sanat

Interruptible instructions

In rare instances individuation macroinstruction may need to be interruptible.

This might be the case where the instruction takes a great deal of time to complete. E.g. a memory to memory instruction that moves large amounts of data.

In most cases, such an instruction should be interruptible between blocks to reduce interrupt latency. However, interrupting this particular instruction could cause data integrity problems.

Page 39: Microprocessor & microcontroller by sanat

Advantages of Microcontroller over Microprocessor

Pin count downDesign time down, Board layout size downUpgrade path easier – matching between

peripherals for speedCost down – bulk purchasesReliability upCommon software / hardware design

environment available from manufacturer

Page 40: Microprocessor & microcontroller by sanat

Issues when using microcontroller

Two types of memory – speed issues when usingOn-chip – fast, easy to access, “almost like a register”,

limited amount of on-chip memory availableOff-chip – slowerUse on-chip memory in a “cache” mode (copy off-chip

data to on-chip when processing data, then copy back) External components still there

E.g. Video CODECs – need to use DMA – Direct Memory Access – so that the controller can get on with the “processing” and let something else worry about moving data in and out of the chip

Real time environmentEvent driven – can’t WAIT for a device to become ready,

can’t POLL to see if device is ready, interrupt handling is key

All these resources are “power hungry” and compete for resources (data busses etc) – special features

Page 41: Microprocessor & microcontroller by sanat

Difference between microprocessor & microcontroller

Microprocessor Microcontroller

Contains ALU, general purpose register, stack pointer, programme counter, clock timing & interrupt circuit

Contains the circuitary of microprocessor & in addition it has built in ROM, I/O devices, timer & counter

It has too many instructions to move the data between CPU & memory

It has one or two instruction to move the data between CPU & memory

It has one or two bit handling instruction

It has many bit handling instruction

Access time for memory & I/O devices is more

Less access time for built in memory & I/O devices

Microprocessor based system requires more hardware

Microcontroller based system requires less hardware, reducing PCB size & increasing the reliability

More flexible in design point of view

Less flexible in design point of view

It has single memory map for data & code

It has separate memory map for data & code

Less number of pins are malfunctioned

More number of pins are malfunctioned

Page 42: Microprocessor & microcontroller by sanat

Thank you