0% found this document useful (0 votes)
212 views36 pages

Microprocessor Based Embedded System: WWW - Engr.usask - ca/classes/CME/331

lec 1

Uploaded by

MahirChoudhury
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)
212 views36 pages

Microprocessor Based Embedded System: WWW - Engr.usask - ca/classes/CME/331

lec 1

Uploaded by

MahirChoudhury
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/ 36

CME 331

Microprocessor based
Embedded System
www.engr.usask.ca/classes/CME/331

Location: 2B53, Engineering Building


Class Schedule: Lecture – MWF (12.30pm – 1:20 pm)

KHAN WAHID
2015-16 (Term 1)
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 2

Course Objective

Covers the architecture and operation of microcontrollers used in


embedded systems. The course focuses on hardware and software
techniques used to program a microcontroller and interface it
with external devices.

Emphasis is placed on using both assembly language and C to


program the microcontrollers. Microcontroller architecture is
discussed in general with certain internal peripherals discussed in
detail.
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 3

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

Architecture & Operation


CME 331: Microprocessor K. WAHID (2015-16 Term 1) 5

Labs using Development Board


7-seg
LaunchPad display

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

Labs using LauchPad and Development


Board
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 7

A[31:0] control

address register

Architecture & Operation P


C incrementer

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

data out register data in register

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

Microprocessor-based Embedded System


(sec 2.1, p.48 txt)
 What is an embedded system?
 The definition is simple – “embedded” system means “hidden” system
 An engineering product that needs control, and if a computer/processing engine
is incorporated to undertake the control, is known as embedded system

 “A system whose principal function is not computational, but which is


controlled by a computer embedded within it.”
Source: Designing Embedded Systems with PIC Microcontrollers: Principles and Applications, Tim Wilmshurt, 2007, ISBN: 978-0750667555

 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

Microprocessor-based Embedded System


(sec 2.1, p.48 txt)
 The term “micro” means small,
and a “computer” contains a
processor, memory, and a
means to exchange data with
the external world. The word
“system” means multiple
components interfaced together
for a common purpose

 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

Microprocessor-based Embedded System


 Examples of embedded system:

For more examples,


see sec 2.2, p.52 txt
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 12

Types of Embedded Systems


 Type 1: Microprocessor based embedded systems
 Software is developed using assembly, C, etc.
 No operating system
 Low-cost, low-performance (uses ARM Cortex-M series)
 Real-time operating system is developed
 High-performance (uses ARM Cortex-A series)
 First designed on a development platform and then software and hardware are
migrated to a stand-alone embedded platform

 Type 2: DSP-based embedded systems

 Type 3: FPGA-based embedded systems


CME 331: Microprocessor K. WAHID (2015-16 Term 1) 13

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

Embedded System – Car Odometer


 Consider a car odometer monitoring system that displays
two things: (a) total distance since manufactured and (b) a
trip odometer
Resource Budget (List of subsystem):
1. An edge-triggered input for the tachometer pulse train to
add up engine revolutions
2. Gear ratio, mi/km option and trip reset

3. Four output digital lines to clock the two shift registers


and provide segment data

4. An MPU to do the calculations and to read/write to the


input/output ports
5. Program memory, usually ROM of some kind
6. Data memory for temporary storage of program
variables, usually static RAM Any improvements?
7. Non-volatile memory to store physical variables
Any improvements?
Source: The Quintessential PIC® Microcontroller, Sid Katzen, 2nd edition, 2005, ISBN: 978-1-85233-942-5
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 16

Source: The Quintessential PIC® Microcontroller, Sid Katzen, 2nd edition, 2005, ISBN: 978-1-85233-942-5

E3.1 – Greenhouse Environment Controller


 A greenhouse controller is to monitor an analog signal from a soil moisture
probe and if below a certain value turn on a water valve for 5 seconds and
off for 5 seconds.
Resource Budget (List of subsystem):
1. An input for an external oscillator, connected to a counter/timer to
allow the MCU to calculate time. In practice the system clock can
often be used by this internal timer to measure duration.
2. A 1-input analog input line to measure the analog signal from the
moisture detector
3. A 1-input digital line to check the level of the reservoir water tank
4. A 1-output digital line to open and close the water valve
5. A 1-output digital line to activate the buzzer alarm
6. A microprocessor to do the calculations and to read/write to the
input/output ports, respectively
7. Program memory, usually ROM of some kind
8. Data memory for temporary storage of program variables, usually
static RAM

HW: MCU controlled robot to cross a road


CME 331: Microprocessor K. WAHID (2015-16 Term 1) 17

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

 The ability to be able to


access external memory
chips to both read and write
data from and to the
memory

Source: http://mic.unn.ac.uk/miclearning/modules/micros/ch1/micro01hist.html
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 19

Microprocessor vs. Microcontroller


 What is a Microprocessor (MPU)?
 A single LSI chip (around 10k transistors), known as Central
Processing Unit (CPU), to perform all computation (without memory
and I/O interface circuit)

 The first microprocessors appeared in Nov 1971 (Intel 4004)


 For the first time a computer CPU was put onto a single IC
 All other functions, like memory and I/O interfacing, were outside the
microprocessor (MPU)
 Gradually, different memory types have been added on to the same chip
 CPU became more powerful and faster (from 8-bit to 16- and 32-bit)

World’s first general purpose 8-bit


microprocessor: Intel 8080 (April 1974)

Source: http://mic.unn.ac.uk/miclearning/modules/micros/ch1/micro01hist.html
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 20

A Brief History of Microprocessors


 The first microprocessor was developed by what was then a small company called Intel
(short for Integrated Electronics) in the early 1970s. The chipset was a success and within a
short while Intel developed a general purpose 4 bit microprocessor called the 4004.

 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

Source: PIC Microcontrollers, Milan Verle, free online


(www.mikroe.com/en/books/picmcubook/)

Microprocessor vs. Microcontroller


 What is a Microcontroller (MCU)?
 A microcontroller differs from a microprocessor in many ways
 A system where microprocessor along with memory, I/O, and other
necessary functionalities are added for control activities mainly – all
integrated into a single chip

 Like a microprocessor, a
microcontroller needs to be able
to compute also, though not
necessarily big numbers

 Now the microcontroller has taken


over the role of the embedded
computer in embedded systems
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 22

Source: Microprocessors/Microcontrollers – Course Notes, Delmar Cengage Leaning, ISBN: 1435453816

Microcontroller – A Generic View


 Essentially, it contains a simple
microprocessor core, along with all
necessary data and program memory

 To do this, it adds all the peripherals


needed to do the interfacing

 These may include digital and


analog input and output, or counting
and timing elements

Microcontroller = Microprocessor core + Memory + Peripherals


CME 331: Microprocessor K. WAHID (2015-16 Term 1) 23

Source: Designing Embedded Systems with PIC Microcontrollers: Principles and Applications, Tim Wilmshurt

Microcontroller Family
 Manufacturer’s Microcontroller Portfolio:

 A manufacturer builds a MCU


family around one fixed
microprocessor core
 But different combinations of
memory and peripherals

 It has several advantages…

Microcontroller = Microprocessor core + Memory + Peripherals


CME 331: Microprocessor K. WAHID (2015-16 Term 1) 24

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

 Example: TM4Cxxxx, TMS470M,


AM5K2Ex, etc.
 All MCU in TM4C series have the
same MPU core (ARM
CortexM4F)
http://www.ti.com/lit/sg/spmt285a/spmt285a.pdf

Microcontroller = Microprocessor core + Memory + Peripherals


CME 331: Microprocessor K. WAHID (2015-16 Term 1) 25

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,
}
}

Source: Digital Design, Frank Vahid, 1st ed, 2006


http://www.cs.ucr.edu/~vahid/dd
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 26

Microcontroller Applications
 Industrial Control: motors, factory automation, tools,
robotics, test equipment, networks

 Office Automation: printers, plotters, copiers, hard disk


drives

 Home Appliances: white goods, home automation, security

 Consumer Electronics: TVs, DVD players, digital cameras, personal


media players

 Security: Smart cards, SIM cards, mobile phones, biometrics

 Automotive: convenience systems, safety, powertrain, infotainment

http://www.mips.com/everywhere/microcontrollers/
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 27

History of Computers

 History of Computers – 1 (Prof. Dr. Miroslaw


Malek, pdf)

 History of Computers – 2 (Timeline of Computing


History, pdf)

From class website (under 2010 lecture notes)


CME 331: Microprocessor K. WAHID (2015-16 Term 1) 28

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

Microcontroller Market (2007)


US$ (in Billions)

8-bits, 3.8, 30%


32-bits, 4.9, 39%

16-bits, 3.9, 31%


Percentage of share

Rest of the World , 10%

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

Microcontroller Market (2008)


 As a result of its recent merger
with NEC, Renesas has become
even more dominant in the
microcontrollers product area,
perhaps owning up to one-
quarter of the market now

Which one is the


“best” MCU?

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

Microcontroller Market (2008)

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

Microcontroller Market (2008)


ARM Processor
- Becoming increasing popular in industry
- Recently, focus shifted more towards
advanced computation
- Very efficient chip with high speed and
low power consumption
- In fact, the ARM Cortex™-M0 processor
is one of the smallest and most energy-
efficient MPU available today
- ARM processors are widely used in cell
phones, especially in all Apple iPhone and
iPods

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

Microcontroller Market (2011)


 Microcontroller market forecasted to reach over $16 billion
worldwide in 2011 (was $10 billion in 2007)

 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

Microcontroller Market (2011)


 Recent research (by Frost & Sullivan in N714-26 Strategic Analysis of the Global
Microcontrollers Market) indicates that this market is expected to grow at 5.5 percent from
2009 to 2013
 8-bit MCU rules the Southeast Asian Electronics Industry.
The presence of newer applications in markets such as
medical electronics, automotive, and consumer electronics,
which require MCUs that offer low-cost solutions and deliver
on performance, functionality, and connectivity, have created
a huge market for 8-bit MCUs.

 “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.”

 The 16-bit and 32-bit MCUs will be driven by automotive,


high-end consumer products, and industrial controls
http://www.frost.com/prod/servlet/market-insight-top.pag?docid=191547329
http://www.researchandmarkets.com/reportinfo.asp?report_id=835349&tracker=related
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 35

Some vendors for ARM…


 Texus Instruments:
 http://www.ti.com/lsds/ti/arm/overview.page

 Atmel products:
 http://www.atmel.com/products/microcontrollers/arm/

 Keil tool chain and products:


 http://www.keil.com/boards/cortexm.asp
CME 331: Microprocessor K. WAHID (2015-16 Term 1) 36

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

You might also like