Vous êtes sur la page 1sur 26

EE 3420: Microprocessors

EE 3420: Microprocessors
Dr. William A. Stapleton
Ingram School of Engineering
Texas State University San Marcos

Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

Dr. Stapletons Contact


Information

E-mail: wstapleton@txstate.edu
Office: 5222 Roy F. Mitte Building
Lecture: TR 11:00-12:20 or TR 2:00-3:20
Laboratory: T 3:30-6:20 or R 3:30-6:20
Office Hours: TR 9:30-10:45
Available other times by appointment
Open Door policy

Office Phone: (512) 245-8746


E-mail usually gets the fastest response
Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

Class Website available via


TRACS

https://tracs.txstate.edu

You should all have been automatically added to the class


TRACS site

Contents:

Assignments
Schedules
Announcements
Support materials
Links
Anything else interesting that I can find

Please feel free to ask if you cannot find what you


need.
Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

A Brief Introduction to
EE 3420 and
Microprocessors

Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

Prerequisites
The prerequisite for EE 3420 is EE 2420 (which
implies CS 1428).
From CS 1428, you have been exposed to the
fundamentals of programming and software
development. At this point, you are expected to
have a functional knowledge of general-purpose
programming using the C language.
From EE 2420, you have been exposed to Boolean
Algebra and the fundamental digital logic circuitry
to physically implement the Boolean functions. At
this point, you are expected to have a working
knowledge of how to generate, simplify, implement,
test, and interpret Boolean functions.
Dr. William A. Stapleton
Texas
State University - San Marcos, Ingram School of Engineering

EE 3420: Microprocessors

From EE 2420
You will need at least the following concepts from
your digital logic background
Boolean functions and algebra AND, OR, NOT, XOR,
NAND, NOR, etc.
Multiplexers and decoders
Tri-state buffers and transmission gates
Latches, flip-flops, and registers
State diagrams, state tables, and state simplification

Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

EE 3420?
In EE 3420, you will apply your prerequisite
knowledge to learning the techniques for
development of complete computing systems
composed of both hardware and software
components designed to fulfill specific objectives.
A few specifics:
You will learn the details of a microprocessor architecture
You will learn the assembly language for the
microprocessor
You will learn the relationship between assembly language
and high-level languages, specifically C
You will learn the techniques for interfacing the
microprocessor to the world at large through a number of
peripheral devices
You will learn to craft both hardware and software
Dr. William
Texas State University
- Santo
Marcos,
Ingram
School of Engineering
solutions
allow
a microprocessor-based
system
to A. Stapleton

EE 3420: Microprocessors

What to expect
From your prior computing experience, do these
seem familiar?
a keyboard
a screen
a CPU box, a.k.a. the brains

In CS 1428, you dealt with these items indirectly


through the Windows operating system and could not
directly access any of the hardware.
In this class, you will deal with these items,
especially the CPU, directly. This means you can
(and will) control every aspect of how they operate.
You will also be responsible for controlling how data
is transmitted and received between pieces of
equipment.
Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

A quick question
When you type on the keyboard, what data is sent to
the CPU? What format is it in?
American Standard Code for Information
Interchange ASCII
What does an ASCII code look like?
Do you know your ASCII codes?
If not, there are ASCII tables on TRACS and you
should become familiar with them.

Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

10

Char Dec Oct Hex | Char Dec Oct Hex | Char Dec Oct Hex | Char Dec Oct
Hex
------------------------------------------------------------------------------------(nul)
0 0000 0x00 | (sp)
32 0040 0x20 | @
64 0100 0x40 | `
96 0140 0x60
(soh)
1 0001 0x01 | !
33 0041 0x21 | A
65 0101 0x41 | a
97 0141 0x61
(stx)
2 0002 0x02 | "
34 0042 0x22 | B
66 0102 0x42 | b
98 0142 0x62
(etx)
3 0003 0x03 | #
35 0043 0x23 | C
67 0103 0x43 | c
99 0143 0x63
(eot)
4 0004 0x04 | $
36 0044 0x24 | D
68 0104 0x44 | d
100 0144 0x64
(enq)
5 0005 0x05 | %
37 0045 0x25 | E
69 0105 0x45 | e
101 0145 0x65
(ack)
6 0006 0x06 | &
38 0046 0x26 | F
70 0106 0x46 | f
102 0146 0x66
(bel)
7 0007 0x07 | '
39 0047 0x27 | G
71 0107 0x47 | g
103 0147 0x67
(bs)
8 0010 0x08 | (
40 0050 0x28 | H
72 0110 0x48 | h
104 0150 0x68
(ht)
9 0011 0x09 | )
41 0051 0x29 | I
73 0111 0x49 | i
105 0151 0x69
(lf)
10 0012 0x0a | *
42 0052 0x2a | J
74 0112 0x4a | j
106 0152 0x6a
(vt)
11 0013 0x0b | +
43 0053 0x2b | K
75 0113 0x4b | k
107 0153 0x6b
(ff)
12 0014 0x0c | ,
44 0054 0x2c | L
76 0114 0x4c | l
108 0154 0x6c
(cr)
13 0015 0x0d | 45 0055 0x2d | M
77 0115 0x4d | m
109 0155 0x6d
(so)
14 0016 0x0e | .
46 0056 0x2e | N
78 0116 0x4e | n
110 0156 0x6e
(si)
15 0017 0x0f | /
47 0057 0x2f | O
79 0117 0x4f | o
111 0157 0x6f
(dc0) 16 0020 0x10 | 0
48 0060 0x30 | P
80 0120 0x50 | p
112 0160 0x70
(dc1) 17 0021 0x11 | 1
49 0061 0x31 | Q
81 0121 0x51 | q
113 0161 0x71
(dc2) 18 0022 0x12 | 2
50 0062 0x32 | R
82 0122 0x52 | r
114 0162 0x72
(dc3) 19 0023 0x13 | 3
51 0063 0x33 | S
83 0123 0x53 | s
115 0163 0x73
(dc4) 20 0024 0x14 | 4
52 0064 0x34 | T
84 0124 0x54 | t
116 0164 0x74
(nak) 21 0025 0x15 | 5
53 0065 0x35 | U
85 0125 0x55 | u
117 0165 0x75
(syn) 22 0026 0x16 | 6
54 0066 0x36 | V
86 0126 0x56 | v
118 0166 0x76
(etb) 23 0027 0x17 | 7
55 0067 0x37 | W
87 0127 0x57 | w
119 0167 0x77
(can) 24 0030 0x18 | 8
56 0070 0x38 | X
88 0130 0x58 | x
120 0170 0x78
(em)
25 0031 0x19 | 9
57 0071 0x39 | Y
89 0131 0x59 | y
121 0171 0x79
(sub) 26 0032 0x1a | :
58 0072 0x3a | Z
90 0132 0x5a | z
122 0172 0x7a
(esc) 27 0033 0x1b | ;
59 0073 0x3b | [
91 0133 0x5b | {
123 0173 0x7b
(fs)
28 0034 0x1c | <
60 0074 0x3c | \
92 0134 0x5c | |
124 0174 0x7c
(gs)
29 0035 0x1d | =
61 0075 0x3d | ]
93 0135 0x5d | }
125 0175 0x7d
(rs)
30 0036 0x1e | >
62 0076 0x3e | ^
94 0136 0x5e | ~
126 0176 0x7e
(us)
31 0037 0x1f | ?
63 0077 0x3f | _
95 0137 0x5f | (del) 127 0177 0x7f

Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

11

What is a Microprocessor?
The title for the class is Microprocessors so, what
is a microprocessor?
For our purposes, a microprocessor is a device built
of digital logic circuitry used for storage and
automated manipulation of data under control of a
predetermined sequence of instructions.
For this class, we will begin with a description and
understanding of the microprocessor itself and
expand to how we can make a microprocessor
perform a variety of tasks as part of a system.
Much of the focus will be involved with how we
connect the microprocessor to other equipment and
make them interact.
Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

12

General Purpose vs. Embedded


Microcomputers
A Windows-based PC is a general-purpose
microcomputer. It is intended to execute a wide
variety of applications.
Conversely, an embedded microcomputer is
typically intended to perform a single function,
often related to the control of a piece of peripheral
hardware.

Digital clock
Microwave oven controller
Automotive ignition monitor
Portable CD player
The singing fish on your neighbors living room wall

Most of the applications for this class would be


best categorized as embedded microcomputer
systems based around a single microprocessor.
Dr. William A. Stapleton

Texas State University - San Marcos, Ingram School of Engineering

EE 3420: Microprocessors

13

Why focus on embedded


systems?
An article by Jim Turley on www.embedded.com
called The Two-Percent Solution sums the
situation up nicely.
Of all of the microprocessors sold annually, less
than 2% are 32-bit (or larger). The vast majority
(over 70%) are 8-bit.
Of the 32-bit (and larger) processors,
approximately 2% are used in personal computers
(PCs and Apples) and the remainder are used as
dedicated controllers.
So, only 2% of 2% (0.04%) of all microprocessors
are used in general-purpose computers, all the rest
(99.96%) are used in embedded systems.
If you are going to be employed as a programmer
or University
systems
theof Engineering
probability is that
youA. Stapleton
Dr. William
Texas State
- San developer,
Marcos, Ingram School

EE 3420: Microprocessors

14

Programming a
Microprocessor
The programming prerequisite for EE 3420, CS 1428,
presented you with a high-level view of a computer when
programming. Programming languages such as C++ or JAVA
are high-level languages. In high-level languages, the user
specifies the overall actions that are to take place and the
compiler translates these commands into a long series of
very simple logical and arithmetic steps.
In EE 3420, we will predominantly program from a lowlevel perspective. We will work directly with the series of
simple logical and arithmetic steps. This allows us a far
greater degree of control over what the hardware is doing.
This degree of control is helpful when using the
microprocessor to control various peripherals.
While ANSI C is predominantly a high-level language, it
allows for a low-level perspective with certain carful
programming practices.
Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

15

Which Microprocessor?
For this class, we will be using a microprocessor
from Freescale Semiconductor based on the ARM
architecture.
Specifically, the boards used in this class are all
based around the Freescale MKL46Z256VLL4
microprocessor.
This is a member of the Kinetis L-series
processors.
For brevity, this is often shortened to just KL46Z.
We will be using two different boards based around
the KL46Z in the laboratory
The Freescale Freedom KL46Z (FRDM-KL46Z)
The Freescale Tower KL46Z (TWR-KL46Z)
Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

16

Freedom KL46Z
This is the Freedom KL46Z (FRDM-KL46Z). This is
a low-cost platform with limited built-in peripherals.

Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

17

Tower KL46Z
This is the Tower KL46Z (TWR-KL46Z). This is a
module in the larger tower system which includes
numerous capabilities which the Freedom boards
lack. These are consequently more expensive.

Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

18

FRDM-KL46Z and TWRKL46Z

Freescale Semiconductor has donated 12 TWRKL46Z systems and 48 FRDM-KL46Z systems to the
department.
The TWR-KL46Z systems will remain in the
laboratory.
Each of you will be allowed to check out a FRDMKL46Z which you may carry with you to use for
developing your code at your convenience. These
will be returned to the department at the end of the
semester.
If you wish to purchase your own FRDM-KL46Z, they
are inexpensive (typically around $20).
Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

19

Programming tools
There are a number of programming tools available
for the KL46Z microprocessor. Two that we will
explore are Freescales Knetis Design Studio and
ARMs mbed.org online toolset
Kinetis Design Studio is based around the Eclipse
programming environment with the appropriate
libraries for our CPU. This is a fully-featured toolset
capable of interacting with every aspect of the
KL46Z. You may download Kinetis Design Studio
directly from Freescale or from our TRACS site.
ARMs mbed.org online toolset works with ARM
processors from a number of vendors, including the
Freedom KL46Z from Freescale. This toolset is
somewhat simpler to use than Kinetis Design Studio
Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

20

Numerical fluency
Before we go further:

EVERYONE needs to be fluent in


decimal, binary, and hexadecimal
representations of numbers!
Everyone should be able to represent negative
numbers using twos complement format in binary.
You should be able to convert freely among these
number bases and be able to represent numbers in
any base with equal success.
You should be able to perform simple arithmetic
(addition, subtraction, multiplication, and division) in
any of these bases.
If you are not able to do these things, youDr.need
to
William A. Stapleton
Texas State University - San Marcos, Ingram School of Engineering

EE 3420: Microprocessors

21

How to write numbers in


various
bases
Decimal
Binary
Octal
Hexadecim
al
Common math book text
format

42 or
4210

1010102

528

2A16

Dr. Stapletons preferred


text format

42 or
42ten

101010tw

52eight

2Asixteen

42

None

052

0x2A

ANSI C language style

All of the numerical examples above are the number forty-two

Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

22

Metric notation
The metric system of notation is a decimal system,
based on successive powers-of-ten
Binary notations are based on powers-of-two.
The fact that 103 (1000) and 210 (1024) are close in
value has led to common usage of various decimal
metric prefixes when speaking of binary quantities.
This practice leads to ambiguity. For instance a
kilobyte generally refers to the binary count of 210
(1024) bytes but may refer to an actual kilo or 103
(1000) bytes.
To address this ambiguity, the International
Standards Organization (ISO) has proposed a set of
binary prefixes as part of Systeme Internationale
(SI), a. k. a. the metric system.

Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

23

The binary prefixes


Common usage has applied kilo (103) to
approximate 210
The proper prefix is kibi for kilo-binary to mean
exactly 210
Common usage has applied mega (106) to
approximate 220
The proper prefix is mebi for mega-binary to
mean exactly 220
Common usage has applied giga (109) to
approximate 230
The proper prefix is gibi for giga-binary to mean
Dr. William A. Stapleton
Texas State
University
- San Marcos, Ingram School of Engineering
exactly
230

EE 3420: Microprocessors

24

Prefix Table
Prefix 10N Value
kilo

103

1,000

Prefi
x

mega

106

1,000,000

kibi

210

1,024

mebi

220

1,048,576

gibi

230

1,073,741,824

tebi

240

1,099,511,627,776

pebi

250

1,125,899,906,842,624

exbi

260

1,152,921,504,606,846
,976

giga
tera

109
101

101

Value

1,000,000,000
1,000,000,000,000

peta

2N

1,000,000,000,000,000

exa

101
8

1,000,000,000,000,000
,000

Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

25

Do you remember these?


D

Enable

Q
In

Out

CLK

Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

EE 3420: Microprocessors

26

Register
Register
Output
Enable

OUT

OUT

OUT

OUT

Q
CLK
D

Q
CLK
D

Q
CLK
D

Q
CLK
D

IN

IN

IN

IN

Register
Input
Clock

Texas State University - San Marcos, Ingram School of Engineering

Dr. William A. Stapleton

Vous aimerez peut-être aussi