Microprocessor Based Embedded System: WWW - Engr.usask - ca/classes/CME/331
Microprocessor Based Embedded System: WWW - Engr.usask - ca/classes/CME/331
Microprocessor based
Embedded System
www.engr.usask.ca/classes/CME/331
KHAN WAHID
2015-16 (Term 1)
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 2
Course Objective
Learning Outcome
Upon successfully completing this course, the students will be able to:
1. Understand the architecture of a general purpose microcontroller and ARM7
microprocessor and be familiarized with Stellaris LaunchPad and its
peripherals
2. Use different components in a microcontroller such as, PWM, A/D, Timer,
interrupt, serial communication, etc. to perform specific tasks
3. Interface a microprocessor with other external devices or components such as,
keypad, switches, LCD display, motor, analog sensors, etc.
4. Write both assembly and C code to program a microprocessor
5. Design a small to medium size embedded system with a microprocessor (such
as, pedestrian controller, traffic display system, digital temperature logger, and
similar)
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 4
Source: Designing Embedded Systems with PIC Microcontrollers: Principles and Applications, Tim Wilmshurt
Source: The Quintessential PIC® Microcontroller, Sid Katzen, 2nd edition, 2005, ISBN: 978-1-85233-942-5
Graphic
2 pots LCD
Stepper motor
driver 4x4 keypad
interface
The development board has LM4F120 LaunchPad, 7-segment display with driver, LCD display,
Stepper motor driver and intereface, 2 pots, and 4x4 keypad interface – all wired physically
https://www.engr.usask.ca/classes/EE/331/WebNotes_2014/Drawing_dev_board.pdf
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 6
A[31:0] control
address register
PC
register
bank
instruction
decode
A multiply &
L register
U control
A B
b
u b b
s u u
s barrel s
shifter
ALU
D[31:0]
ARM Architecture
Source: ARM System-on-chip Architecture, Steve Furber, 2nd edition, 2000
Lecture 1
CME331: Microprocessor
Microprocessor: Introductory Concepts
KHAN WAHID
2015-16 (Term 1)
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 9
Most embedded systems do not have keyboard, monitor (display), and/or extra memory
(hard disk)
These days embedded systems are everywhere, appearing in the home, office, factory, car,
hospital, etc.
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 10
As shown in the figure, the term embedded microcomputer system refers to a device that
contains one or more microcomputers inside
Microcontrollers, which are microcomputers incorporating the processor, RAM, ROM and
I/O ports into a single package, are often employed in an embedded system because of their
low cost, small size, and low power requirements
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 11
Source: Designing Embedded Systems with PIC Microcontrollers: Principles and Applications, Tim Wilmshurt
Embedded System
Auto Tracking Robot
A robot (moving machine) that follows a black
line automatically
How to design the hardware?
Problem description, resource budget, H/W
assembly, programming, testing
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 14
Embedded System
Autonomous Guided Vehicle (AVG)
Source: Designing Embedded Systems with PIC Microcontrollers: Principles and Applications, Tim Wilmshurt
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 15
Source: The Quintessential PIC® Microcontroller, Sid Katzen, 2nd edition, 2005, ISBN: 978-1-85233-942-5
Embedded System
Doorbell with MP3 Player [Kyle Weisgarber,
Craig Lytle, Curtis Flavel]
Two door bells, with MP3 player, displays on 7-
segment (how many times bell pushed)
Problem description, resource budget, H/W
assembly, programming, testing
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 18
What is a Microprocessor?
The microprocessor (MPU) is the integration of a number of
useful functions into a single IC package:
The ability to execute a stored set of instructions to carry out user defined
tasks
Source: http://mic.unn.ac.uk/miclearning/modules/micros/ch1/micro01hist.html
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 19
Source: http://mic.unn.ac.uk/miclearning/modules/micros/ch1/micro01hist.html
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 20
In 1974 the more powerful second generation microprocessor (the 8008) was announced
fabricated as a single chip. This was quickly followed by the Intel 8080.
At about the same time Motorola released its first microprocessor, the 6800, which was also
an 8 bit processor with about the same processing power as that of the Intel 8080.
The architectures used in the Intel 8080 and the Motorola 6800 were very different.
In due course the Intel 8080 core processor was used for a range of microcontrollers (8048
and 8051 to name but two).
Motorola followed in a similar vein with a range of microcontrollers based on the 6800
(6805, 6808, 6811 which survive to this day).
Source: http://mic.unn.ac.uk/miclearning/modules/micros/ch1/micro01hist.html
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 21
Like a microprocessor, a
microcontroller needs to be able
to compute also, though not
necessarily big numbers
Source: Designing Embedded Systems with PIC Microcontrollers: Principles and Applications, Tim Wilmshurt
Microcontroller Family
Manufacturer’s Microcontroller Portfolio:
Source: Designing Embedded Systems with PIC Microcontrollers: Principles and Applications, Tim Wilmshurt
Microcontroller Family
Manufacturer’s Microcontroller Portfolio:
Advantages:
Because the core is fixed for
all members of one family, the
instruction set is fixed
So, users have little difficulty
in moving from one family
member to another
Our focus in
Designing an Embedded System: this course
Programming Microprocessor Vs. Designing Digital Circuit
Motion-at-night detector
Programmed Custom designed
microprocessor digital circuit MPU a common
choice to implement
a digital system
Easy to program /
re-program
Cheap (as low as
$1)
Widely available
void main()
{
while (1) {
P0 = I0 && !I1;
// F = a and !b,
}
}
Microcontroller Applications
Industrial Control: motors, factory automation, tools,
robotics, test equipment, networks
http://www.mips.com/everywhere/microcontrollers/
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 27
History of Computers
Microcontroller Market
Microcontroller manufacturer > 40 suppliers
STMicro > 50 architectures
Texas Instruments US$44 Billion market
Renesas Shipments: 10 Billion in 2007
Analog Devices Major Players:
Atmel
Freescale (ex. Motorola)
Hitachi Semiconductor
Intel
Microchip
National Semiconductor
Dallas Semiconductor
…
ARM Market: http://www.arm.com/markets/embedded/index.php
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 29
Asia, 37%
North America , 25%
Europe , 28%
http://www.emittsolutions.com/images/microcontroller_market_analysis_2008.pdf
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 30
http://eetimes.com/news/latest/showArticle.jhtml?articleID=216500727&pgno=5
Depends on what you
http://www.openicon.com/confsums/mchp_main.html
are doing…
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 31
AVR Microcontroller
- A much more modern MCU which was
developed in 1996
- Better architecture than PIC
- Can be programmed with Public
Domain "C" compiler
- More powerful than PIC but not many
variations for built-in functions
- Almost as cheap as PIC
http://eetimes.com/news/latest/showArticle.jhtml?articleID=216500727&pgno=5
PIC vs. AVR
http://www.openicon.com/confsums/mchp_main.html http://www.ladyada.net/library/picvsavr.html
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 32
ARM Cortex-M0
http://www.electronics-eetimes.com/en/arm-cortex-m0-based-32-bit-mcus-for-cost-
sensitive-motor-and-lcd-control.html?cmp_id=7&news_id=222909083#
http://eetimes.com/news/latest/showArticle.jhtml?articleID=216500727&pgno=5
http://www.openicon.com/confsums/mchp_main.html
A4 chip drives AppleTV, iPod Touch (Sep 1, 2010)
http://www.eetimes.com/electronics-news/4207280/A4-drives-AppleTV-iPod-Touch
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 33
Current Trends
The Asia Pacific region is the largest and highest growth market for MCU,
and the Chinese automotive industry has been identified as a major driver
Over 80 percent of MCU revenue comes
from industrial and automotive market
applications
The higher resolution 32-bit
microcontrollers are showing the most
growth in units shipped, but there are
considerable opportunities to be found
for the lower resolution products as well
www.electronics.ca/presscenter/articles/1364/1
www.frost.com/prod/servlet/market-insight-top.pag?docid=191547329
www.marketreports.com/Sample/Global_Data/GBISC007MR_sample.pdf
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 34
“The 8-bit MCUs are the mainstay and vital to the processor
ecosystem; they initiate the use of digital electronics in a
wide array of applications,” says the analyst of this research.
“For many new system designs and applications, 8-bit
MCUs are still considered an ideal choice.”
Atmel products:
http://www.atmel.com/products/microcontrollers/arm/
Acknowledgments
These slides have been prepared by Khan Wahid and may
contain material copyrighted by:
Krste Asanovic (University of California, Berkley)
Designing Embedded Systems with PIC Microcontrollers:
Principles and Applications, Tim Wilmshurt, 2007, ISBN: 978-
0750667555
Digital Design, Frank Vahid, 1st ed, 2006
The Quintessential PIC® Microcontroller, Sid Katzen, 2nd edition,
2005, ISBN: 978-1-85233-942-5
Jonathan W. Valvano, http://users.ece.utexas.edu/~valvano