Notes Unit 2
Notes Unit 2
PERIPHERAL INTERFACING
8086
Microprocessor Memory organization in 8086
8086 : 16-bit
Bank 0 : A0 = 0
Even addressed memory
bank
Bank 1 : 𝑩𝑯𝑬 = 0
Odd addressed
memory bank
106
8086
Microprocessor Memory organization in 8086
𝑩𝑯
𝑬
Operation A0 Data Lines Used
Note that 8-bit read requests in this scheme are handled by the microprocessor (it
selects the bits it wants to read from the 16-bits on the bus).
Memory interfacing
Write Operations
• For each counter, the control word must be
written before the initial count is written.
• The initial count must follow the count format
specified in the control word (least
significant byte only, most significant byte
only, or least significant byte and then
most significant byte).
Read Operations
• It is often desirable to read the value of a
counter without disturbing the count
in progress. This is easily done in the 8254.
Interrupt is the method of creating a temporary halt during program execution and
allows peripheral devices to access the microprocessor. The microprocessor responds to
that interrupt with an ISR (Interrupt Service Routine), which is a short program to
instruct the microprocessor on how to handle the interrupt.
The are two types of interrupts in a 8086 microprocessor.
They are hardware interrupts and software interrupts.
NMI
It is a single non-maskable interrupt pin (NMI) having higher priority than the maskable
interrupt request pin (INTR)and it is of type 2 interrupt.
• Pushes the CS (code segment) value and IP (instruction pointer) value of the return
address on to the stack.
• IP is loaded from the contents of the word location 00008H.
• CS is loaded from the contents of the next word location 0000AH.
• Interrupt flag and trap flag are reset to 0.
Interrupt structure of 8086
INTR
The INTR is a maskable interrupt because the microprocessor will be interrupted only if
interrupts are enabled using set interrupt flag instruction. It should not be enabled
using clear interrupt Flag instruction.
The INTR interrupt is activated by an I/O port. If the interrupt is enabled and NMI is
disabled, then the microprocessor first completes the current execution and sends ‘0’
on INTA pin twice. The first ‘0’ means INTA informs the external device to get ready
and during the second ‘0’ the microprocessor receives the 8 bit, say X, from the
programmable interrupt controller.
The interrupts from Type 5 to Type 31 are reserved for other advanced
microprocessors, and interrupts from 32 to Type 255 are available for hardware
and software interrupts.
Interrupts of 8086
• CS value of the return address and IP value of the return address are pushed
on to the stack.
The Block Diagram consists of 8 blocks which are – Data Bus Buffer,
Read/Write Logic, Cascade Buffer Comparator, Control Logic, Priority Resolver
and 3 registers- ISR, IRR, IMR.
Read/Write logic
This block works only when the value of pin CS is low (as this pin is active
low). This block is responsible for the flow of data depending upon the inputs
of RD and WR. These two pins are active low pins used for read and write
operations.
8259 interrupt controller
Control logic : It is the centre of the microprocessor and controls the functioning of every
block. It has pin INTR which is connected with other microprocessor for taking interrupt
request and pin INT for giving the output. If 8259 is enabled, and the other microprocessor
Interrupt flag is high then this causes the value of the output INT pin high and in this way
8259 responds to the request made by other microprocessor.
Interrupt request register (IRR) : It stores all the interrupt level which are requesting for
Interrupt services.
Interrupt service register (ISR) : It stores the interrupt level which are currently being
executed.
Interrupt mask register (IMR) : It stores the interrupt level which have to be masked by
storing the masking bits of the interrupt level.
8259 interrupt controller
Priority resolver :
It examines all the three registers and set the priority of interrupts and
according to the priority of the interrupts, interrupt with highest priority is set
in ISR register. Also, it reset the interrupt level which is already been serviced in
IRR.
Cascade buffer :
To increase the Interrupt handling capability, cascading is done for more
number of pins by using cascade buffer. So, during increment of interrupt
capability, CSA lines are used to control multiple interrupt structure.
SP/EN (Slave program/Enable buffer) pin is when set to high, works in master
mode else in slave mode. In Non Buffered mode, SP/EN pin is used to specify
whether 8259 work as master or slave and in Buffered mode, SP/EN pin is used
as an output to enable data bus.
8259 Interrupt Controller
ICW2 command :
The control word is recognized as ICW2 when A0= 1.
It stores the information regarding the interrupt vector address.
In the 8085 based system, the A15 to A8 bits of control word is used for interrupt vector
addresses.
In the 8086 based system, T6 to T3 bits are inserted instead of A15 to A8 and A10 to A8 are
used for selecting interrupt level, i.e. 000 for IR0 and 111 for IR7.
8259 Operational command word
Operational command word 1
It is used to set and reset the mask bits in IMR(interrupt mask register). M7 –
M0 describes 8 mask bits
Serial communication
Serial communication is a communication method that uses one or two transmission lines
to send and receive data, and that data is continuously sent and received one bit at a time.
Since it allows for connections with few signal wires, one of its merits is its ability to hold
down on wiring material and relaying equipment costs.
One wire carries a varying voltage that represents the signal, while the
other wire is
connected to a reference voltage, usually ground.
RS-422A
This standard fixes problems in RS-232C such as a short transmission distance and a
slow transmission speed.It is also called "EIA-422A".The purpose and timing of the
signal lines are defined, but the connectors are not.Many compatible products
primarily adopt D-sub 25-pin and D-sub 9-pin connectors.
RS-485
This standard fixes the problem of few connected devices in RS-422A.It is also called
"EIA-485".RS-485 is forward compatible standard with RS-422A.The purpose and
timing of the signal lines are defined, but the connectors are not.Many compatible
products primarily adopt D-sub 25-pin and D-sub 9-pin connectors
In RS-232C, the connectors to use and the signal assignments have been defined
and are standardized. The figure to the right describes the D-sub 9-pin signal
assignments and signal lines.
Signal ground
5 SG Signal Ground
or common
return
6 DSR Data Set Ready Data set ready
Maintenance ground
CASE FG Frame Ground
or earth
RS 232 Connection method
In RS-232C, the connectors and signal assignments have been standardized, so many
standard-compliant cables are available commercially. However, equipment comes in the
following types, and depending on the equipment that will be connected, a straight
cable or a crossover cable is required.
Equipment type
DCE
Data communication equipment.This term indicates equipment that passively operates
such as modems, printers, and plotters.
DTE
Data terminal equipment.This term indicates equipment that actively operates such as
computers.
Full-duplex communication
A method where send and receive both have their own transmission line so data can
be simultaneously sent and received.
Half-duplex communication
A method where communication is performed using one transmission line while
switching between send and receive. For this reason, simultaneous communication
cannot be performed.
Crossover cable connection
Full-duplex communication A method where send and receive both have their
own transmission line so data can be simultaneously sent and received. Half-
duplex communication A method where communication is performed using one
transmission line while switching between send and receive. For this reason,
simultaneous communication cannot be performed
THANK YOU