Unit-1 (Module-1)
Introduction to Microcontroller
4th Semester – EC
Academic Year : 2019-20
Dr. Rajendra Patel
Department of Electronics and Communication
Engineering, MEFGI
Syllabus Topics
• Microprocessors vs. Microcontrollers
• Microcontroller based Embedded Systems
• Microcontroller vs. Embedded processors
• Requirements of an Embedded Processors
• Major 8-bit Microcontrollers
• RISC vs. CISC Design Philosophy
• Selection Criteria for Microcontroller
MICROPROCESSORS,
MICROCONTROLLERS
AND
EMBEDDED PROCESSORS
Microprocessor vs. Microcontroller
General Purpose Computer System vs. Special Purpose System - ???
Special Purpose System also known as Embedded Systems - ???
Microcontroller based Embedded Systems
HOME OFFICE AUTOMOTIVE
• TV • Telephones • Engine Firing Control
• Set Top Box • EPABX • Air Bag
• Gym Instruments • Copier • ABS
• Digital Camera • Printer • Infotainment Systems
• Camcoder • Access Systems • Keyless Entry
• Sewing machine • Fax Machine • Cruise Control
• Security System
• Lighting Systems MEDICAL DEFENSE
• Pagers • Diagnosis (CT • Missile Guiding System
Scan, MRI, Ultra • Automatic Weapons
sound) • Ranging
• Robotic Surgery • Spying
Migration
Microcontroller vs. Embedded Processors
Microcontrollers are mainly 8bits
Certain Embedded Systems need –
• High processing power
• Ability to get connected with number of devices
• Large memory due to large applications
• Extreme low power
Processors evolved to address above needs are known as
Embedded Processors
Manufacturer of general purpose processors also targets
higher-end Embedded Market.
• Intel, Freescale Semiconductor, AMD, IBM (Power PC), ARM
Requirement of Embedded Processors
Embedded processors must have one or more of the
following features
• Extreme low power
• Reasonably good processing power (16/32 bits)
• Lots of IOs
• Moderately sized Code and Data memory
• Must support variety of communication protocols
Major 8 Bits Microcontrollers
• 68HCXX from Freescale Semiconductor (i.e.
Motorola)
• AVR from Atmel
• Z8 from Zilog
• PIC from Microchip Technology, USA
• 8051 from INTEL
Selection of
Microcontroller/Embedded Processor/MCU
Major selection criteria are –
1. Meeting the computing needs of the task at
hand efficiently and cost effectively
– Speed, size of memory, #of IOs, Communication
protocols supported, power consumption, unit cost
2. Availability of software and hardware
development tools (e.g. Compilers, Assemblers,
Debuggers, Emulators, etc.)
3. Wide availability and sources of microcontroller
– OEM + other suppliers
What is CISC?
• Instructions are complex
• Complex instructions need complex hardware
– Micro-codes are required
• Number of instructions are more
• Supports variety of addressing modes
• Instructions are of variable MCs
• Pipelining architecture is inefficient
– Difficult to implement
• Complexity is in HW, not is SW
– Writing programs is easy
• Development of compilers is easy
RISC Design Philosophy
• All instructions should be Single cycle → Efficient
Pipelining → Improved performance
• Less Number of Instructions → Simple Instruction
Decoder → Less Silicon Space → More Space For
Increased # of On-chip CPU Register → More Run Time
Variables Can Be Stored On-chip → Faster Performance
• Fixed Length Instructions → Boundaries of Source And
Destination Operands Are Fixed → Allows Efficient
Instruction Decoding And Scheduling Of Instructions →
Simpler Instruction Decoder → More Available Si Space
for Register and Peripherals → SoC is possible
RISC Design Philosophy Cont…
• Only load-store operations with memory -- ALU operations are
Register-to-Register → on-chip → ALU operations are faster →
Faster Performance
• Most instructions employs Register addressing mode due to R-to-R
operations -- Only LOAD/STORE instructions employ memory
addressing mode → Simple instructions → simple processor
architecture → Rapid development in RISC processors
• Simple instructions → possible to implement only in HW → No
microcodes → Better performance
• Complexity lies in SW, not in HW
– Writing programs with limited instructions requires expertise
– High Level (C, C++) Instruction statement maps to multiple RISC instructions
→ Need smarter compiler → Not available during 1970-1990 → reason for
RISC to be less popular in 1970-1990
CISC vs. RISC
CISC vs. RISC by Example
CISC Approach
• Multiplying two numbers can be completed with one
assembly instruction
– MULT 2:3, 5:2
• It operates directly on the processor’s memory banks and
doesn’t require programmer to explicitly call any
loading/storing instructions
• Advantage : Compiler has to do little work to translate a
HLL statement into assembly → compilers are simple but
hardware is complex → not viable to implement each
instruction in HW → Microcodes are used
• Length of the code is short → Requires less Prog. Mem.
CISC Processor Design
• CISC is the ISA in which each instruction can
execute several low-level operations,
– load from memory – ALU operation – memory Store,
all in one instruction
• CISC processors are easy to program and make
efficient use of program memory
• Design Philosophy
– Uses MICROCODES
– Uses rich instruction set
– Build high level instruction set
CISC Processor Design
• MICROCODES
– In microcode based system, processor has some built
in memory (ROM) that contains groups of microcode
instructions which corresponds with each machine-
level language instruction
– Microcode memory is much faster than processor
main memory
– It offers hardware reuse with very less performance
penalty compared to hardwired processors
RISC Approach
• The “MULT” command can be divided into:
LOAD A, 2:3
LOAD B, 5:2
PROD A, B
STORE 2:3, A
• Requires only 1 cycle to execute each of the
instruction, except LOAD/STORE
• Higher Level Statement (C, C++) maps to multiple
assembly instructions → Intelligent compiler is
required → complexity is at compiler level