Unit 2
Unit 2
Communication Interface
Attendance 29-01-2025
• Absent no.-
6,7,10,18,24,35,44,57,64,67,73,
Attendance 30-01-2025
• Absent no.-
4,7,12,16,29,33,35,36,41,49,54,55,56,67,72,
8086 Microprocessor
The Bus Interface Unit (BIU):
It provides the interface of 8086 to external memory and I/O
devices via the System Bus. It performs various machine cycles
such as memory read, I/O read, etc. to transfer data between
memory and I/O devices.
BIU performs the following functions are as follows:
• It generates the 20-bit physical address for memory access.
• It fetches instructions from the memory.
• It transfers data to and from the memory and I/O.
• Maintains the 6-byte pre-fetch instruction queue(supports
pipelining).
4 Segment registers
4 Segment registers
•It is a 16-bit register. It holds offset of the next instructions in the Code Segment.
•IP is incremented after every instruction byte is fetched.
•IP gets a new value whenever a branch instruction occurs.
•CS is multiplied by 10H to give the 20-bit physical address of the Code Segment.
•The address of the next instruction is calculated by using the formula CS x 10H + IP.
4 Segment registers
(16 Bit register): CS holds the base address for the Code
Segment. All programs are stored in the Code Segment
and accessed via the IP.
4 Segment registers
(16 Bit register): DS holds the base address for the Data
Segment.
4 Segment registers
(16 Bit register): SS holds the base address for the Stack
Segment.
4 Segment registers
(16 Bit register): ES holds the base address for the Extra
Segment.
Segments are present in memory and segment registers are present in Microprocessor.
Segment registers store starting address of each segments in memory.
The main components of the EU are
1.Fetches instructions from the Queue in BIU, decodes, and executes arithmetic and logic operations using
the ALU.
2.Sends control signals for internal data transfer operations within the microprocessor.(Control Unit)
3.Sends request signals to the BIU to access the external module.
4.It operates with respect to T-states (clock cycles) and not machine cycles.
Features of 8086
The most prominent features of a 8086 microprocessor are as follows −
• It has an instruction queue, which is capable of storing six instruction bytes from the
memory resulting in faster processing.
• It was the first 16-bit processor having 16-bit ALU, 16-bit registers, internal data bus, and
16-bit external data bus resulting in faster processing.
• It is available in 3 versions based on the frequency of operation −
• 8086 → 5MHz
• 8086-2 → 8MHz
• 8086-1 → 10 MHz
• It uses two stages of pipelining, i.e. Fetch Stage and Execute Stage, which improves
performance.
• Fetch stage can prefetch up to 6 bytes of instructions and stores them in the queue.
• Execute stage executes these instructions. It has 256 vectored interrupts. It consists of
29,000 transistors.
Interfacing
8 bit input
Port
Interfacing
16 bit input
Port
Interfacing 8 bit output Port
Interfacing 16 bit output Port
Basic Peripherals & their
interfacing with 8086/8088
Basic Peripherals & their interfacing
with 8086/8088
• Interfacing basic peripherals with the 8086/8088
microprocessors is a fundamental aspect of system design
in embedded systems and computer architecture.
• The 8086 and 8088 are 16-bit microprocessors, and they
can interface with various peripherals such as keyboards,
displays, printers, and storage devices.
Overview of some common
peripherals and their
interfacing methods with the
8086/8088 microprocessors.
Keyboard Interfacing
Keyboard Interface: The keyboard can be interfaced using a
matrix arrangement or a direct connection. The most
common method is to use a keyboard controller like the
8042.
• Connection: The keyboard controller is connected to the
data bus and control lines of the 8086/8088.
• Operation: The keyboard sends a scan code to the
microprocessor when a key is pressed. The microprocessor
reads the scan code from the keyboard controller.
• Interrupts: The keyboard controller can generate an
interrupt IRQ1) to signal the microprocessor that a key has
been pressed.
Display Interfacing
• LED Display: A simple LED display can be interfaced using a
port connected to the data bus.
• Connection: Connect the LED display to one of the I/O ports of the
8086/8088.
• Operation: The microprocessor sends data to the port, which
lights up the corresponding LEDs.
• LCD Display: An LCD can be interfaced using a controller
like the HD44780.
• Connection: The LCD controller is connected to the data bus and
control lines.
• Operation: The microprocessor sends commands and data to the
LCD controller to display characters.
Printer Interfacing
• Parallel Printer Interface: Printers are commonly interfaced
using a parallel port (e.g., Centronics interface).
• Connection: The printer is connected to the data bus and control
lines (e.g., STROBE, ACK.
• Operation: The microprocessor sends data to the printer through
the data lines. Control signals are used to manage the printing
process.
• Serial Printer Interface: Serial printers can be interfaced
using a UART Universal Asynchronous
Receiver-Transmitter).
• Connection: The UART is connected to the data bus and control
lines.
• Operation: The microprocessor sends data serially to the printer
Storage Device Interfacing
• Floppy Disk Drive FDD: The floppy disk drive can be
interfaced using a disk controller.
• Connection: The disk controller is connected to the data bus and
control lines.
• Operation: The microprocessor sends commands to the disk
controller to read from or write to the floppy disk.
• Hard Disk Drive HDD: Similar to the floppy disk, a hard
disk drive is interfaced using a disk controller (e.g., IDE
controller).
• Connection: The IDE controller is connected to the data bus and
control lines.
• Operation: The microprocessor communicates with the IDE
controller to manage data storage and retrieval.
Analog-to-Digital Converter ADC
ADC Interfacing: An ADC can be used to convert analog
signals to digital data.
• Connection: The ADC is connected to the data bus and
control lines.
• Operation: The microprocessor sends a signal to the ADC
to start the conversion, and then it reads the digital output
from the ADC.
Digital-to-Analog Converter DAC
DAC Interfacing: A DAC can be used to convert digital data
to analog signals.
• Connection: The DAC is connected to the data bus.
• Operation: The microprocessor sends digital data to the
DAC, which converts it to an analog signal.
Timer/Counter Interfacing
Programmable Interval Timer PIT: A timer can be used for
generating time delays or counting events.
• Connection: The PIT is connected to the data bus and
control lines.
• Operation: The microprocessor can program the timer to
generate interrupts at specified intervals.
Interfacing peripherals with the 8086/8088 microprocessors
involves connecting the peripherals to the data bus, address
bus, and control lines, and writing software routines to
manage communication.
Each peripheral has its own specific requirements and
protocols, but the general principles of interfacing remain
consistent. Understanding these concepts is crucial for
designing effective microprocessor-based systems.
Semiconductor Memory
Interfacing
Minimum Mode 8086 System
Interfacing 128K RAM & 2K ROM
with 8086 in Minimum Mode
Interfacing Memory with 8086 in
Minimum Mode
Dynamic RAM DRAM Interfacing
Dynamic RAM DRAM is a type of memory that stores each bit of data in a
separate capacitor within an integrated circuit. Because capacitors leak
charge, DRAM must be refreshed periodically to maintain the data. Interfacing
DRAM involves several key components:
1. Address Lines: These lines are used to select the memory location. The
number of address lines determines the maximum memory capacity (e.g.,
2^n locations for n address lines).
2. Data Lines: These lines are used to read from and write to the memory. The
width of the data bus (e.g., 8-bit, 16-bit) determines how much data can be
transferred at once.
3. Control Signals: These include signals like Row Address Strobe RAS,
Column Address Strobe CAS, and Write Enable WE. RAS and CAS are
used to select the row and column of the memory cell, while WE indicates
whether data is being written to or read from the memory.
4. Refresh Logic: Since DRAM needs to be refreshed, additional circuitry is
often required to periodically refresh the memory cells.
DRAM Interfacing
DRAM
PIO 8255
Group A
PIO 8255 Group A
Control
PORT A
Internal Line
24 I/O lines UPPER
8/16 bit higher capability microprocessor Works together
2 groups A and B each 12 I/O lines (4+4=8 bit)
Again subdivided into each 8I/O lines Group B
Control Word Registers PORT C
Read Write Control Logic LOWER
RD
WR Read
Write
A0
Control
Logic Group B
A1 Group B
Control
PORT B
Reset
CS
Ports of 8255
• 8255 has three ports, i.e., PORT A, PORT B, and PORT C.
• Port A contains one 8-bit output latch/buffer and one 8-bit input buffer.
• Port B is similar to PORT A.
• Port C can be split into two parts, i.e. PORT C lower (PC0-PC3) and PORT C
upper (PC7-PC4) by the control word.
• These three ports are further divided into two groups, i.e. Group A includes
PORT A and upper PORT C. Group B includes PORT B and lower PORT C.
These two groups can be programmed in three different modes, i.e. the
first mode is named as mode 0, the second mode is named as Mode 1 and
the third mode is named as Mode 2.
Operating Modes
8255 has three different operating modes −
• Mode 0 − In this mode, Port A and B is used as two 8-bit ports and Port C as
two 4-bit ports. Each port can be programmed in either input mode or
output mode where outputs are latched and inputs are not latched. Ports
do not have interrupt capability.
• Mode 1 − In this mode, Port A and B is used as 8-bit I/O ports. They can be
configured as either input or output ports. Each port uses three lines from
port C as handshake signals. Inputs and outputs are latched.
• Mode 2 − In this mode, Port A can be configured as the bidirectional port
and Port B either in Mode 0 or Mode 1. Port A uses five signals from Port C
as handshake signals for data transfer. The remaining three signals from
Port C can be used either as simple I/O or as handshake for port B.
Interfacing I/O Ports - PIO 8255
The 8255 Programmable Peripheral Interface PPI is a widely
used I/O port interface that allows microprocessors to
communicate with peripheral devices. It provides a flexible way to
interface with various I/O devices. The 8255 can be configured in
different modes:
1. Mode 0 Basic Input/Output): In this mode, the ports can be
used for simple input and output operations. Each port can be
configured as either input or output.
2. Mode 1 Strobed Input/Output): This mode allows for
handshaking between the microprocessor and peripheral
devices. It is useful for devices that require synchronization.
3. Mode 2 Bidirectional Bus): This mode allows for bidirectional
data transfer on a single port, which is useful for interfacing with
devices like printers.
Key Features of 8255
• Three 8-bit Ports: The 8255 has three 8-bit ports Port A,
Port B, and Port C) that can be configured independently.
• Control Word Register: This register is used to configure
the operation of the 8255, including setting the mode of
operation for each port.
• Interrupt Capability: The 8255 can generate interrupts,
allowing the microprocessor to respond to events from
peripheral devices.
• Address/data bus must be externally demux'd.
• It is TTL compatible.
• It has improved DC driving capability.
Control Word Format- For
Bit/Reset Mode
Control Word Format- For I/O
Mode
Interfacing DAC
Interfacing ADC
Interfacing Example
To interface a microprocessor with DRAM and the 8255 PPI, the
following steps are typically involved:
1. Connect the Address and Data Lines: Connect the address lines
of the microprocessor to the address lines of the DRAM and the
data lines to the data bus.
2. Control Signals: Connect the control signals RAS, CAS, WE) to
the appropriate pins on the DRAM.
3. Connect the 8255: Connect the data and control lines of the
8255 to the microprocessor. Configure the 8255 using the
control word register to set the desired mode for the ports.
4. Programming: Write the necessary software routines to read
from and write to the DRAM and to communicate with peripheral
devices through the 8255.
Interfacing of Stepper Motor
Stepper Motor
• A stepper motor, also known as step motor or stepping motor, is
a brushless DC electric motor that converts digital pulses into
mechanical shaft rotation incrementally (around 1.8 degrees for
a typical stepper) rather than continuously rotating as DC
motors do.
• The stepper motor works on the principle of electromagnetic
induction, where a rotating magnetic field is used to turn the
motor's shaft incrementally.
• It is one of the most commonly used motion control components
in industrial systems due to its simplicity of operation, accuracy
and smooth movement.
What Is Stepper Motor?
• A stepper motor is essentially a synchronous motor that divides a full
rotation into a number of equal steps (around 200 steps). It is an
electromechanical device which converts digital pulses into mechanical
shaft rotation.
• Some key aspects of a stepper motor include:
• It has a rotor with permanent magnets and a stator that contains winding. The
winding is divided into phases (often two or more).
• Each step is caused by the energizing of the motor's stator winding in a particular
sequence. The rotor aligns itself to the nearest stator pole.
• Step angle is defined as the angular rotation produced per pulse applied to the
motor. A typical step angle is 1.8 degrees.
• Speed and distance covered by the motor are directly proportional to the rate at
which pulses are applied.
• They are available in different NEMA frame sizes denoted by their frame diameter in
inches like NEMA 17, 23, 24 etc.
• Stepper motors can hold their position without power, which makes them suitable for
open-loop control applications like CNC machines.
Working Principle Of Stepper Motor
The basic working principle of a stepper motor can be explained as follows:
• It consists of a stator (stationary outer cylinder) and a rotor (inner cylinder attached to the
shaft).
• The stator contains electromagnets which are organized into groups known as "phases".
The most common types have two or four phases.
• The rotor contains permanent magnets or pole pieces. It is attached to the motor shaft
which extends outside for connection to a device.
• When one phase is energized, it rotates the rotor slightly in one direction. As soon as the
first phase is energized, the second one is powered to continue the motion.
• Repeating the process of energizing the phases in sequence causes the rotor to rotate in
steps.
• By controlling the sequence of energizing the electromagnets, the direction of rotation can
be controlled.
• Varying the number of steps per pulse gives finer position resolution. Higher number of
steps per pulse means smaller angular rotation per step.
A stepper motor converts
digital pulses into mechanical
rotation incrementally by
energizing its
electromagnetic stator coils
in a sequence. This makes it
suitable for open-loop
precision motion control
applications.
Step Angle in Stepper Motor
• Step angle is defined as the angular rotation produced by the
stepper motor per pulse given as input. A standard step angle
varies between 1.8° to 0.9°. Smaller the step angle, better the
positional accuracy and higher the number of steps per
revolution.
• Common step angles of 1.8° gives a resolution of 200
steps/revolution while 0.9° gives 400 steps/revolution.
Microstepping techniques can produce step angles less than 1°
for high precision applications.
Step Angle
• The number of steps required to complete one full rotation
depends on the step angle of the stepper motor. The step angle
can vary from 0.72 degrees to 15 degrees per step. Depending
on that 500 to 24 steps may be required to complete one
rotation. In position control applications the selection on motor
should be based on the minimum degree of rotation that is
required per step.
Types
Stepper Motor
• A stepper motor is a type of DC motor that moves in precise steps. The
rotation speed depends on the rate of electrical signals applied, and the
direction of rotation is controlled by the pattern of pulses.
• A stepper motor is made up of a rotor, which is normally a permanent
magnet and it is, as the name suggests the rotating component of the
motor. A stator is another part which is in the form of winding.
• In the diagram, the center is the rotor
which is surrounded by the stator
winding. This is called as four phase
winding.
Stepping Sequence
• In order to get correct motion of the motor, a stepping sequence
has to be followed. This stepping sequence gives the voltage
that must be applied to the stator phase. Normally a 4 step
sequence is followed.