0% found this document useful (0 votes)
175 views40 pages

Embedded System

This document provides an overview of a course on microprocessors. It discusses embedded systems and microprocessor-based systems. The key points covered are: - Embedded systems account for over 99% of new microprocessors and are used in devices like consumer electronics, vehicles, medical equipment, and sensors. - Embedded systems are designed to perform specific functions, unlike general purpose computers. They are optimized for their application in terms of power, cost, size and speed. - A microprocessor system consists of a CPU, memory, and input/output components connected via buses. Glue logic is required for external devices to interface with the processor. - The document outlines course topics, prerequisites, and a reading list

Uploaded by

twisham_08
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
175 views40 pages

Embedded System

This document provides an overview of a course on microprocessors. It discusses embedded systems and microprocessor-based systems. The key points covered are: - Embedded systems account for over 99% of new microprocessors and are used in devices like consumer electronics, vehicles, medical equipment, and sensors. - Embedded systems are designed to perform specific functions, unlike general purpose computers. They are optimized for their application in terms of power, cost, size and speed. - A microprocessor system consists of a CPU, memory, and input/output components connected via buses. Glue logic is required for external devices to interface with the processor. - The document outlines course topics, prerequisites, and a reading list

Uploaded by

twisham_08
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

68000

SEE3223 Microprocessors 

1: Embedded Systems 

Muhammad Mun’im Ahmad Zabidi ([email protected]
68000

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 microprocesso

1-2
68000

SEE3223 Microprocessor Systems


•  What s in this course:
–  Assembly language programming
–  Microprocessor concepts
–  Hardware interfacing
•  Pre-Requisites
–  Number representation, coding, registers, state machines
–  Realisation of simple logic circuits
–  Integrated circuit technologies
–  Designing with MSI components
–  Flip-Flops
–  Counters and sequential MSI components
–  Register transfer logic

1-3
68000

Reading List
Required Text:

•  Muhammad Mun’im Ahmad Zabidi (2011), Sistem Terbenam dengan


Mikropemproses 68000, Penerbit UTM Press.

Recommended Readings:

•  Antonakos, J.L. (2003), The 68000 Microprocessor: Hardware and


Software Principles and Applications, 5th Ed., Prentice Hall.

•  Clements A.(1997), Microprocessor Systems Design: 68000 Software,


Hardware and Intefacing, 3rd Ed., PWS Kent Publishing.

•  Walter A. Triebel, Avtar Singh (1991), The 68000 and 68020


Microprocessors, Prentice Hall.

1-4
68000

Computing Systems
•  Rapid pace of information technology is due to introduction of
new microprocessors
•  Most of us think of desktop computers
–  PC
–  Laptop
–  Mainframe
–  Server
•  Maybe at most handheld computer (PDA)
•  In this course, we will look at another type of computing
system which is far more common that you ever imagined 

1-5
68000

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
1-6
68000

Embedded Systems
•  Account for >99% of new microprocessors
–  Consumer electronics
–  Vehicle control systems
–  Medical equipment
–  Sensor networks
•  Desktop processors (Intel Core, AMD Athlon, PowerPC, etc)
combined is only 1%

1-7
68000

Embedded Systems
•  Simple definition: Computing systems embedded within
electronic devices
•  Nearly any computing system other than a desktop computer
•  Designed to perform a specific function
•  Billions of units produced yearly, versus millions of desktop
units
•  Take advantage of application characteristics to optimize the
design
•  As electrical or electronics engineers, you may be required to
design an embedded system
–  But you BUY (not design) a general purpose computer

1-8
68000

General Purpose vs Embedded Systems


General Purpose Embedded
Intended to run a fully general set Runs a few applications often
of applications 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: Differentiating features:
•  Speed (need not be fully •  Power
predictable) •  Cost (eg RM2 vs RM2.50)
•  Software compatibility •  Size
•  Cost (eg RM3k vs RM5k per •  Speed (must be predictable)
laptop)

1-9
68000

A Computer System – Simplified View

CPU Memory Input/Output

Address bus

Data bus

Control bus

An embedded system also has the same


structure but at a smaller size

1-10
68000

Microprocessor – Basic concept


Address bus 16-bit / 32-bit / 64-bit wide

Data bus
bidirectional
CPU 8-bit / 16-bit / 32-bit / 128-bit

Control bus Timing signals, ready signals,


interrupts etc

Microprocessor, by-itself, completely useless – must have external peripherals to


Interact with outside world

1-11
68000

Microprocessor – Basic Concept


Address
Control

Keyboard
Boot Screen
CPU ROM Instruction
Data Trans- UART
(program)
RAM ducers Parallel
Used at ROM
startup
interface
etc

Data

Microprocessor, by-itself, completely useless – must have external peripherals to


Interact with outside world
1-12
68000

Glue Logic
Every external device needs some glue logic to interface with the processor.
Address Address

Control
Control
  Address strobe
  Data strobe Decode Logic
  Read/write control
  Output Enable
CS* – chip select
Other Glue Logic
  Interrupt signals
External   etc
Device Device itself
with all
necessary
internal logic

Data
Data
We’ll study all the control signals when we study microprocessor hardware.
1-13
68000

Microcontroller – Basic concept


Address
Control

Boot Program Data Trans-


Some I/O
ROM ROM RAM ducers
CPU

Data

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

1-14
68000

Microprocessor vs Microcontroller
•  Microprocessor: •  Microcontroller:
–  A chip that contains only the –  A chip that contains all the
processor components of a computer –
–  Need other chips to make a processor, memory and input/
working system output
–  More flexible –  Less flexibility
–  Can have very few I/O or many I/O –  Less component count in system
devices using the same processor –  Less powerful
chip

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

1-15
68000

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 handphones, modems, communications systems
•  Graphics Processors:
–  Very powerful processors found in graphics cards of workstations
•  Programmable Logic Controllers:
–  Microprocessor boards usually found in industrial applications

1-16
68000

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
1-17
68000

Software
•  Computer software
–  Computer programs are known as software
•  Program:
–  Sequence of instructions that perform a task
–  Think of it like playing music
•  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 1-18
68000

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.
–  Two types of assemblers: 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
–  Native assembler runs and generates instructions for the same computer.
–  Drawbacks of assembly programs:
•  Dependent on hardware organisation, difficult to understand long programs, low
programmer productivity
1-19
68000

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 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.

1-20
68000

Central Processing Unit (CPU)

Menyimpan
maklumat Memproses

Daftar
ALU

Bas dalaman
Bas alamat

Bas data
Unit kawalan
Bas kawalan

Mengawal

1-21
68000

Important Registers
•  Program Counter (PC)
–  Keeps track of program execution
–  Address of next instruction to read from memory
–  May have auto-increment feature or use ALU
–  Some manufacturers call this register the Instruction Pointer (IP)
•  Instruction Register (IR)
–  Invisible to programmer
–  Contains current instruction
–  Includes ALU operation and address of operand
•  Data Registers
–  Stores data. For simple µP, it may be called accumulators.
•  Address Registers
–  Stores address of data. For special areas of memory, it may be called
index registers, stack pointers or base registers.
1-22
68000

The ALU
•  Performs arithmetic & logic operations on several
bits simultaneously
•  The number of bits is a most important factor
determining the capabilities of the processor
•  Typical sizes:
–  4 bits (very small microcontroller: remote controllers)
–  8 bits (microcontrollers: 68HC05, 8051, PIC)
–  16 bits (low-end microprocessors: Intel 8086)
–  32 bits (most popular size today: Intel Core, PowerPC,
68000, ARM, MIPS)
–  64 bits (servers: IBM POWER & PowerPC G5, AMD
Opteron, Intel Itanium)
1-23
68000

Memory
0
1
•  Looks like a very long list. 2
3
•  Each row is called a memory
location and has a unique address
•  Each location stores the same
number of bits, usually multiples of
8 bit (bytes)
•  Number of addresses 2N (where N
is an integer). Alamat kedudukan

Satu kedudukan

Satu sel

2N-1

1-24
68000

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 1-25
68000

Memory Space and Address Bus


•  Smallest transferable amount of data from memory to CPU
(and vice versa) is one byte.
•  Each byte has a unique location or address.
•  The address of each byte is written in hexadecimal (hex).
–  For 68000, the prefix $ means a hex value.
•  The range of addresses accessible by the processor is the
memory space.
–  Limited by the size of the address bus
•  From the programmer s point of view, 68000 address bus is
24 bits wide.
–  Memory space is 0 to 224-1 (16777216 or 16 Megabyte)
–  Written in hex as $000000 to $FFFFFF.

1-26
68000

Word size and data bus size


•  Width of data bus determines the amount of data transferable
in one step
•  Original 68000 has a 16 bit data bus
–  Can transfer 1 word or 2 bytes at once
–  A longword requires two transfers
•  Current 68HC000 has a selectable bus width of 8 or 16 bits
–  Selecting 8 bit data bus results in cheaper system but lower
performance
•  The maximum amount of memory for any 68000 system is 16
Mega locations x 1 byte/location = 16 Megabytes
–  Can also be thought of 8 Megawords

1-27
68000

Data & Address Buses


24-bit address bus

CPU Memory
16-bit data bus

Data bus 16 bits

15 0
$000000

Address bus 24 bits

224-1=
8M locations

$FFFFFF

1-28
68000

Memory Read Operation

0000 10100000
0001 00110010
0002 01011111
0003 11111111
0002 Bas alamat Bas data 01011111
0004 00000001

FFFF 11111111
Perintah
BACA

1-29
68000

Memory Write Operation

0000 10100000
0003 Bas alamat
0001 00110010
0002 01011111 10000001
0003 11111111
0004 00000001
10000001 Bas data

FFFF 11111111
Perintah
TULIS

1-30
68000

Memory Map
•  System memory map $000000
Interrupt
summarizes the memory $001FFF
vectors

locations available to the $002000

programmer $01FFFF
ROM

•  Must know the following $002000


RAM
before we can write any $01FFFF

program $020000

–  RAM start and end


Unused
–  ROM start and end
$FFFBFF
–  I/O devices
$FFFC00
•  Very different from writing a I/O devices
$FFFFFF
program in C where we don’t
have to know all this The memory map of a
typical system
1-31
68000

Fetch-Execute Cycle
•  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

1-32
68000

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.

1-33
68000

Instruction Sequencing
•  Example – an instruction to add the contents of two locations
(A and B) and place result in a third register (C)
•  Before you do anything: set PC to point to 1st instruction in
the sequence
Addr Instructions
12 MOVE A,D0
Program Counter (PC)
14 ADD B,D0
12
16 MOVE D0,C
Instruction Register (IR)

100  (A) = 4
Data Register 0 (D0) 102 (B) = 5
104 (C)

1-34
68000

Instruction Sequencing

Addr Instructions
Program Counter (PC)
14 12 MOVE A,D0
14 ADD B,D0
Instruction Register (IR)
MOVE A,D0 16 MOVE D0,C

Data Register 0 (D0)
100  (A) = 4
4
102 (B) = 5
104 (C)

1-35
68000

Instruction Sequencing

Addr Instructions
Program Counter (PC)
16 12 MOVE A,D0
14 ADD B,D0
Instruction Register (IR)
ADD B,D0 16 MOVE D0,C

Data Register 0 (D0)
100  (A) = 4
9
102 (B) = 5
104 (C)

1-36
68000

Instruction Sequencing

Addr Instructions
Program Counter (PC)
18 12 MOVE A,D0
14 ADD B,D0
Instruction Register (IR)
MOVE D0,C 16 MOVE D0,C

Data Register 0 (D0)
100  (A) = 4
9
102 (B) = 5
104 (C) = 9

1-37
68000

Important ProcessorsYou Should Know


Year Company Device Significance
1971 Intel 4004 1st µP. A 4-bit device.
1974 Intel 8008 1st 8-bit µP.
Motorola 6800 1st 8-bit µP from Motorola.
Texas TMS 1000 First microcontroller. Can operate without support chips.
1978 Intel 8086 1st 16-bit µP.
1979 Motorola 68000 16/32-bit µP : the data bus is 16 bits externally, but 32-bit
internally.
1984 Motorola 68020 Full 32-bit µP derived from 68000. Has modern features
such cache memory, floating-point unit & full support for
modern operating systems.
1985 Intel 80386 32-bit µP from Intel, basically unchanged until Pentium of
today.
1986 ARM ARM1 32-bit RISC chips designed for low-power.
1993 Apple/ PowerPC 601 A RISC chip from Motorola derived from IBM POWER.
Motorola/ Ended 68k s use as general purpose computing but the
IBM family continues to live in embedded systems until today.
1-38
68000

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 1-39
68000

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
1-40

You might also like