Vous êtes sur la page 1sur 18

CoE 115

Lecture 1 Introduction to MicroController

Z80 Microprocessor-based System

Microcontroller

Micro-C vs Micro-P (pinouts)

Microcontroller

Processor Architecture

The RISC architecture

simple, hard-wired instructions which often take only one or a few clock cycles to execute.

small and fixed code size with comparatively few instructions and few addressing modes.

execution of instructions is very fast, but the instruction set is rather simple.

Processor Architecture

The CISC architecture

characterized by its complex microcoded instructions which take many clock cycles to execute.

often has a large and variable code size and offers many powerful instructions and addressing modes.

In comparison to RISC, CISC takes longer to execute its instructions, but the instruction set is more powerful.

Microcontroller Components Memory


Each memory location has a specific address We must supply an address to access the corresponding location R/W allows us to select reading or writing Various types of memory for different functions and speeds

Memory location 0

Memory location 1

address

data

Memory location n-2

Memory location n-1

r/w

Microcontroller Components Memory

Read Only Memory - Memory that can only be read

Holds the program code for a microprocessor used in an embedded system where the code is always the same and is executed every time the system is switched on Computer BIOS, boot-up information

Other types of Read Only Memory

Erasable Programmable Read Only Memory (EPROM) Similar to ROM but can be erased (exposure to ultraviolet light) and reprogrammed Electrically Erasable Programmable Read Only Memory (EEPROM) more common that EPROM because it can be erased by the microprocessor Flash Memory, Ferroelectric RAM (FRAM), Magnetic Random Access Memory (MRAM)

Microcontroller Components Memory

Random Access Memory used to store dynamic data when processor is running Some types of RAM

Holds program code and data during execution Can be accesses in any random order unlike takes or disks

Static RAM (SRAM) Uses transistors to store bits, fast SRAM is used for cache Dynamic RAM (DRAM) Uses capacitors to store bits, must be refreshed, smaller and cheaper than SRAM

Fast Page Mode (FPM), Extended Data Out (EDO) Synchrounous DRAM (SDRAM) introduced in 1997 and replaced most DRAM in computers by 2000 Double Data Rate (DDR SDRAM) uses both clock edges found today in most computers Direct Rambus DRAM (RDRAM) somewhat of a flop

10

Microcontroller Components CPU

Smart part
Processes instructions and data All the parts of a microprocessor

Registers fast memory used to store operands and other information


address r/w

Register 0

Register 1

data

Register n-1

Condition register positive/negative result Exception register overflow condition Loop count register

ALU

inst

Load-store architecture

CPU

11

Processor Core

Microcontroller Components I/O



Connection to the outside world Examples


Analog to Digital Converter Temperature Sensor Display Communications Circuit

13

Microcontroller Components BUS



Group of wires used to transport information CPU to Memory


Address bus Data bus

CPU to I/O

Port mapped I/O used when address space is limited, special instructions are needed for I/O Memory mapped I/O I/O looks like memory locations, easier to use and common in Reduced Instruction Set Computing (RISC)

14

Machine-level Execution
Machine instruction:
A bundle of binary bits with certain formats Only asks for simple operations Assembly: textual notations of machine program

Example: c = a + b; Machine execution: r1 mem(a) r2 mem(b) r3 ADD r1, r2 mem(c) r3

15

Machine-Level Execution
memory
I/O address

Load CPU Store


Stack Data Instruction

Fetch inst

16

Major Instruction Types

Arithmetic and logic: Add, subtract, multiply, divide; and, or, not, xor Data movement: transfer data between registers and/or memories Control: Branches and jumps

17

Processor Performance

CPU Time = # Cycles Cycle Time = # Instructions CPI Cycle Time CPI: Cycles per instruction

18