Bild 1 - miun.se
Download
Report
Transcript Bild 1 - miun.se
MICROPROCESSOR
SYSTEM DESIGN
COURSE
INTRODUCTION
Muhammad Amir Yousaf
1
MICROPROCESSOR SYSTEM
DESIGN ET011G
Micro-controllers
History of
Computer
Introduction
Course Aims?
Invisible
computing
Course contents?
Muhammad Amir Yousaf
2
History
HUMAN’S CALCULATIONS AND
COMPUTATIONS
Humans needed to count, calculate and
compute since the beginning.
They needed to count times, distances,
money (sheep, cattle )etc.
With development of human society,
they had to do advanced calculations to
make tide charts, navigational tables and
planetary positions for astronomical
almanacs.
Muhammad Amir Yousaf
3
History
HUMAN’S CALCULATIONS AND
COMPUTATIONS
Later on they started computing
to precisely hit their enemies with
trebuchets, cannons and bomber
jets.
With the growing need, dedicated people
were hired to make repetitive or/and
complex calculations.
Muhammad Amir Yousaf
4
History
HUMAN COMPUTERS
The term "computer“ was used
in the mid 17th century.
The approach was used
for astronomical and other
complex calculations.
Human computers have
played integral roles in
the World War II
‘Human computers’ performing repetitive computing to compute navigational tables, tide
charts, and planetary positions for astronomical almanacs.
Muhammad Amir Yousaf
5
History
EARLY COMPUTATION DEVICES
Abacus: The abacus was an
early aid for mathematical
computations.
An Abacus expert can do addition and
subtraction at same speed as with
calculator.
Muhammad Amir Yousaf
6
History
EARLY COMPUTATION DEVICES
The period 2700-2300 BC
saw the first appearance
in Sumerian civilisation
Greek historian mentioned the
use of Abacus in ancient Egypt
Achaemenid Persian
Empire, around 600 BC
Muhammad Amir Yousaf
7
History
EARLY COMPUTATION DEVICES
John Napier invented
Logarithms in 1617 that
allows multiplication to be
performed via additions
In 1632 a slide rule was build using the Napier’s
Log table. It was still in use until 1960 by NASA
engineers of Apollo program.
Muhammad Amir Yousaf
8
History
MECHANICAL COMPUTERS
Blaise Pascal (19) invented
Pascaline in 1642 for his tax
collector father. Still the
mechanical odometers use the
Pascaline’s mechanism to
increment the next wheel after each Step Reckoner by Wilhelm
Leibniz : It was the first
revolution of prior wheel.
calculator that could perform all
four arithmetic operations:
addition, subtraction,
multiplication and division.
Leibniz was the first to advocate use of the binary number system
Muhammad Amir Yousaf
9
History
PUNCH CARD COMPUTERS
1801, Joseph Marie Jacquard
introduced wooden punch
cards to feed pattern to power
looms that could weave fabric
and print design on it.
The presence or absence of holes in
predefined positions would physically
allows a thread to pass or stops that
thread.
This punched card idea was later used
in many mechanical computers for
programming .
Muhammad Amir Yousaf
10
History
PUNCH CARD COMPUTERS
Jacquard's Loom showing the threads
and the punched cards
Muhammad Amir Yousaf
11
History
Muhammad Amir Yousaf
12
History
MECHANICAL COMPUTERS
Middle decades of 19th century…..times of
unprecedented engineering ambitions.
Steam engines had started powering up.
'I wish to God these calculations had been
executed by steam'
Charles Babbage embarked on an
ambitious venture to design and build
mechanical calculating engines.
Muhammad Amir Yousaf
13
History
MECHANICAL COMPUTERS
Difference Engine was the first
idea that would compute logarithm
tables but never completed .
Babbage came with another idea
Analytic Machine power by 6 steam
engines.
It was programmable with punch
cards used to feed instructions and
also to store data.
Muhammad Amir Yousaf
14
History
MECHANICAL COMPUTERS
Herman Hollerith invented a counting
machine called Hollerith desk for 1890 US
census. The machine was build using the
Jacquard’s punched cards and Pascal's
gear wheel technologies.
Hollerith build a company, the
Tabulating Machine Company which
eventually became the International
Business Machines (IBM)
Muhammad Amir Yousaf
15
History
ELECTRO-MECHANICAL COMPUTERS
WW-II, Precise calculation for
shell trajectory was required
U.S. had battleships that could
lob shells weighing as much as a
small car over distances up to 25
miles.
Physicists could write the equations that
described how atmospheric drag, wind,
gravity, muzzle velocity, etc. would determine
the trajectory of the shell. But solving such
equations was extremely laborious.
Muhammad Amir Yousaf
16
History
ELECTRO-MECHANICAL COMPUTERS
Mark I was first programmable digital computer made by a
partnership b/w Harvard and IBM in 1944 to perform military job.
It was not purely electronic but was constructed out of relays,
rotating shafts and clutches.
The machine weighed 5 tons, incorporated 500 miles of wire,
was 8 feet tall and 51 feet long, and had a 50 ft rotating shaft
running its length, turned by a 5 horsepower electric motor.
Muhammad Amir Yousaf
17
History
ELECTRO-MECHANICAL COMPUTERS
Muhammad Amir Yousaf
18
History
FIRST COMPUTER BUG FOUND
Grace Hopper found the first computer
"bug": a dead moth that had gotten into the
Mark I and whose wings were blocking the
reading of the holes in the paper tape. The
word "bug" had been used to describe a
defect since at least 1889 but Hopper is
credited with coining the word "debugging"
to describe the work to eliminate program
faults.
In 1953 Grace Hopper invented the first high-level language, "Flowmatic“ which eventually became COBOL
She also constructed the world's first compiler.
Muhammad Amir Yousaf
19
History
The Mark I operated on numbers that were 23
digits wide.
Add or subtract two of these numbers in threetenths of a second.
Multiply them in four seconds.
Divide them in ten seconds.
Store 72 numbers.
“Six electronic digital computers would be sufficient
to satisfy the computing needs of the entire United
States.” Howard Aiken
Muhammad Amir Yousaf
20
History
ELECTRONIC COMPUTERS
Then the microelectronic
revolution allowed the things
to change in the way we have
today.
Designed and hand-built by
Steve Jobs and Steve
Wozniak, the Apple I was
Apple's first product, and went
on sale in July 1976.
Apple I came as a home
computer in 1976.
It was the first commercially
successful home computer to
feature both a mouse-based
input system, as well as an
easy-to-use graphical user
interface.
Muhammad Amir Yousaf
21
History
COMPUTER IN ELECTRONIC AGE
History of electronic computer development
is divided into 5 generations.
1st Generation: Vacuum Tube Computers
2nd Generation: Transistor Computers
3rd Generation: Integrated IC
4th Generation: VLSI (processors)
Major changes occur in the
areas:
Size, Cost, Efficiency,
Reliability
Muhammad Amir Yousaf
22
History
1ST GENERATION: VACUUM TUBES
1906 Lee de Forest invents the vacuum tube
that could amplify and switch voltage level.
1945, ENIAC, Electronic Numerical Integrator
and Calculator was the first vacuum tube
computer
designed
byfoot
Eckert
and
Mauchly.
ENIAC filled
a 20 by 40
room,
weighed
30 tons, and used more than
18,000 vacuum tubes.
Programmable with punched cards and tape
Much faster than Mark I as there was no
mechanical moving part.
Mark I takes 6 seconds for multiplications
whereas it takes only 2.8 thousandth of a
second.
Muhammad Amir Yousaf
23
History
1ST GENERATION: VACUUM TUBES
To reprogram the ENIAC you had
to rearrange the patch cords that
you can observe on the left in the
prior photo, and the settings of
3000 switches that you can
observe on the right
Muhammad Amir Yousaf
174,000 watts of heat produced
by 19000 vacuum tubes.
24
History
1ST GENERATION: VACUUM TUBES
1940S-1956
1951, The two guys of ENIAC teamed up with John Von
Neumann to eliminate the obnoxious fact that
reprogramming the computer required a physical
modification of all the patch cords and switches.
It took days to change ENIAC's program.
Neumann was first to give stored program computer
architecture that is still in use in most modern computers
with some modifications.
Muhammad Amir Yousaf
25
History
1ST GENERATION: VACUUM TUBES
1940S-1956
Vacuum Tube technology was:
Much faster than mechanical
computers
Expensive
Bulky
Power Hungry
Un-reliable
Punched cards, paper tape,
magnetic drum memories.
Muhammad Amir Yousaf
26
History
2ND GENERATION: TRANSISTORS
1956-1963
1947, Transistors invented in Bell
Labs. Transistors replaced
vacuum tubes in 2nd generation
computers.
Transistors allowed 2nd generation
computers to be:
Smaller in size.
Faster in speed.
Reliable
Energy efficient.
Computers moved to assembly
language and high level languages
e.g. FORTRAN and COBOL were
used for instructions.
Magnetic core technology was
used for memory. Instructions were
stored in memory.
Muhammad Amir Yousaf
27
History
3RD GENERATION: INTEGRATED CIRCUITS
1964- 1971
Integrated circuit technology was developed that
allowed integration of several transistors on a
silicon chip.
It drastically increased the speed and efficiency of
3rd generation computers while reducing the size.
The change was ‘revolutionary’.
The use of operating system allowed several
applications running on same time.
The reduction in size and cost due to IC technology
had made it accessible to mass users.
Altair 1975
Muhammad Amir Yousaf
28
History
4TH GENERATION: VLSI
1971 TO PRESENT
Very Large Scale Integration (VLSI), thousands of ICs on
same chip made it possible to develop entire processor on
single chip.
Intel 4004 processor chip, 1971
CPU, memory to I/O control on same chip.
4-bits
IBM introduced home computer, 1981
Apple introduced the Macintosh, 1984
Personal computers
Desktops, laptops, Netbooks, Pads and tablets
Muhammad Amir Yousaf
29
History
COMPUTERS PAST PRESENT FUTURE
Up to 1970s
Computers up to 1970s were very large
objects, called mainframes.
Difficult to maintain.
Expensive
Require specialized cooling
infrastructure.
Only in Research labs
Multi to one relations
Muhammad Amir Yousaf
30
History
COMPUTERS PAST PRESENT FUTURE
After 1971
Intel’s 4004 (1971), mainframe built on to
a chip.
Computing became cheaper, robust,
portable.
Personal computers, Every one started
having one’s own.
‘Many to one’ relation changes to ‘One
to One’
Muhammad Amir Yousaf
31
History
COMPUTERS PAST PRESENT FUTURE
Where it would lead to in future
Computing would be distributed in
physical space.
Invisible but everywhere around us,
Mark Weiser (1990)
In woodworks around us even in the
clothing.
Embedded, wireless, invisible
Interfaces.? Gestural, voice
Muhammad Amir Yousaf
32
Future
Invisible but everywhere around us
Computing away from mainframe and
desktop computers.
In the smaller computing engines
ubiquitously spread in physical space.
Microcontrollers…….Smaller
computing engines
Muhammad Amir Yousaf
33
Future
Invisible but everywhere around us
New areas computers getting in
Paper 4, Touch sensitive printed
surface with printed speakers
http://mkv.itm.miun.se/projekt/paperfour/
Muhammad Amir Yousaf
34
Motivation
MICROPROCESSOR SYSTEM
DESIGN?
Muhammad Amir Yousaf
35
Motivation
MICROPROCESSOR SYSTEM
DESIGN?
To be a system designer and analyst:
Knowledge of programming languages for efficient software
design.
General knowledge of modern technologies.
Sensing
Computing
Communicating
Muhammad Amir Yousaf
36
MICROPROCESSOR SYSTEM DESIGN
ET032G
Labs & Lectures:
Muhammad Amir Yousaf
S- Building 241-F
060148748
http://apachepersonal.miun.se/~amiyou/
Email: [email protected]
Muhammad Amir Yousaf
37
COURSE AIM
Aims:
The course aims to provide a basic
understanding of how microcomputers are
constructed and how they are used.
A solid Foundation:
In-depth knowledge of computer
architecture.
For design, debug and testing.
Muhammad Amir Yousaf
38
COURSE AIM
Student will learn to design an electronic
system into a modern microprocessor and get
the skills to program a modern
microprocessor.
Microcomputer interaction with external devices
General knowledge of modern technologies.
Muhammad Amir Yousaf
39
LEARNING OBJECTIVES
After successful completion of the course students should learn
Basic microcomputer architecture:
how a micro-computer is built and functioning .
how to design a simple electronic systems on a microcomputer
Programming in C
how to handle a development environment for a microcomputer
how to write simpler program and functions in a microcomputer using C.
be able to write and include inline assembler of short code fragments
I/O handling, synchronization
to read information from the outside world, process it and then influence its
surrounding.
to handle both analog and digital signals to / from micro-computer.
use interrupt and polling to synchronize program execution to the outside world.
link microcomputer with other devices through standard interface such as SPI,
I2C, UART and USB.
Muhammad Amir Yousaf
40
COURSE CONTENTS
The course is divided into three parts with the following content
Basic microcomputer architecture
Von Neumann architectures
Assembly programming
Overview of state-of-the-art architectures
Programming in C
Structured Programming in C
Inline assembler
I/O management
Read/write data from/to outside world
A/D - D/A converters
Memory architectures
Synchronization via interrupt and polling
Interface to the SPI (e.g. memory cards), I2C, UART, USB
communication
Muhammad Amir Yousaf
41
LECTURE PLAN
Introduction to Course:
Computer History
Course Plan, Aims and Goals
Course Contents.
Lecture 1: Von Neumann Architecture
Von Neumann Architecture
Harvard Architecture
Addressing Modes
Data Representation.
Lecture2: Microprocessor Programming
Problem definition
Program design goals
Program development
Embedded C
Muhammad Amir Yousaf
42
LECTURE PLAN
Lecture 3: Microprocessor Programming II
Embedded C
Pointers, Array, Structures
Memory Management
Lecture4: Architecture of X-mega micro-controller
Lecture5: IO Handling
Communication with external world
Communication models
Overview of serial and parallel protocols
Muhammad Amir Yousaf
43
LECTURE PLAN
Lecture6: IO Handling II
SPI
I2C
USART
Lecture 7: Inline Assembly
Why Assembly?
Basic Instructions.
Mixing Assembly and C
Lecture8: Memory
Registers
Memory Type
Memory configurations
Muhammad Amir Yousaf
44
LABS AND EXERCISES
Microcontroller Educational Platform:
Atmel ATxmega128B1 microcontroller
4x40 LCD module with backlight
Transfer data over the USB full/low speed device interface
Read a light sensor with the ADC
Read a temperature sensor with the ADC
Measure external voltage input with ADC
Measure potentiometer voltage with ADC
Read status of the 4 Atmel QTouch® buttons from
AT42QT1040 QTouch device
4 LEDs to show status information
Read/write data to the 64Mbit Atmel DataFlash
Program the kit via USB bootloader or an Atmel programmer
Expand the board with Xplained top modules
Muhammad Amir Yousaf
45
LABS AND EXERCISES
Programming Environment:
AVR Studio 6
Labs
Lab1:
Literature reading i.e. Datasheets and getting started
tutorials
Getting started with AVR Studio 6
AVR simulator to visualize the data flow within registers
to get deeper idea of architecture
Digital IOs, LEDs and Switches
Lab2:
IO Handling
Muhammad Amir Yousaf
46
LABS AND EXERCISES
Programming Environment:
AVR Studio 6
Labs
Lab3:
Inline assembly
Interrupts
More robust applications
Muhammad Amir Yousaf
47
EXAMINATION AND GRADING
SYSTEM
Examination form
3.0 credits, T106: Exam
Grades: A, B, C, D, E, Fx and F. A-E are
passed and Fx and F are failed.
3.0 credits, L106: Laboratory
Grades: Pass (P) or Fail (F)
1.5 credits, I106: Assignment, Project
Grades: Pass (P) or Fail (F)
A written exam will be held 15th Jan 2014
Muhammad Amir Yousaf
48
Muhammad Amir Yousaf
49