0% found this document useful (0 votes)
25 views23 pages

Microprocessor & Microcontroller Syllabus

The document provides an overview of microprocessors and microcontrollers, detailing their architecture, components, and functionality. It specifically focuses on the Intel 8085A microprocessor, explaining its internal structure, registers, and operational principles. Additionally, it classifies microprocessors based on data bus size, application, and architecture, while also discussing the roles of various CPU components such as the control unit and arithmetic logic unit.

Uploaded by

abhisabhilash190
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)
25 views23 pages

Microprocessor & Microcontroller Syllabus

The document provides an overview of microprocessors and microcontrollers, detailing their architecture, components, and functionality. It specifically focuses on the Intel 8085A microprocessor, explaining its internal structure, registers, and operational principles. Additionally, it classifies microprocessors based on data bus size, application, and architecture, while also discussing the roles of various CPU components such as the control unit and arithmetic logic unit.

Uploaded by

abhisabhilash190
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

Jawaharlal Nehru National college of Engineering, Shimoga MKS

Module-3
Microprocessor & Microcontroller
Syllabus: Microprocessor & Microcontrollers: Introduction, Microprocessor systems, Basic
elements of control systems, Microcontrollers, Difference between Microprocessor and
Microcontrollers. Microprocessor Architecture: Microprocessor architecture and
terminology-CPU, memory and address, I/O and Peripheral devices, ALU, Instruction and
Program, Assembler, Data Registers, Program Counter, Flags, Fetch cycle, write cycle,
state, bus interrupts. Intel’s 8085A Microprocessor.
Note: some of the topics covered in notes are extra. There may be possibility those question
appear in exam.

Introduction, Microprocessor systems


A microprocessor is a programmable electronics chip that has computing and decision
making capabilities similar to central processing unit of a computer. Any microprocessor-
based systems having limited number of resources are called microcomputers.
Nowadays,microprocessor can be seen in almost all types of electronics devices like mobile
phones, printers, washing machines etc. Microprocessors are also used in advanced
applications likeradars, satellites and flights. Due to the rapid advancements in electronic
industry and large scale integration of devices results in a significant cost reduction and
increase application of microprocessors and their derivatives.

Figure-1 : Block Diagram of CPU

1
Jawaharlal Nehru National college of Engineering, Shimoga MKS

A typical microprocessor consists of arithmetic and logic unit (ALU) in association with
control unit to process the instruction execution. Almost all the microprocessors are based on
the principle of store-program concept. In store-program concept, programs or instructions
are sequentially stored in the memory locations that are to be executed. To do any task using
a microprocessor, it is to be programmed by the user. So, the programmer must have idea
about its internal resources, features and supported instructions. Each microprocessor has a
set of instructions, a list which is provided by the microprocessor manufacturer. The
instruction set of a microprocessor is provided in two forms: binary machine code and
mnemonics.
Microprocessor communicates and operates in binary numbers 0 and 1. The set of
instructions in the form of binary patterns is called a machine language and it is difficult for
us to understand. Therefore, the binary patterns are given abbreviated names, called
mnemonics, which forms the assembly language. The conversion of assembly-level language
into binary machine-level language is done by using an application called assembler.

Common CPU components


The central processing unit (CPU) consists of six main components:
1. control unit (CU)
2. arithmetic logic unit (ALU)
3. registers
4. cache
5. buses
6. clock
All the components work together to allow processing and system control.
Control unit (CU)
The CU provides several functions:
 it fetches, decodes and executes instructions
 it issues control signals that control hardware components within the CPU
 it transfers data and instructions around the system

2
Jawaharlal Nehru National college of Engineering, Shimoga MKS

Arithmetic logic unit (ALU)


The ALU has two main functions:
 it performs arithmetic and logical operations (decisions).
 it acts as a gateway between primary storage and secondary storage - data transferred
between them passes through the ALU.
Registers
Registers are small amounts of high-speed memory contained within the CPU. They are used
by the processor to store small amounts of data that are needed during processing, such as:
 the address of the next instruction to be executed
 the current instruction being decoded
 the results of calculations
Different processors have different numbers of registers for different purposes. Most have
some, or all, of the following:
 program counter (PC)
 memory address register (MAR)
 memory data register (MDR)
 current instruction register (CIR)
 accumulator (ACC)
Cache
Cache is a small amount of high-speed random access memory (RAM) built directly within
the processor. It is used to temporarily hold data and instructions that the processor is likely
to reuse. This allows for faster processing, as the processor does not have to wait for the data
and instructions to be fetched from the RAM.
Clock
The CPU contains a clock which, along with the CU, is used to coordinate all of the
computer's components. The clock sends out a regular electrical pulse which synchronises
(keeps in time) all the components.
The frequency of the pulses is known as clock speed. Clock speed is measured in hertz (Hz).
The greater the speed, the more instructions can be performed in any given moment of time.
In the 1980s, processors commonly ran at a rate of between 3 megahertz (MHz) and 5 MHz,
which is 3 million to 5 million pulses or cycles per second. Today, processors commonly run
at a rate of between 3 gigahertz (GHz) and 5 GHz, which is 3 billion to 5 billion pulses or
cycles per second.

3
Jawaharlal Nehru National college of Engineering, Shimoga MKS

Buses
A bus is a high-speed internal connection. Buses are used to send control signals and data
between the processor and other components.
Three types of bus are used.
Address bus - carries memory addresses from the processor to other components such as
primary storage and input/output devices. The address bus is unidirectional.
Data bus - carries the data between the processor and other components. The data bus is
bidirectional.
Control bus - carries control signals from the processor to other components. The control
bus also carries the clock's pulses. The control bus is unidirectional.
Classification of Microprocessors:
Based on their specification, application and architecture microprocessors are classified.
Based on size of data bus:
 4-bit microprocessor
 8-bit microprocessor
 16-bit microprocessor
 32-bit microprocessor
Based on application:
1. General-purpose microprocessor- used in general computer system and can be used
by programmer for any application. Examples, 8085 to Intel Pentium.
2. Microcontroller- microprocessor with built-in memory and ports and can be
programmed for any generic control application. Example, 8051.
3. Special-purpose processors- designed to handle special functions required for an
application. Examples, digital signal processors and application-specific integrated
circuit (ASIC) chips.
Based on architecture:
1. Reduced Instruction Set Computer (RISC) processors
2. Complex Instruction Set Computer (CISC) processors

4
Jawaharlal Nehru National college of Engineering, Shimoga MKS

8085 MICROPROCESSOR ARCHITECTURE


The 8085 microprocessor is an 8-bit processor available as a 40-pin IC package and uses +5
V for power. It can run at a maximum frequency of 3 MHz. Its data bus width is 8-bit and
address bus width is 16-bit, thus it can address 216 = 64 KB of memory. The internal
architecture of 8085 is shown is figure-2 below.

Figure-2: Internal Architecture of 8085

Arithmetic and Logic Unit


The ALU performs the actual numerical and logical operations such as Addition (ADD),
Subtraction (SUB), AND, OR etc. It uses data from memory and from Accumulator
toperform operations. The results of the arithmetic and logical operations are stored in the
accumulator.
Registers
The 8085 includes six registers, one accumulator and one flag register, as shown in Fig. 3.
In addition, it has two 16-bit registers: stack pointer and program counter. They are briefly
described as follows.

5
Jawaharlal Nehru National college of Engineering, Shimoga MKS

The 8085 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 some16-
bit operations. The programmer can use these registers to store or copy data into the
register by using data copy instructions.

Figure-3: Register Set / Organization


Accumulator
The accumulator is an 8-bit register that is a part of ALU. This register is used to store 8-bit
data and to perform arithmetic and logical operations. The result of an operation is stored in
the accumulator. The accumulator is also identified as register A.
Flag register
The ALU includes five flip-flops, which are set or reset after an operation according to
datacondition of the result in the accumulator and other registers. They are called Zero (Z),
Carry (CY), Sign (S), Parity (P) and Auxiliary Carry (AC) flags. Their bit positions in the
flag register are shown in Fig. 4. The microprocessor uses these flags to test data conditions.

6
Jawaharlal Nehru National college of Engineering, Shimoga MKS

1) The carry flag (CF):-This flag is set whenever there has been a carry out of, or a borrow
into, the higher order bit of the result. The flag is used by the instructions that add and
subtract multibyte numbers.
 1-carry out from MSB bit on addition or borrow into MSB bit on subtraction.
 0-no carry out or borrow into MSB bit
2) The parity flag (PF):-This flag is set whenever the result has even parity, an even number
of 1 bits. If parity is odd, PF is cleared.
 1-low byte has even number of 1 bits
 0-low byte has odd parity
3) The auxiliary carry flag (AF):-This flag is set whenever there has been a carry out of the
lower nibble into the higher nibble or a borrow from higher nibble into the lower nibble of an
8 bit quantity, else AF is reset. This flag is used by decimal arithmetic instructions.
 1-carry out from bit 3 on addition or borrow into bit 3 on subtraction
 0-otherwise
4) The zero flag(ZF):-
This flag is set, when the result of operation is zero, else it is reset.
 1-zero result
 0-non-zero result
5) The sign flag(SF):-This flag is set, when MSB (Most Significant Bit) of the result is 1.
Since negative binary numbers are represented in the 8085 CPU in standard two’s
complement notation, SF indicates sign of the result.
 1-MSB is 1 (negative)
 0-MSB is 0 (positive)
Program Counter (PC)
This 16-bit register deals with sequencing the execution of instructions. This register is
amemory pointer. The microprocessor uses this register to sequence the execution of the
instructions. The function of the program counter is to point to the memory address from
which the next byte is to be fetched. When a byte is being fetched, the program counter is
automatically incremented by one to point to the next memory location.
Stack Pointer (SP)
The stack pointer is also a 16-bit register, used as a memory pointer. It points to a memory
location in R/W memory, called stack. The beginning of the stack is defined by loading 16-
bit address in the stack pointer.

7
Jawaharlal Nehru National college of Engineering, Shimoga MKS

Instruction Register/Decoder
It is an 8-bit register that temporarily stores the current instruction of a program. Latest
instruction sent here from memory prior to execution. Decoder then takes instruction and
decodes or interprets the instruction. Decoded instruction then passed to next stage.
Control Unit
Generates signals on data bus, address bus and control bus within microprocessor to carry out
the instruction, which has been decoded. Typical buses and their timing are described as
follows:
 Data Bus: Data bus carries data in binary form between microprocessor and other
external units such as memory. It is used to transmit data i.e. information, results of
arithmetic etc between memory and the microprocessor. Data bus is bidirectional in
nature. The data bus width of 8085 microprocessor is 8-bit i.e. 28 combination of
binary digits and are typically identified as D0 – D7. Thus size of the data bus
determines what arithmetic can be done. If only 8-bit wide then largest number is
11111111 (255 in decimal). Therefore, larger numbers have to be broken down into
chunks of 255. This slows microprocessor.
 Address Bus: The address bus carries addresses and is one way bus from
microprocessor to the memory or other devices. 8085 microprocessor contain 16-bit
address bus and are generally identified as A0 - A15. The higher order address lines
(A8 – A15) are unidirectional and the lower order lines (A0 – A7) are multiplexed
(time-shared) with the eight data bits (D0 – D7) and hence, they are bidirectional.
 Control Bus: Control bus are various lines which have specific functions for
coordinating and controlling microprocessor operations. The control bus carries
control signals partly unidirectional and partly bidirectional. The following control
and status signals are used by 8085 processor:
1. ALE (output): Address Latch Enable is a pulse that is provided when an address
appears on the AD0 – AD7 lines, after which it becomes 0.
2. RD (active low output): The Read signal indicates that data are being read from
the selected I/O or memory device and that they are available on the data bus.
3. WR (active low output): The Write signal indicates that data on the data bus are to
be written into a selected memory or I/O location.

8
Jawaharlal Nehru National college of Engineering, Shimoga MKS

4. IO/M (output): It is a signal that distinguished between a memory operation and


an I/O operation. When IO/M = 0 it is a memory operation and IO/M= 1 it is an
I/O operation.
5. S1 and S0 (output): These are status signals used to specify the type of operation
being performed; they are listed in Table 1.

S-1 S-2 Status

0 0 Halt

0 1 Write

1 1 Read

1 1 Fetch

Table 1 Status signals and associated operations


he schematic representation of the 8085 bus structure is as shown in Fig. 5.
Themicroprocessor performs primarily four operations:
The 8085 processor performs these functions using address bus, data bus and control
bus.
8085 PIN DESCRIPTION

9
Jawaharlal Nehru National college of Engineering, Shimoga MKS

Properties:
1. It is a 8-bit microprocessor
2. Manufactured with N-MOS technology
3. 40 pin IC package
4. It has 16-bit address bus and thus has 216 = 64 KB addressing capability.
5. Operate with 3 MHz single-phase clock
6. +5 V single power supply
The logic pin layout and signal groups of the 8085nmicroprocessor are shown in
Fig.6. All the signals are classified into six groups:
1. Address bus
2. Data bus
3. Control & status signals
4. Power supply and frequency signals
5. Externally initiated signals
6. Serial I/O signals
Address and Data Buses:
 A8 – A15 (output, 3-state): Most significant eight bits of memory addresses and the
eight bits of the I/O addresses. These lines enter into tri-state high impedance state
during HOLD and HALT modes.
 AD0 – AD7 (input/output, 3-state): Lower significant bits of memory addresses and
the eight bits of the I/O addresses during first clock cycle. Behaves as data bus during
third and fourth clock cycle. These lines enter into tri-state high impedance state
during HOLD and HALT modes.
Control & Status Signals:
1. ALE: Address latch enable
2. : Read control signal.
3. : Write control signal.
4. IO/ , S1 and S0 : Status signals.
Power Supply & Clock Frequency:
 Vcc: +5 V power supply
 Vss: Ground reference
 X1, X2: A crystal having frequency of 6 MHz is connected at these two pins
 CLK: Clock output

10
Jawaharlal Nehru National college of Engineering, Shimoga MKS

Externally Initiated and Interrupt Signals:


 : When the signal on this pin is low, the PC is set to 0, the buses are tri-
stated and the processor is reset.
 RESET OUT: This signal indicates that the processor is being reset. The signal canbe
used to reset other devices.
 READY: When this signal is low, the processor waits for an integral number of clock
cycles until it goes high.
 HOLD: This signal indicates that a peripheral like DMA (direct memory access)
controller is requesting the use of address and data bus.
 HLDA: This signal acknowledges the HOLD request.
 INTR: Interrupt request is a general-purpose interrupt.
 : This is used to acknowledge an interrupt.
 RST 7.5, RST 6.5, RST 5,5 – restart interrupt: These are vectored interrupts and have
highest priority than INTR interrupt.
 TRAP: This is a non-maskable interrupt and has the highest priority.
Serial I/O Signals:
 SID: Serial input signal. Bit on this line is loaded to D7 bit of register A using RIM
instruction.
 SOD: Serial output signal. Output SOD is set or reset by using SIM instruction.

Bus Interrupts Control


Interrupt is the mechanism by which the processor is made to transfer control from itscurrent
program execution to another program having higher priority. The interrupt signalmay be
given to the processor by any external peripheral device.
The program or the routine that is executed upon interrupt is called interrupt service
routine(ISR). After execution of ISR, the processor must return to the interrupted program.
Key features in the interrupt structure of any microprocessor are as follows:
i. Number and types of interrupt signals available.
ii. The address of the memory where the ISR is located for a particular interrupt
signal. This address is called interrupt vector address (IVA).
iii. Masking and unmasking feature of the interrupt signals.
iv. Priority among the interrupts.
v. Timing of the interrupt signals.

11
Jawaharlal Nehru National college of Engineering, Shimoga MKS

vi. Handling and storing of information about the interrupt program


(statusinformation).
Classification of Interrupts
The following are the types of interrupts we have in a 8085 microprocessor −
• Maskable and Non-Maskable
• Vectored and Non-Vectored
• Edge Triggered and Level Triggered
• Priority Based Interrupts
Maskable interrupts:-Maskable interrupts are those interrupts which can be enabled or
disabled. Enabling and Disabling is done by software instructions.
List of Maskable Interrupts:
1. RST 7.5
2. RST 6.5
3. RST 5.5
4. INTR
Non-Maskable interrupts:-The interrupts which are always in mode are called non-maskable
[Link] interrupts can never be disabled by any software instruction.
1. TRAP is a maskable interrupt.
Vectored Interrupts:-The interrupts which have fixed memory location for transfer of control
from normal [Link] vectored interrupt points to the location in memory.
List of vectored interrupts:
1. RST 7.5
2. RST 6.5
3. RST 5.5
4. TRAP
Non-Vectored Interrupts: - The interrupts which don't have fixed memory location for
transfer of control from normal [Link] address of the memory location is sent along
with the interrupt.
INTR is a non-vectored interrupt
Edge Triggered Level Interrupts:-The interrupts which are triggered at high or low level are
called level triggered interrupts.
1. RST 6.5
2. RST 5.5
3. INTR
12
Jawaharlal Nehru National college of Engineering, Shimoga MKS

4. TRAP is edge and level triggered interrupt


Priority Based Interrupts: -The interrupts which are triggered at high or low level are called
level triggered interrupts.
1. RST 6.5
2. RST 5.5
3. INTR
4. TRAP is edge and level triggered interrupt.
The microprocessors allow normal program execution to be interrupted in order tocarry out a
specific task/work.
The processor can be interrupted in the following ways
1. by an external signal generated by a peripheral,
2. by an internal signal generated by a special instruction in the program,
3. by an internal signal generated due to an exceptional condition which occurs
whileexecuting an instruction. (For example, in 8086 processors, divide by zero is
anexceptional condition which initiates type 0 interrupt and such an interrupt is also
called execution).
In general, the process of interrupting the normal program execution to carry out a specific
task/work is referred to as interrupt.
When a microprocessor receives an interrupt signal it stops executing current normal
program, savethe status (or content) of various registers (IP, CS and flag registers) in stack
and then the processor executes a subroutine/procedure in order to perform the specific
task/work requested by the interrupt. The subroutine/procedure that is executed in response to
an interrupt is also called Interrupt Service Subroutine. (ISR). At the end of ISR, the stored
status of registers in stack is restored to respective registers, and the processor resumes the
normal programexecution from the point {instruction) where it was interrupted.

The following sequence of operations takes place when an interrupt signal is recognized:
1. Save the PC content and information about current state (flags, registers etc) in the
stack.
2. Load PC with the beginning address of an ISR and start to execute it.
3. Finish ISR when the return instruction is executed.
4. Return to the point in the interrupted program where execution was interrupted.

13
Jawaharlal Nehru National college of Engineering, Shimoga MKS

The following figure shows the contents of Stack Memory, PC, Incrementer/Decrementor
before and after ISR-Interrupt Service Routine. The main program is suspended by ISR. The
content of present memory location where interrupt occurred, contents of PC, SP are pushed
to stack memory. After the interrupt is acknowledged, the contents SP, PC and Memory
content and location of main programs is restored. The control resumes the execution of the
main programs.

INSTRUCTION EXECUTION AND TIMING DIAGRAM:


Each instruction in 8085 microprocessor consists of two part- operation code (opcode) and
operand. The opcode is a command such as ADD and the operand is an object to be operated
on, such as a byte or the content of a register.
Instruction Cycle: The time taken by the processor to complete the execution of
aninstruction. An instruction cycle consists of one to six machine cycles.
Machine Cycle: The time required to complete one operation; accessing either the memory
or I/O device. A machine cycle consists of three to six T-states.
T-State: Time corresponding to one clock period. It is the basic unit to calculate execution
of instructions or programs in a processor.
To execute a program, 8085 performs various operations as:
1. Opcode fetch
2. Operand fetch
3. Memory read/write
4. I/O read/write

14
Jawaharlal Nehru National college of Engineering, Shimoga MKS

External communication functions are:


1. Memory read/write
2. I/O read/write
3. Interrupt request acknowledge
Opcode Fetch Machine Cycle:
It is the first step in the execution of any instruction. The timing diagram of this cycle is
given in Figure timing diagram for opcode fetch.
The following points explain the various operations that take place and the signals that are
changed during the execution of opcode fetch machine cycle:

Table-2
T1 clock cycle
 The content of PC is placed in the address bus; AD0 - AD7 lines contains lower bit
address and A8 – A15 contains higher bit address.
 IO/ signal is low indicating that a memory location is being accessed. S1 and S0 also
changed to the levels as indicated in Table 1.
 ALE is high, indicates that multiplexed AD0 – AD7 act as lower order bus.
T2 clock cycle
 Multiplexed address bus is now changed to data bus.
 The signal is made low by the processor. This signal makes the memory device
load the data bus with the contents of the location addressed by the processor.
T3 clock cycle
 The opcode available on the data bus is read by the processor and moved to
theinstruction register.
 The signal is deactivated by making it logic 1.

15
Jawaharlal Nehru National college of Engineering, Shimoga MKS

T4 clock cycle
 The processor decode the instruction in the instruction register and generate the
necessary control signals to execute the instruction. Based on the instruction further
operations such as fetching, writing into memory etc takes place.

Figure: Timing diagram for opcode fetch cycle


Memory Read Machine Cycle:
The memory read cycle is executed by the processor to read a data byte from memory. The
machine cycle is exactly same to opcode fetch except: a) It has three T-states b) The S0
signal is set to 0. The timing diagram of this cycle is given in Figure below.

Fig. 8 Timing diagram for memory read machine cycle

16
Jawaharlal Nehru National college of Engineering, Shimoga MKS

Memory Write Machine Cycle:


The memory write cycle is executed by the processor to write a data byte in a
memorylocation. The processor takes three T-states and WRsignal is made low. The timing
diagram of this cycle is given in figure: Timing diagram for memory write cycle.

Figure:- Timing diagram for memory Write machine cycle

I/O Read Cycle:


The I/O read cycle is executed by the processor to read a data byte from I/O port or
fromperipheral, which is I/O mapped in the system. The 8-bit port address is placed both in
the lower and higher order address bus. The processor takes three T-states to execute
thismachine cycle. The timing diagram of this cycle is given in Fig. 10

17
Jawaharlal Nehru National college of Engineering, Shimoga MKS

Figure:- Timing diagram for memory IO Read Machine cycle

I/O Write Cycle:


The I/O write cycle is executed by the processor to write a data byte to I/O port or to a
peripheral, which is I/O mapped in the system. The processor takes three T-states to execute
this machine cycle. The timing diagram of this cycle is given in figure below.

Figure:- Timing diagram for the IO WriteMachine Cycle

18
Jawaharlal Nehru National college of Engineering, Shimoga MKS

Microcontrollers
A microcontroller is a small and low-cost microcomputer, which is designed to perform
the specific tasks of embedded systems like displaying microwave’s information,
receiving remote signals, etc.
The general microcontroller consists of the processor, the memory (RAM, ROM,
EPROM), Serial ports, peripherals (timers, counters), etc

CPU (Central Processing Unit)


The CPU is the main component of any processor /controller it is also called the heart of the
processor. It control and manages all processes that are carried out in microcontroller unit. It
also communicating with peripheral devices like Memory, Input and Output. CPU contain
Arithmetic Logic Unit (ALU) , a Control Unit (CU) and some resistors.
Arithmetic and logic unit (ALU) perform arithmetic and logic operation. It also manipulate
data. Individual bit of register can be set, reset, cleared complimented, tested used in logical

19
Jawaharlal Nehru National college of Engineering, Shimoga MKS

computation. Control Unit (CU) is responsible for timing of the communication process
between the CPU and its peripherals.

Memory
To perform any specific task microcontroller required a group of instructions which is called
program. So to store these program microcontroller having a memory called program
memory or code memory. In microcontroller ROM (Read only memory) is used as a program
memory to store program or instructions. Program Memory generally made up of EEPROM
(Electrically Erasable Programmable Read – only Memory), which is a type of non – volatile
memory. In this type of memory, the data can be erased and reprogrammed using special
programming signals.
To store data, microcontroller having a sperate memory called data memory. Microcontroller
used RAM (Random Access Memory ) for temporarily storing of data and the auxiliary
results generated during the runtime. RAM is volatile memory since cutting off power to the
IC will result in loss of information or data.
In microcontroller 8051 there is code or program memory of 4 KB that is it has 4 KB ROM
and it also have data memory (RAM) of 128 bytes.
Bus
Group of wires is called BUS. which uses as a communication channel or it acts as means of
data transfer. In microcontroller buses consists of 8, 16 or more wires. Thus, these can carry 8
bits,16 bits simultaneously.
There are two type of buses used in microcontroller :
Address Bus: It is used for transferring the data from CPU (Central Processing Unit) to
Memory.
Data Bus: It is used for transferring the data from one peripherals to other peripherals.
Input and Output Ports
The ports allow the microcontroller to connect with external devices, machines or other
peripherals. Each port has specific number of pins. All ports are bidirectional. Each port has
a latch and driver (or buffer).
Timers/Counters
The microcontroller has two 16-bit Programmable timers / counters (Timer 0 – Timer 1).
Which can be used either as timer to generate a time delay or as counter to count events
happening outside the microcontroller.

20
Jawaharlal Nehru National college of Engineering, Shimoga MKS

Oscillator
The microcontroller is a digital device, therefore it requires clock pulses for its operation. To
synchronize all the part of microcontroller and perform operation microcontroller has an on-
chip oscillator which works as a clock source for Central Processing Unit of the
microcontroller.

Interrupts
Interrupts are the events that temporarily suspend the main program executed by the
microcontroller. Intimate the microcontroller by sending it an interrupt signal (inform
microcontroller that a device needs its service). When Microcontroller receiving an interrupt
signal, the microcontroller interrupts whatever it is doing and serves the device. After that
microcontroller resume the execution main program.

The program which associated with interrupt is called ISR (Interrupt Service Routine) or
Interrupt handler. ISR is a set of instructions when executed providing the service to
interrupted device. For every Interrupt , there is a fixed location in memory that hold the
address of its ISR. The group of memory location set aside to hold the address of ISR is
called Interrupt vector table.

Applications of Microcontroller
Now a day there are vast application of microcontroller in various fields. Microcontroller is
mainly used in daily life, industries , medical, automobile and defence applications etc.

1. Temperature sensing and controlling devices


2. Light sensing and controlling devices
3. Automobile applications
4. Fire detections and safety devices
5. Défense applications
6. Industrial instrumentation devices
7. Process control devices
8. Measuring and revolving objects
9. Current meter objects
10. Robotics
11. Glucose & blood pressure monitors

21
Jawaharlal Nehru National college of Engineering, Shimoga MKS

Microprocessor Vs Microcontroller

Microprocessor Microcontroller
1 Microprocessor is the heart of Computer Micro Controller is the heart of an
system. embedded system.
2 It is only a processor, so memory and I/O Micro Controller has a processor along
components need to be connected externally with internal memory and I/O components.
3 Memory and I/O has to be connected Memory and I/O are already present, and
externally, so the circuit becomes large. the internal circuit is small.
4 You can’t use it in compact systems You can use it in compact systems.
5 Cost of the entire system is high Cost of the entire system is low
6 Due to external components, the total power As external components are low, total
consumption is high. Therefore, it is not power consumption is less. So it can be
ideal for the devices running on stored power used with devices running on stored power
like batteries. like batteries.
7 Most of the microprocessors do not have Most of the microcontrollers offer power-
power saving features. saving mode.
8 It is used mainly in a washing machine,
It is mainly used in personal computers.
MP3 players, and embedded systems.
9 Microprocessor has a smaller number of
Microcontroller has more register. Hence
registers, so more operations are memory-
the programs are easier to write.
based.
10 Microprocessors are based on Von Neumann Micro controllers arc based on Harvard
model architecture
11
It is a by-product of the development of
It is a central processing unit on a single
microprocessors with a CPU along with
silicon-based integrated chip.
other peripherals.

12 It has a CPU along with RAM, ROM, and


It has no RAM, ROM, Input-Output units,
other peripherals embedded on a single
timers, and other peripherals on the chip.
chip.
13 It uses an external bus to interface to RAM,
It uses an internal controlling bus.
ROM, and other peripherals.
14 Microprocessor-based systems can run at a Microcontroller based systems run up to
very high speed because of the technology 200MHz or more depending on the
involved. architecture.
15 It’s used for general purpose
applications that allow you to handle loads It’s used for application-specific systems.
of data.
16 It’s complex and expensive, with a large It’s simple and inexpensive with less
number of instructions to process. number of instructions to process.

22
Jawaharlal Nehru National college of Engineering, Shimoga MKS

General Requirements of controller


• Mathematical Operations
• Real time operation and context switching
• Communication
• Sampling rate
Mathematical Operations
Mathematical operation such as addition / subtraction, multiplication/ division, trigonometry
functions. State functions and adaptive control require mathematical transformation. Apart
from arithmetical operation, integration, differentiation and logic functions are used for
complex transformations.
Real Time Operation and Context Switching
Real time operation in microcontroller is having interrupt capabilities. Peripheral devices in
communication with microcontroller require interrupts or exception handling for situation
based control. The interrupts allows microcontroller to suspend on-going-task and jump to
ISR-interrupt Service Routine in response to peripheral device. Latency is one of the
important characters of the microcontroller. Latency is the time delay between the interrupt
request and start the ISR.
Context switching in which the current action switches to another sub-action because of
interrupts.
Communication
Communication in important means to transfer data and control under the coordination of the
other devices/controller. Standardized physical layer model is the preferred choice in order to
establish coherent communication. Coherent and unified communication standard is referred
to as open system standard. Many controller facilitate standardised physical layer model for
unified and coherent communication.
Sampling Rate
Sampling rate of microcontroller is the rate at which the micro controller process and
manipulate data. High sampling rate is desired to accommodate the control bandwidth.
Sampling rate is a parameter to select microcontroller having value 20 to 30 time more the
desired bandwidth that can handle all the peripheral devices in communication.

23

You might also like