You are on page 1of 55

ECE3003 – MICROCONTROLLERS AND APPLICATIONS

• Introduction to Microprocessors
and Microcontrollers, 8-bit/16-bit
Introduction to Microprocessor Architectures
Processors [8085, 8086], Introduction to
ARM7, Intel I (i3, i5, i7)series
processors
1
Internal organization of computing device
Module - 1 ECE3003–Microcontroller and Applications 2
CPU
❑ Fetch, decode and executes the instruction stored in memory
❑ CPU must equipped with necessary resource
❑ Important resources of CPU:
❑ Registers – to store the information temporarily
❑ ALU – to carryout Arithmetic and Logical operation
❑ Program Counter – to point the next instruction to be
executed. Instruction decoder – to interpret the
instruction fetched into the CPU
Module - 1 ECE3003–Microcontroller and Applications 3
MEMORY
❑ One of the important feature
❑ Binary digits : 0’s and 1’s
❑ Bit: 0 or 1
❑ Nibble: 4-Bits or half a byte – ex: 0101
❑ Byte: 8-Bit or Byte – ex: 1010 0101
❑ Word : 16-bits – ex: 1111 0000 1010 0101
❑ Kilo Byte: 210 = 1024 bytes, Mega : 220, Giga : 230, Tera : 240
❑ Ex: 16 Megabyte = 16 x 220 = 24 x 220 =224 Bytes
❑ Memory Types: RAM & ROM
❑ RAM or Volatile Memory : Temporary storage
❑ ROM or Non-volatile Memory : Permanent storage

Module - 1 ECE3003–Microcontroller and Applications 4


Input and outputs
❑ I/O devices used to provide a communication with CPU via
keyboard, video monitor etc.,
Buses
❑ CPU is connected through stripes of wires called Buses

❑ Address bus: To indentify the device connected to CPU. Total


number of memory location addressable by a CPU is 2x, where x
is the number of bits.

❑ Data Bus: To carry info. in and out of CPU, 8-bit to 64-bit

❑ Control bus: To provide the read or write signal to CPU


Module - 1 ECE3003–Microcontroller and Applications 5
Steps to execute an instruction
1. Fetch Instruction from Memory

2. Decode Instruction and Fetch Operands

3. Perform ALU Operations

4. Store ALU result to register file

5. Memory Access (for load/store)

6. Update PC
Module - 1 ECE3003–Microcontroller and Applications 6
7
❑ The short term of the microprocessor is uP, and it is a central
processing unit.

❑ A Microprocessor is used to make many tasks like arithmetic and


logic operations, system controlling & storing the data, etc.

❑ It will process the I/O peripheral data and gives the results back
to the peripherals to function.

❑ In the year 1968 the first microprocessor was developed by


Garrett Research’s .But, the commercial microprocessor was
released in the year 1971 which is termed as 4004.

Module - 1 ECE3003–Microcontroller and Applications 8


Microprocessor – Block Diagram
Module - 1 ECE3003–Microcontroller and Applications 9
❑ Microprocessor has several support devices like ROM, Read
write memory, timer, serial interface, I/O ports, etc.

❑ All these support devices are interfaced to the


microprocessor through a system bus.

❑ So finally we can conclude that all support devices in a


microprocessor are connected externally.

❑ The system bus consists of an address bus, control bus and


data bus.

Module - 1 ECE3003–Microcontroller and Applications 10


Microprocessor Based Temperature Monitoring System
Module - 1 ECE3003–Microcontroller and Applications 11
❑ A microcontroller is a computer on a chip in which many
support devices like RAM, ROM, timers, counters, I/O
peripherals are fixed in one IC.

❑ Microcontrollers is mainly designed to control


specific electronic applications. Microcontroller is a heart of
an embedded system. The short term of the microcontroller
is MCU or uC.

❑ Microcontroller can be easily interfaced to external


peripheral devices like ADC, DAC, serial ports, Bluetooth,
Wi-Fi, etc.
Module - 1 ECE3003–Microcontroller and Applications 12
MICROCONTROLLER BLOCK DIAGRAM
Module - 1 ECE3003–Microcontroller and Applications 13
❑ A microcontroller is a computer on a chip in which many
support devices like RAM, ROM, timers, counters, I/O
peripherals are fixed in one IC.

❑ The short term of the microcontroller is MCU or uC.


Microcontroller is a heart of an embedded system.

❑ Microcontroller can be easily interfaced to external


peripheral devices like ADC, DAC, serial ports, Bluetooth,
Wi-Fi, etc.
Module - 1 ECE3003–Microcontroller and Applications 14
❑ Examples of the microcontrollers are microchip’s PIC, Intel’s
80196, The 8051, Motorola’s 68HCxx.

❑ Microcontrollers is mainly designed to control


specific electronic applications.

❑ Microcontrollers are normally found in toys, office machines,


automobiles, home appliances, etc.

❑ The applications of microcontrollers involve in various


embedded system projects and electronics projects.

Module - 1 ECE3003–Microcontroller and Applications 15


Microcontroller Based Temperature Monitoring System
Module - 1 ECE3003–Microcontroller and Applications 16
Parameters µP µC
Architecture Von-Neumann and CISC Harvard and RISC
architecture architectures.
Flexibility designer can decide on the amount fixed amount of on-chip ROM,
of ROM, RAM and I/O ports. RAM, I/O ports
Processing Power High Low
Design Time More Less
Power High Low
Protection Less More
Cost High Low
Applications Defense systems, computation Cell phones, watches, mp3
systems and n/w players
communications

Module - 1 ECE3003–Microcontroller and Applications 17


Module - 1 ECE3003–Microcontroller and Applications 18
X86 Architecture ARM, Power PC

Module - 1 ECE3003–Microcontroller and Applications 19


20
❑ The Intel 8085 ("eighty-eighty-five") is an 8-
bit microprocessor produced by Intel and introduced in 1976.

❑ It is software-binary compatible with the more-famous Intel


8080 with only a few minor instructions added.

❑ However, it requires less support circuitry, allowing simpler


and less expensive microcomputer systems to be built.

MODULE - 1 ECE3003–Microcontroller and Applications 21


❑ An improvement over the 8080 is that the 8085 can itself
drive a piezoelectric crystal directly connected to it

❑ A built-in clock generator generates the internal high


amplitude two-phase clock signals at half the crystal
frequency (a 6.14 MHz crystal would yield a 3.07 MHz
clock, for instance).

❑ Both the 8080 and the 8085 were eclipsed by the Zilog
Z80 for desktop computers in the early-to-mid-1980s.

MODULE - 1 ECE3003–Microcontroller and Applications 22


❑ The salient features of 8085 µp are:
➢ It is a 8 bit microprocessor
➢ Six 8-bit general purpose register arranged in pairs: BC,
DE, HL.
➢ Data bus is a group of 8 lines D0 – D7
➢ It has 16-bit address bus and hence can address up to 216
= 65536 bytes (64KB) memory locations through A0-A15
➢ The first 8 lines of address bus and 8 lines of data bus are
multiplexed AD0 – AD7
MODULE - 1 ECE3003–Microcontroller and Applications 23
➢ It supports external interrupt request

➢ A 16 bit program counter (PC)

➢ A 16 bit stack pointer (SP)

➢ It requires a signal +5V power supply and operates at 3.2

MHZ single phase clock.

➢ It is enclosed with 40 pins DIP (Dual in line package).

MODULE - 1 ECE3003–Microcontroller and Applications 24


MODULE - 1 ECE3003–Microcontroller and Applications 25
MODULE - 1 ECE3003–Microcontroller and Applications 26
MODULE - 1 ECE3003–Microcontroller and Applications 27
❑ It consists of five essential blocks.

(1) Arithmetic Logic Section

(2) Register Section

(3) The Interrupt Control Section

(4) Serial I/O Section

(5) The Timing And Control Unit

MODULE - 1 ECE3003–Microcontroller and Applications 28


ARITHMETIC LOGIC SECTION
❑ This section consists of
(a) An arithmetic logic unit (ALU)
(b) Accumulator Register (A)
(c) Temporary Register (TR)
(d) A flag register (FR)

MODULE - 1 ECE3003–Microcontroller and Applications 29


REGISTER SECTION
❑ The 8085/8080A has six general-purpose registers to store 8-bit
data; these are identified as B,C,D,E,H, and L

❑ They can be combined as register pairs - BC, DE, and HL - to


perform some 16-bit operations.

❑ The programmer can use these registers to store or copy data


into the registers by using data copy instructions.

❑ In addition, it has two 16-bit registers: the stack pointer and


the program counter.
MODULE - 1 ECE3003–Microcontroller and Applications 30
INTERRUPT CONTROL SECTION

❑ Interrupt is a mechanism by which an I/O or an instruction


can suspend the normal execution of processor and get itself
serviced.

❑ Generally, a particular task is assigned to that interrupt


signal.

❑ In the microprocessor based system the interrupts are used


for data transfer between the peripheral devices and the
microprocessor.
MODULE - 1 ECE3003–Microcontroller and Applications 31
INTERRUPT CONTROL SECTION

❑ Types of interrupts in 8085: Hardware & Software Interrupts

❑ Software Interrupt: A software interrupts is a particular


instructions that can be inserted into the desired location in
the program. There are eight Software interrupts in 8085
Microprocessor i.e from RST0 to RST7.

❑ Hardware Interrupt: Generated by user externally through


one of the interrupts pins: TRAP, RST5.5, RST6.5, RST7.5,
INTR

MODULE - 1 ECE3003–Microcontroller and Applications 32


SERIAL I/O SECTION
❑ Serial communication is useful for data transfer between two
devices serially.

❑ SID (serial input data) used to accept serial 1 bit data under
software control when a RIM instruction is executed the SID
pin data is loaded in bit D7 of Accumulator

❑ SOD (serial output data) used to transfer 1 bit data under


software control when a SIM instruction is executed the SOD
pin is set or reset depending on D7 and D6 bit of Accumulator

MODULE - 1 ECE3003–Microcontroller and Applications 33


TIMING AND CONTROL SECTION
❑ It provides timing and control signal to the microprocessor to
perform the various operation.

❑ It controls all external and internal circuits. It synchronizes all


the data transfers. It Performs decoding of instruction.

❑ There are three control signal:


1.ALE-Address Latch Enable – Used to Demultiplexing the lower order Address
and Data bus
2.RD- This is active low used for reading operation.
3.WR-This is active low used for writing operation.

MODULE - 1 ECE3003–Microcontroller and Applications 34


35
❑ The Intel 8086 is a 16-bit microprocessor intended to be
used as the CPU in a microcomputer.

❑ The term “16-bit” means that its arithmetic logic unit,


internal registers, and most of its instructions are designed
to work 16-bit binary words.

❑ It has 16-bit data bus and 20-bit address bus.

❑ The 8086 CPU is divided into two independent functional


parts, the bus interface unit or BIU, and the execution
unit or EU.
MODULE - 1 ECE3003–Microcontroller and Applications 36
Features
❑ It is a first 16-bit μp.
❑ 8086 has a 20 bit address bus can access up to 220 =1 MB
❑ It provides 14, 16 -bit registers.
❑ Word size is 16 bits.
❑ It has multiplexed address and data bus AD0- AD15 and
A16 – A19.
❑ It requires single phase clock with 33% duty cycle to provide
internal timing.

MODULE - 1 ECE3003–Microcontroller and Applications 37


❑ 8086 is designed to operate in two modes, Minimum and
Maximum
❑ It can pre-fetches up to 6 instruction bytes from memory
and queues them in order to speed up instruction execution.
❑ It requires +5V power supply.
❑ A 40 pin dual in line package.
❑ Address ranges from 00000H to FFFFFH
❑ Memory is byte addressable - Every byte has a separate
address.

MODULE - 1 ECE3003–Microcontroller and Applications 38


MODULE - 1 ECE3003–Microcontroller and Applications 39
8086 MICROPROCESSOR - ARCHITECTURE
MODULE - 1 ECE3003–Microcontroller and Applications 40
Bus Interface Unit (BIU)
❑ The function of BIU is to:

➢ Fetch the instruction or data from memory.

➢ Write the data to memory.

➢ Write the data to the port.

➢ Read data from the port.

MODULE - 1 ECE3003–Microcontroller and Applications 41


Instruction Queue
1. To increase the execution speed, BIU fetches as many as six
instruction bytes ahead to time from memory.

2. All six bytes are then held in first in first out 6 byte
register called instruction queue.

3. Then all bytes have to be given to EU one by one.

4.This pre fetching operation of BIU may be in parallel with


execution operation of EU, which improves the speed
execution of the instruction.
MODULE - 1 ECE3003–Microcontroller and Applications 42
Execution Unit (EU)
❑ The functions of execution unit are:
➢ To tell BIU where to fetch the instructions or data
from.

➢ To decode the instructions.

➢ To execute the instructions.

MODULE - 1 ECE3003–Microcontroller and Applications 43


Execution Unit (EU)
❑ The EU contains the control circuitry to perform various
internal operations.

❑ A decoder in EU decodes the instruction fetched memory to


generate different internal or external control signals
required to perform the operation. E

❑ EU has 16-bit ALU, which can perform arithmetic and logical


operations on 8-bit as well as 16-bit.

MODULE - 1 ECE3003–Microcontroller and Applications 44


General Purpose Registers of 8086

MODULE - 1 ECE3003–Microcontroller and Applications 45


General Purpose Registers of 8086
❑ These registers can be used as 8-bit registers individually or
can be used as 16-bit in pair to have AX, BX, CX, and DX.

1. AX Register: AX register is also known as accumulator


register that stores operands for arithmetic operation like
divided, rotate. 2

2. BX Register: This register is mainly used as a base


register. It holds the starting base location of a memory
region within a data segment.
MODULE - 1 ECE3003–Microcontroller and Applications 46
General Purpose Registers of 8086

3. CX Register: It is defined as a counter. It is primarily used


in loop instruction to store loop counter.

4. DX Register: DX register is used to contain I/O port


address for I/O instruction.

MODULE - 1 ECE3003–Microcontroller and Applications 47


Instruction Pointer (IP)

❑ In the BIU, the next register, below the segment register is


instruction pointer.

❑ The instruction pointer (IP) holds the 16-bit address of the


next code byte within this code segment.

MODULE - 1 ECE3003–Microcontroller and Applications 48


Flag Register(FR)
❑ A 16-bit flag register is a flip-flop which indicates some
condition produced by the execution of an instruction or
controls certain operations of the EU.

❑ They are modified automatically by CPU after mathematical


operations.

❑ It has 9 flags and they are divided into two categories:


1. Conditional Flags
2. Control Flags
MODULE - 1 ECE3003–Microcontroller and Applications 49
Flag Register(FR)

MODULE - 1 ECE3003–Microcontroller and Applications 50


Control Flags
❑ Control flags are set or reset deliberately to control the
operations of the execution unit.

❑ Control flags are as follows:


➢ Trap Flag (TF)
➢ Interrupt Flag (IF)
➢ Direction Flag (DF)

MODULE - 1 ECE3003–Microcontroller and Applications 51


Conditional Flags
❑ Conditional flags represent result of last arithmetic or logical
instruction executed. Conditional flags are as follows:
➢ Carry Flag (CF)
➢ Auxiliary Flag (AF)
➢ Parity Flag (PF)
➢ Zero Flag (ZF)
➢ Sign Flag (SF)
➢ Overflow Flag (OF)
MODULE - 1 ECE3003–Microcontroller and Applications 52

You might also like