NMI
NMI
NMI
Short for Non-Maskable Interrupt, NMI is the highest-priority interrupt capable of interrupting
all software and non-vital hardware devices. The NMI is not commonly used and usually only
used to verify if a serious error has occurred or stop all operations because of a failure. For
example, when you press Ctrl+Alt+Del when the computer freezes or stops responding a NMI is
sent to the CPU.
Tip: Unlike a INTR or interrupt, the NMI cannot be interrupted by any other interrupt.
Difference between maskable and non-maskable interrupt?
the interrupt which can be ignored by the processor ,while performing its operations
are called maskable interrupts. generally maskable interrupts are the interrupts that
comes from the pheripheral devices.
where as the non maskable interrupts are the interrupts which cannot be ignored.
generally these type of interrupts are specified to be software interrupts.
the examples of maskable are: mouseclick,memoryread etc
the examples of non_maskable are:powerfailure,software corruptedetc
to
discuss
that
what
is
of
interrupts
used
in
1.Hardware Interrupts
2.Software Interrupts
There are 6 pins available in 8085 for interrupt:
TRAP
RST 7.5
RST6.5
RST5.5
INTR
INTA
Execution of Interrupts:When there is an interrupt requests to the Microprocessor
then after accepting the interrupts Microprocessor send
the INTA (active low) signal to the peripheral. The vectored
address of particular interrupt is stored in program counter.
The processor executes an interrupt service routine (ISR)
addressed in program counter.
RST0
RST1
RST2
RST3
RST4
RST5
RST6
RST7
RST2:
vector address=2*8
= 16
RST1:
vector address=1*8
= 08
RST3:
vector address=3*8
= 24
interrupt.
INTA is
for
used
by the
sending
Architecture of 8085
This
is
the
functional
block
diagram
This
is
al Block Diagram of 8085 Microprocessor.
of
the
the
8085
Microprocessor.
function
Acumulator:-It is a 8-bit register which is used to perform airthmetical and logical operation. It
stores the output of any operation. It also works as registers for i/o accesses.
Temporary Register:-It is a 8-bit register which is used to hold the data on which the
acumulator is computing operation. It is also called as operand register because it provides
operands to ALU.
Flag Registers:-It consists of 5 flip flop which changes its status according to the result stored
in an accumulator. It is also known as status registers. It is connected to the ALU.
There are five flip-flops in the flag register are as follows:
1.Sign(S)
2.zero(z)
3.Auxiliary carry(AC)
4.Parity(P)
5.Carry(C)
The bit position of the flip flop in flag register is:
All of the three flip flop set and reset according to the stored result in the accumulator.
1.Sign- If D7 of the result is 1 then sign flag is set otherwise reset. As we know that a number
on the D7 always desides the sign of the number.
if D7 is 1: the number is negative.
if D7 is 0: the number is positive.
2.Zeros(Z)-If the result stored in an accumulator is zero then this flip flop is set otherwise it is
reset.
3.Auxiliary carry(AC)-If any carry goes from D3 to D4 in the output then it is set otherwise it is
reset.
4.Parity(P)-If the no of 1's is even in the output stored in the accumulator then it is set otherwise
it is reset for the odd.
5.Carry(C)-If the result stored in an accumulator generates a carry in its final output then it is set
otherwise it is reset.
Instruction registers(IR):-It is a 8-bit register. When an instruction is fetched from memory then
it is stored in this register.
Instruction Decoder:- Instruction decoder identifies the instructions. It takes the informations
from instruction register and decodes the instruction to be performed.
Program Counter:-It is a 16 bit register used as memory pointer. It stores the memory address
of the next instruction to be executed. So we can say that this register is used to sequencing the
program. Generally the memory have 16 bit addresses so that it has 16 bit memory.
Stack Pointer:-It is also a 16 bit register used as memory pointer. It points to the memory
location called stack. Generally stack is a reserved portion of memory where information can be
stores or taken back together.
Timing and Control Unit:-It provides timing and control signal to the microprocessor to perform
the various operation.It has three control signal. It controls all external and internal circuits. It
operates with reference to clock signal.It synchronizes all the data transfers.
There are three control signal:
1.ALE-Airthmetic Latch Enable, It provides control signal to synchronize the components of
microprocessor.
2.RD- This is active low used for reading operation.
3.WR-This is active low used for writing operation.
There are three status signal used in microprocessor S0, S1 and IO/M. It changes its status
according the provided input to these pins.
Serial Input Output Control-There are two pins in this unit. This unit is used for serial data
communication.
Interrupt Unit-There are 6 interrupt pins in this unit. Generally an external hardware is
connected to these pins. These pins provide interrupt signal sent by external hardware to
microprocessor and microprocessor sends acknowledgement for receiving the interrupt signal.
Generally
INTA
is
used
for
acknowledgement.
Register
Section:-Many
registers
has
been
used
in
microprocessor.
1.Address Bus:-Genearlly, Microprocessor has 16 bit address bus. The bus over
which the CPU sends out the address of the memory location is known as Address
bus. The address bus carries the address of memory location to be written or to be
read from.
The address bus is unidirectional. It means bits flowing occurs only in one direction,
only from microprocessor to peripheral devices.
We can find that how much memory location it can using the formula 2^N. where N
is the number of bits used for address lines.
here,
2.Data Bus:-8085 Microprocessor has 8 bit data bus. So it can be used to carry the
8 bit data starting from 00000000H(00H) to 11111111H(FFH). Here 'H' tells the
Hexadecimal Number. It is bidirectional. These lines are used for data flowing in
both direction means data can be transferred or can be received through these
lines. The data bus also connects the I/O ports and CPU. The largest number that
can appear on the data bus is 11111111.
It has 8 parallel lines of data bus. So it can access upto 2^8 = 256 data bus lines.
3.Control Bus:-The control bus is used for sending control signals to the memory
and I/O devices. The CPU sends control signal on the control bus to enable the
outputs of addressed memory devices or I/O port devices.
Some of the control bus signals are as follows:
1.Memory read
2.Memory write
3.I/O read
4.I/O write.
Serial Input Output port:SID and SOD:-These pins are used for serial data communication.
Interrupt Signal:-
Pin 6 to 11:- These pins are used for interrupt signals. Generally and external
devices are connected here which requests the microprocessor to perform a
particular task.
There are 5 pins for hardware interruptsTRAP, RST7.5, RST 6.5, RST5.5 and INTR
INTA is used for acknowledgement. Microprocessor sends the acknowledgement to
external devices through the INTA pin.
Address Bus and DATA Buses:AD0-AD7:-These are multiplexed address and data bus. So it can be used to carry
the lower order 8 bit address as well as the data. Generally these lines are
demultiplexed using the Latch.
During the opcode fetch operation, in the first clock cycle the lines deliever the
lower order address bus A0-A7.
In the subsequent IO/M read or write it is used as data bus D0-D7. CPU can read or
write data through these lines.
A8-A15:- These are address bus used to address the memory location.
Address will
appear on AD0-AD7 lines.
ALE will go high and forcing enable G pin of Latch. This will make the latch
transparent. It means whatever will be input, will be output. Presently input address
is A0-A7.Therefore output is A0-A7.
When ALE=0, then AD0-AD7 will now be used as data bus.
2.Single Line Signal:-The status of single line will be either LOW or HIGH. But the change from
one state to another state is not possible in zero time.
3.Multiple Line Signals:-In Microprocessor we have multiple lines. These signals are also
called as bus signals. If a single line changes occure then we have to show a crossing to
indicate change in contents.
Small size
High speed
Better reliability
Low cost
Generally, RAM or ROM is used for memory interfacing.
Memory:-A memory is a digital IC which stores the data in
binary form.
Memory Size:-The number of location and number of bits
per word will vary from memory to memory. For example,
If a particular memory chip is capable of storing M words
with each word having N-bits. Then the size of the memory
will be M N.
Interfacing a ROM memory of 4096*8 with 8085
Microprocessor:Given memory size = 4096 * 8
4096 =2^12.
So 12 lines will be used for interfacing. A0 to A11
= 31 lines.
Think!!!!!!!!
How it may be possible???
Solution of interfacing using RAM and ROM both at a time.
Introduction
We know that a microprocessor is the CPU of a computer. A microprocessor can perform some
operation on a data and give the output. But to perform the operation we need an input to enter
the data and an output to display the results of the operation. So we are using a keyboard and
monitor as Input and output along with the processor. Microprocessors engineering involves a lot
of other concepts and we also interface memory elements like ROM, EPROM to access the
memory.
Interfacing Types
I/O Interfacing:
We know that keyboard and Displays are used as communication channel with outside world. So
it is necessary that we interface keyboard and displays with the microprocessor. This is called I/O
interfacing. In this type of interfacing we use latches and buffers for interfacing the keyboards
and displays with the microprocessor.
But the main disadvantage with this interfacing is that the microprocessor can perform only one
function. It functions as an input device if it is connected to buffer and as an output device if it is
connected to latch. Thus the capability is very limited in this type of interfacing.
Programmable peripheral devices were introduced by Intel to increase the overall performance of
the system. These devices along with I/O functions, they perform various other functions such as
time delays, counters and interrupt handling. These devices are nothing but a combination of
many devices on a single chip. A programmable device can be set up to perform specific function
by writing a code in the internal register. As this code controls the function of the device its
called control word and internal register in which it is stored is called Control Register.
INTEL developed some peripheral devices for processors like 8085/8086/8088. The peripheral
devices includes
8255 Parallel Communication Interface (PPI)
There are two ways in which a microprocessor can connect with outside world or other memory
systems.
Serial Communication Interface
Parallel Communication interface
Serial Communication Interface:
In serial communication interface, the interface gets a single byte of data from the
microprocessor and sends it bit by bit to other system serially (or) the interface receives data bit
by bit serially from the external systems and converts the data into a single byte and transfers it
to the microprocessor.
Parallel Communication Interface:
This interface gets a byte of data from microprocessor and sends it bit by bit to the other systems
in simultaneous (or) parallel fashion. The interface also receives data bit by bit simultaneously
from the external system and converts the data into a single byte and transfers it to
microprocessor.
Consider that we have a microprocessor interfaced to both I/O device and also a memory chip.
Now how to select between the two devices according to the requirement?
For this purpose an address decoding circuit is used. An address decoding circuit aids in selecting
the required I/O device or a memory chip.
7.I/O:8085 can address 2^8 = 256 I/O's and 8086 can access
2^16 = 65,536 I/O's
8.Airthmetic Support:8085 only supports integer and decimal whereas 8086
supports integer, decimal and ASCII arithmetic.
9.Multiplication and Division:8085 doesn't support whereas 8086 supports.
10. Operating Modes:8085 supports only single operating mode whereas 8086
operates in two modes.
11.External Hardware:8085 requires less external hardware whereas 8086
requires more external hardware.
12.Cost:The cost of 8085 is low and 8086 is high.
13.Memory Segmentation:In 8085, memory space is not segmented but in 8086,
memory space is segmented.
Interrupts in 8085
Mainly in the microprocessor based system the interrupts are used for data transfer
between the peripheral and the microprocessor.
The processor will check the interrupts always at the 2nd T-state of last machine
cycle.
If there is any interrupt it accept the interrupt and send the INTA (active low) signal
to the peripheral.
Types of Interrupts:
Hardware
Software
Software interrupts:
The software interrupts are program instructions. These instructions are inserted at
desired locations in a program.
The 8085 has eight software interrupts from RST 0 to RST 7. The vector address for
these interrupts can be calculated as follows.
Hardware Interrupts
Hardware interrupts:
If the interrupt is accepted then the processor executes an interrupt service routine.
(5) INTR
TRAP:
TRAP interrupt is edge and level triggered. This means hat the TRAP must go high
and remain high until it is acknowledged.
In sudden power failure, it executes a ISR and send the data from main memory to
backup memory.
The signal, which overrides the TRAP, is HOLD signal. (i.e., If the processor
receives HOLD and TRAP at the same time then HOLD is recognized first and then
TRAP is recognized).
RST 7.5:
It is edge sensitive. ie. Input goes to high and no need to maintain high state until it
recognized.
Enabled by EI instruction.
The RST 6.5 and RST 5.5 both are level triggered. . ie. Input goes to high and stay
high until it recognized.
Enabled by EI instruction.
The RST 6.5 has the third priority whereas RST 5.5 has the fourth priority.
INTR:
INTR is a maskable interrupt. It is disabled by,
1. DI, SIM instruction
2. System or processor reset.
3. After reorganization of interrupt.
Enabled by EI instruction.
Non- vectored interrupt. After receiving INTA (active low) signal, it has to supply
the address of ISR.
It is a level sensitive interrupts. ie. Input goes to high and it is necessary to maintain
high state until it recognized.
The following sequence of events occurs when INTR signal goes high.
1. The 8085 checks the status of INTR signal during execution of each instruction.
2. If INTR signal is high, then 8085 complete its current instruction and sends active low
interrupt acknowledge signal, if the interrupt is enabled.
3. In response to the acknowledge signal, external logic places an instruction OPCODE on
the data bus. In the case of multibyte instruction, additional interrupt acknowledge
machine cycles are generated by the 8085 to transfer the additional bytes into the
microprocessor.
4. On receiving the instruction, the 8085 save the address of next instruction on stack and
execute received instruction
SIM & RIM Interrupts
The 8085 provide additional masking facility for RST 7.5, RST 6.5 and RST 5.5
using SIM instruction.
The masking or unmasking of RST 7.5, RST 6.5 and RST 5.5 interrupts can be
performed by moving an 8-bit data to accumulator and then executing SIM
instruction.
The status of pending interrupts can be read from accumulator after executing RIM
instruction.
When RIM instruction is executed an 8-bit data is loaded in accumulator, which can
be interpreted as shown in fig.