Documente Academic
Documente Profesional
Documente Cultură
F-XC A N GE
H
F-XC A N GE
O
W
!
PD
O
W
!
N
y
to
to
bu
Om Sakthi
bu
k
lic
w
8255
Programmable
Peripheral
8255 has three registers of 8 bits each and are called as Port A, Port B and Port C.
The port A and upper 4 bits of Port C are grouped and called as Group A.
Similarly, Port B and lower 4 bits of Port C are grouped as Group B.
In addition to three registers A, B and C, there is another register called control register.
The contents written into the control register decides the operating modes of the three
parallel ports.
In order to identify the four registers, 8255 uses two address lines A0 and A1.
Microprocessor
Page
.d o
m
o
.c
ADHIPARASAKTHIENGINEERINGCOLLEGE
lic
C
c u -tr a c k
.d o
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
bu
to
k
lic
PA0 PA7, PB0 PB7, PC0 PC7 - These three ports of 8255 needs 8 lines each and so
24 pins are allotted for ports and connected to external Input or output devices.
A0 and A1 These pins are allotted for selecting one of the 4 registers available in 8255.
D0-D7 - Data lines are connected to the data bus of the processor.
RD and WR - Active low control signals for reading and writing to the registers,
CS It is made to low for chip select CS , This signal is obtained from the decoder which
decodes the address lines and identifies the 8255 addressing.
RESET - Reset 8255
VCC - +5 v power supply
GND connected to Ground
Microprocessor
Page
.d o
.c
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
Microprocessor
Page
k
lic
.d o
to
bu
.c
m
o
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
k
Microprocessor
Page
.d o
.c
lic
o
c u -tr a c k
.d o
lic
to
bu
2. Explain the programming and various operating modes of 8255 PPI in detail.
w
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
k
w
There are two 8 bit ports (A and B) and two 4 bit ports (C lower) and (C upper)
Any port can be input or an output port
Microprocessor
Page
.d o
Mode 0 provides simple input and output operations for each of the three ports
.c
lic
o
c u -tr a c k
.d o
lic
to
bu
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
Microprocessor
Page
N
y
bu
to
k
lic
.d o
m
o
.c
N
y
bu
to
k
lic
C
c u -tr a c k
.d o
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
Step 1
The processor will initiate the data transmission by writing the data to be
transmitted to the output device to the corresponding port of 8255.
Step 2
To transfer the data to the output device, 8255 will make OBF (Output
Buffer Full- active low signal) low to indicate that the CPU has written
data to be given to the specified port.
The OBF flip flop will be set by the rising edge of the WR input.
Step 3
The data available on the output port pins are then read by the output
device.
After receiving data from the port pins, ACK is an active low input signal
to 8255 from the peripheral device indicating that it is accepting data.
OBF output signal of 8255 is reset by ACK input being low.
Step 4
8255 will now inform to the processor that data has been transferred to
the output device by making INTR (Interrupt Request) line high.
A high on this output can be used to interrupt the CPU when an output
device has accepted data transmitted by the CPU.
INTR is set when ACK is a one, OBF is a one and INTE is a one.
Step 5
In the interrupt Service routine, the processor writes the next data to be
transmitted to the output device to the output port of 8255.
INTR signal is reset by the falling edge of WR.
Mode 2 (Strobed bidirectional I/O):
In mode 2, data is transmitted and received via port A pins (bi-directional bus I/O) with
handshaking capability.
Only Port A can be configured in Mode 2 and is used as a bi-directional port while port
C is used for handshaking signals.
Meanwhile, Port B can be configured to be in Mode 0 or 1 and Port B cannot be
configured for mode2.
Microprocessor
Page
N
y
bu
to
k
lic
.d o
m
o
.c
N
y
bu
to
k
lic
C
c u -tr a c k
.d o
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
bu
to
k
lic
Microprocessor
Page
.d o
.c
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
Interfacing of 8255 with 8086 requires two 8255 chips for 16 bit input and output
M/IO will be inverted before connecting to the decoder
RD and WR are directly connected to 8086
4. Explain serial communication Interface USART (8251) with neat diagram
8251 is Universal Synchronous Asynchronous Receiver Transmitter (USART) is used for
serial data communication.
8251 receives parallel data from the CPU and transmits the same in serial form. This
device also receives serial data from the outside and converts them into parallel data
and sends it to the CPU.
8251 can support both synchronous and asynchronous transmission formats and is
programmable. It supports full duplex serial transmission and reception and variable
baud rates.
Basically it consists of a parallel to serial shift register for the transmitting over TXD line
from buffer and a serial to parallel converter for data received on the RXD line.
Block diagram of the 8251 USART
Microprocessor
Page
N
y
bu
to
k
lic
.d o
m
o
.c
N
y
bu
to
k
lic
C
c u -tr a c k
.d o
3. Show how two 8255 chip can be connected in an connected in an 8086-based system
to form a 16-bit port.
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
bu
to
k
lic
D0 to D7- Data bus: A group of Bidirectional data bus that is used for data and control
word transfer between CPU and 8251.
RESET: A logic High applied on this pin pits 8251 into "reset status." The time duration
required for reset signal is six clock pulses.
CLK: Clock signal is used to generate internal device timing. CLK signal is independent of
RXC (receive clock) or TXC (Transmit clock). In general, the CLK frequency must be much
higher than the RXC and TXC frequencies.
WR - Write Data/Command: It is an active low input signal for writing data and control
words from the CPU into the 8251.
RD- Read Data: It is an active low input signal for reading data and status words from
the 8251.
C/D - Control/Data: It is an input signal for selecting data or command words and status
words when the 8251 is accessed by the CPU. If C/D = low, data will be accessed. If C/D
= high, command word or status word will be accessed.
CS - Chip Select: It is an "Active low" input signal which selects the 8251 for CPU
accesses.
Microprocessor
Page 10
.d o
.c
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
c u -tr a c k
TXRDY - Transmitter Ready: It is an output signal which indicates 8251is ready to accept
a transmitted data character. But the terminal is always at low level if CTS = high
TXEMPTY - Transmitter Empty: It is an output signal that indicates that the 8251 has
transmitted all the characters and had no data character to be transmission.
TXC - Transmitter Clock: This is a clock input signal that determines the transfer speed of
transmitted data or in other words, the baud rate for transmission.
In "synchronous mode," the baud rate will be the same as the frequency of TXC.
RXRDY - Receiver Ready: It is a signal that indicates that the 8251 contains a character
that is ready to READ and CPU can read the data.
RXC - Receiver Clock: This is a clock input signal that determines the transfer speed of
received data or the baud rate of reception.
In "synchronous mode," the baud rate is the same as the frequency of RXC.
DSR - Data Set Ready: This is an input port for MODEM interface.
DTR - Data Terminal Ready: This is an output port for MODEM interface.
CTS - Clear to Send data: This is an input signal for MODEM interface which is used for
controlling a transmit circuit.
5. Explain the 8279 keyboard and display controller with neat sketch.
The major features of 8279 are listed below.
Supports up to a maximum of 64 key matrix with 2-key lockout or N-key rollover
options
Supports up to 16 digit display interface with many options
Simultaneous keyboard and display operations
Microprocessor
Page 11
N
y
bu
to
k
lic
.d o
.c
m
o
.d o
TXD - Transmit Data line: It is an output signal for transmitting serial converted data
from 8251.
lic
to
bu
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
.c
Keyboard section
8279 has four scan lines SL0 SL3and eight return lines RL0 RL7, a shift line and a
control line. Scan lines are connected to rows of the keyboard. Return lines are
connected to column of the keyboard. Shift line and control lines are connected to shift
Microprocessor
Page 12
N
y
bu
to
k
lic
.d o
m
o
c u -tr a c k
.d o
N
y
bu
to
k
lic
C
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
This information is stored in FIFO (First In First Out) RAM. The status logic generates an
interrupt after each FIFO read operation till the FIFO is empty.
Modes of Keyboard section
Encoded scan keyboard 2 key lock out
Encoded scan keyboard - N key roll over
Decoded scan keyboard 2 key lock out
Decoded scan keyboard - N key roll over
Encoded scan sensor Matrix
Decoded scan sensor Matrix
Strobed input
Two types of Debouncing
2 key Lock out
In this mode of operation, If two keys are pressed within a debounce cycle
(simultaneously), no key is recognized till one of them remains closed and the other is
released. The last key that remains depressed is considered as single valid key
depression.
N-Key Rollover :
In this mode, each key depression is treated independently. When a key is
pressed, the debounce circuit waits for 2 keyboards scans and then checks whether the
key is still depressed. If it is still depressed, the code is entered in FIFO RAM.
Scanned Sensor Matrix :
In this mode, a sensor array can be interfaced with 8279 using either encoded or
decoded scans. With encoded scan 8*8 sensor matrix or with decoded scan 4*8 sensor
matrix can be interfaced. The sensor codes are stored in the CPU addressable sensor
RAM.
Strobed input:
Microprocessor
Page 13
N
y
bu
to
k
lic
.d o
m
o
.c
N
y
bu
to
k
lic
C
c u -tr a c k
.d o
and control keys. IRQ: Interrupt request, becomes 1 when a key is pressed, data is
available.
The scan counter has two modes to scan the key matrix
Encoded scan
Decoded scan
In keyboard encoded scan, row is output on the low order three lines and it is decoded
by 3 to 8 decoder to provide 8 x 8 keyboard
In keyboard decoded scan, four lines are connected to four rows of keyboard to provide
4x8 keyboard
Data format generated for each key pressed is
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
.c
Display Section
It consist of four scan lines SL0 SL3, two 4 bit output ports(A0 A3 and B0 B3), 16 x
8 display RAM and Blank display line for display operation.
For BCD type seven segment LED display, only 4 bit codes are needed. Both right and
left entry display formats are possible.
Display RAM can be loaded or read by the CPU after the correct mode and address is
set. When the keyboard is in the decoded scan, display will automatically be in decoded
mode, i.e 4 characters will be displayed.
BD is used to blank display during digit switching
OUT A3-A0/B3-B0: Outputs that sends data to the most significant/least significant
nibble of display.
Display Mode
Left Entry Mode :
In the left entry mode, the data is entered from left side of the display unit. The
first entry is displayed on the leftmost display and the sixteenth entry on the rightmost
display. The seventeenth entry is again displayed at the leftmost display position.
Right Entry Mode :
In the right entry mode, the first entry to be displayed is entered on the
rightmost display. The next entry is also placed in the right most display but after the
previous display is shifted left by one display position.
Page 14
N
y
bu
to
k
lic
.d o
m
o
c u -tr a c k
.d o
N
y
bu
to
k
lic
C
In this mode, if the control line goes low, the data on return lines is stored in the
FIFO byte by byte.
FIFO Status
FIFO status is used in keyboard and strobed input modes to indicate the number
of characters in the FIFO and to indicate error.
Overrun error occurs when the entry of another character into a full FIFO is
attempted. Underrun error occurs when the CPU tries to read an empty FIFO.
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
bu
to
k
lic
b) Programmable clock:
The clock for operation of 8279 is obtained by dividing the external clock input
signal by a programmable constant called prescaler.
Microprocessor
Page 15
.d o
.c
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
bu
to
k
lic
The CD2, CD1, CD0 is a selectable blanking code to clear all the rows of the display RAM
CD Clear display RAM
CF Clear FIFO status
CA Clear All
7. Explain the block diagram of 8253 Programmable Interval timer with neat sketch.
8254 can be operated at frequency of up to 8MHz whereas 8253 can be
operated only up to a maximum frequency of 2.6MHz.
Features of IC 8253.
Generation of accurate time delay
Three independent 16-bit down counters called as channels
Six different programmable operating modes
Microprocessor
Page 16
.d o
.c
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
k
w
The three independent 16-bit timers named as Counter 0, Counter 1 and Counter 2.
These counters are programmed to start counting and stop counting using software
instructions written to the control register.
The count value can also be read using the data bus to the microprocessor.
The three independent 16-bit timers named as Counter 0, Counter 1 and Counter 2.
These counters are programmed to start counting and stop counting using software
instructions written to the control register.
The count value can also be read using the data bus to the microprocessor.
Microprocessor
Page 17
.d o
.c
lic
o
c u -tr a c k
.d o
lic
to
bu
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
bu
to
k
lic
CS Active low Chip select control signal is used to select the chip.
A0 and A1 address lines are used to select one of four registers in the 8253 Three
counters and one control register.
RD and WR - Active low control signals are issued by the processor to indicate whether it
is reading or writing to 8253 registers.
GATE - The control input line is used to start or stop the counting operation.
OUT signal from each counter can be used to indicate the completion of required
counting or timing operation and also to interrupt the processor.
D0 D7: An 8-bit data bus is available on the 8253 pins to interface the IC with the
microprocessor.
CLK Clock signal used to count
Microprocessor
Page 18
.d o
.c
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
bu
to
k
lic
Microprocessor
Page 19
.d o
.c
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
k
lic
.c
After the Control Word is written, OUT is initially low, and will remain low until the
Counter reaches zero.
OUT then goes high and remains high until a new count or a new Mode 0 Control Word
is written into the Counter.
GATE = 1 enables counting; GATE = 0 disables counting.
GATE has no effect on OUT.
Microprocessor
Page 20
.d o
m
o
c u -tr a c k
C
w
.d o
lic
to
bu
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
k
lic
.c
Page 21
.d o
m
o
c u -tr a c k
C
w
.d o
lic
to
bu
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
k
lic
.c
OUT will be initially high. When the initial count expires, OUT will go low for one CLK
pulse and then go high again.
The counting sequence is ``triggered by writing the initial count.
GATE = 1 enables counting; GATE = 0 disables counting.
GATE has no effect on OUT.
Microprocessor
Page 22
.d o
m
o
c u -tr a c k
C
w
.d o
lic
to
bu
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
k
lic
.c
Microprocessor
Page 23
.d o
m
o
c u -tr a c k
C
w
.d o
lic
to
bu
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
k
lic
.c
Using the Read / Write logic, 8259 is interfaced with the processor.
The data bus lines D0-D7 are connected to the data lines of the processor. 8259 chip will
be selected using the line.
Address line A0 is used to select the control word or the data word. If A0 =0, then the
controller selects writing a command word / reading a status. If A0 =1, then the
controller selects another register for writing the initialization words.
The Control logic has INT and INTA.
The INT output pin is used to interrupt the CPU.
The 8259 receives the interrupt acknowledge INTA pulse from the CPU through its input.
8259 can receive interrupt signals from eight different sources on the lines IR0-IR7.
There are three registers,
An Interrupt Mask Register (IMR)
An Interrupt Request Register (IRR) and
An In-Service Register (ISR).
Microprocessor
Page 24
.d o
m
o
c u -tr a c k
C
w
.d o
lic
to
bu
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
The Interrupt Mask Register (IMR) stores the masking bits of the interrupt lines to be
masked.
The Priority Resolver examines the interrupt registers and determines whether the INT
should be sent to the microprocessor or not.
The Cascade buffer or Comparator is used to expand the number of interrupt levels by
cascading two or more 8259s.
8259 can be used in cascaded mode. Up to eight slave 8259s may be cascaded to a
master 8259 to provide up to 64 IRQs.
8259s are cascaded by connecting the INT line of one slave 8259 to the IRQ line of one
master 8259.
Operation of 8259
The following steps show how interrupt handling is done when an external device
places interrupt request on the IR lines of 8259.
One or more of the IR lines may go high. Corresponding IRR bit is set.
8259 evaluates the request based masking and priority and sends interrupt request - INT
to the CPU.
CPU in turn sends INTA to 8259
Highest priority ISR is set and IRR is reset in 8259.
8259 releases CALL instruction on data bus.
CALL causes CPU to initiate two mores. The Processor will send two interrupt
acknowledge pulses on its pin to the pin of 8259.
The pulses tell 8259 to send desired interrupt type to the processor onto the data bus.
8259 releases the subroutine address, first lower byte and then higher byte.
The Interrupt service routine is executed in the processor with the following steps.
o Push the flags into stack.
o Clear Interrupt Flag and Trap Flag of the processor.
o Push the return address on to the stack.
o Load that interrupt vector address in the Program counter / Instruction pointer.
Microprocessor
Page 25
N
y
bu
to
w
.d o
The Interrupt Service Register (ISR) stores all the levels that are currently being serviced
.c
lic
k
o
c u -tr a c k
.d o
lic
to
bu
When IRO IR7 lines go high, the requests are stored in the Interrupt Request Register.
w
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
DMA is a method of data transfer between Memory and I/O devices without the
intervention of microprocessor. This method is often used when large block of data is to
be transferred.
To start the DMA process, the microprocessor loads an external register in the DMA
controller with the starting address and secondly the Terminal count register with the
total number of bytes to be transferred.
DMA controller has finished transferring data into or out of memory; the DMA
controller gives control back to the microprocessor.
The microprocessor cannot accomplish any other function during that time a DMA
transfer is taking place.
The main features of 8237 are listed below:
Four Independent DMA channels
Enable and disable control of individual requests
Possibility for Memory to memory transfer
Address Increment or decrement
Cascading and expandable to any number of DMA channels
Block Diagram or Architecture of 8237
Page 26
.d o
10. Draw the block diagram of a DMA controller (8237) and explain its operation.
Microprocessor
.c
lic
k
o
c u -tr a c k
.d o
lic
to
bu
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
bu
to
k
lic
The data bus buffer, timing and control block, DMA channels, corresponding priority
block, Read/write control logic and internal registers are the main components.
The data bus consists of 8-bit tristate pins DB0-DB7. These pins are connected to the
system data bus.
A0-A3 pins are used to select one of the internal registers when 8237 is acting in the
slave mode under the control of the processor.
A4-A7 lines along with A0-A3 lines are used to send the higher order 8-bit addresses
when 8237 is acting as master and doing DMA data transfer.
The timing and control block derives internal timing from clock input, and generates
external control signals.
8237 has 4 separate DMA channels and each channel includes two 16-bit registers, a
DMA register and a Count register.
DRQ0-DRQ3 are the four DMA request signals input to 8237 by external peripheral
devices. These four requests can be prioritized.
Microprocessor
Page 27
.d o
.c
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
Page 28
.d o
Registers in DMA
Microprocessor
.c
lic
k
o
c u -tr a c k
.d o
lic
to
bu
The Priority Encoder block resolves priority contention between DMA channels
w
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
k
This 8-bit register controls the operation of the 8237. It is programmed by the
microprocessor and is cleared by RESET or a Master Clear instruction.
Mode Register
Microprocessor
Page 29
.d o
m
o
.c
lic
o
c u -tr a c k
.d o
lic
to
bu
Command Register
w
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
k
Each channel has a request bit associated with it in the 4-bit Request register. Each
register bit is set or reset separately under software control. The entire register is
cleared by a Reset or Master Clear instruction.
Mask Register
Each mask bit is set when its associated channel produces an EOP if the channel is not
programmed to Autoinitialize.
Each bit of the 4-bit Mask register may also be set or cleared separately or
simultaneously under software control.
Microprocessor
Page 30
.d o
m
o
.c
lic
o
c u -tr a c k
.d o
lic
to
bu
Request Register
w
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
Temporary Register
The Temporary register is used to hold data during memory-to-memory transfers. The
Temporary register always contains the last byte transferred in the previous memory to
memory operation, if not cleared by a Reset or Master Clear.
11. Explain the different modes of operation of DMA controller 8237
DMA controller operates in four modes
Single Transfer Mode
Block Transfer Mode
Demand Transfer Mode
Cascade Mode
Single Transfer Mode
In Single Transfer mode, the device is programmed to make one transfer only.
The word count will be decremented and the address decremented or
incremented following each transfer.
Page 31
.d o
This information includes which channels have reached a terminal count and which
Microprocessor
The Status register contains information about the status of the devices.
.c
lic
k
o
c u -tr a c k
.d o
lic
to
bu
Status Register
w
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
Microprocessor
Page 32
N
y
bu
to
w
.d o
status register is set, an EOP pulse is generated. DREQ must be held active until
.c
lic
k
o
c u -tr a c k
.d o
lic
to
bu
When the word count roll over from zero to FFFFH, a terminal count bit in the
w
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
bu
to
k
lic
The block diagram shows how a DMA transfer takes place between Memory and I/O
device with the help of DMA controller. Here the microprocessor and the DMA
controller timeshare the use of address, data and control buses.
The 8237 Address, Control outputs and data bus pins are connected in parallel with the
system busses. An external latch is required for the upper address byte.
Microprocessor
Page 33
.d o
.c
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
bu
to
k
lic
The following sequences explain the DMA method of data transfer in detail.
The starting address of the data is loaded into the 8237 Current and Base Address
registers for a particular channel, and the length of the block is loaded into the channels
Word Count Register.
The channels mask bit is cleared to enable recognition of a DMA request (DREQ). The
DREQ can either be a hardware signal or a software command.
When the peripheral device has the first byte of data ready, it sends a DMA request DREQ signal to the DMA controller.
If the input (channel) of the DMA controller is unmasked, the DMA controller will send a
hold-request - HRQ signal to the microprocessor HOLD input.
The microprocessor will respond to this input by floating its buses and sends a holdacknowledge signal, to the DMA controller.
Microprocessor
Page 34
.d o
.c
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
Microprocessor
Page 35
.d o
The basic function of the analog to digital converter is to convert the input analog
.c
lic
k
o
c u -tr a c k
.d o
lic
to
bu
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
bu
to
k
lic
The ADC conversion process can be started after applying the analog input to any of the
channels.
The conversion process is started by initializing 8255 with the proper control word.
Microprocessor
Page 36
.d o
.c
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
c u -tr a c k
lic
The start conversion must be issued as a pulse for a minimum duration only. Then the
conversion takes place in the ADC chip, if it is properly powered and clock pulses given.
After the conversion, the logic high End of conversion signal is issued by ADC chip. This
is sensed in the software.
Then the data is read from the data lines after issuing the logic high Output Enable
signal.
15. With diagram, explain the operation or R-2R method of D/A converter.
Digital to analog converters are used to get a proportional analog voltage or
current for the digital data given out by the microprocessor.
Basically there are two types of DAC.
They are R-2R ladder network and weighted resistor network.
The number of bits and the full scale output voltage both will determine the
resolution. For example, an 8 bit DAC can have 256 input combinations and so
has a resolution of (1/256) or 0.39 percentage of the full scale output.
Linearity is a measure of how straight the output is when the output is changed
from minimum value to the maximum value.
The settling time is defined as the time take for the output to settle within prespecified band after the input digital value is applied. Normally, pre-specified
band is [final value(1/2)*Minimum possible output].
Interfacing DAC 0800 with 8086
DAC 0800 is a common digital to analog converter chip that can be easily interfaced to
8086 through 8255.
As the DAC chip can only be connected to an output port of a processor, the 8255 PPI is
essential in the interface. Any one port is enough to interface an 8-bit DAC with 8255.
The other control signals are directly correspondingly connected to either logic 0 or logic
1. The DAC chip gives a proportional current output.
This current output in most cases is difficult to measure and so a current to voltage (I to
V) converter is used at the output. DAC chips have an inbuilt latch.
Microprocessor
Page 37
.d o
.c
.d o
lic
to
bu
Then the Channel selection and Start conversion is done simultaneously as these two
to
bu
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
c u -tr a c k
lic
16. Draw the block diagram to interface a keyboard and a 7 segment LED using 8255
programmable peripheral interface
Driver Circuit for single seven segment display
The BCD to seven segment display decoder IC 7447 converts the four bit BCD code
applied at its input in to the patterns required to display the BCD number.
Microprocessor
Page 38
.d o
.c
voltage.
.d o
lic
to
bu
This latch stores the digital input given by the port A and gives out a proportional
to
bu
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
c u -tr a c k
We can connect two seven segment displays to single eight bit port. One 7447 IC can be
connected to lower four bits and another 7447 can be connected to the higher order 4
bits of the Port A.
So with single 8255 which has 3 parallel I/O ports, we can connect 6 seven segment
displays. This results in more complicated circuit.
Microprocessor
Page 39
lic
.d o
.c
.d o
lic
to
bu
The patterns generated are active low outputs, meaning that logic 0 is given as output
to
bu
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
N
y
bu
to
lic
The seven segment displays are all common anode type and a transistor driver is used
with each display device.
A PNP transistor drive is used to switch between the common anode and +5V.
A logic low is required to turn on the transistor driver and the same is generated using
the decoder IC. Common decoder ICs like 74138 can be used as this IC gives an active
low output on any of its outputs.
The segments of the display devices are all connected together on a common bus and
connected to A3-A0 and B3-B0 outputs of 8279. As the displays are all common anodes,
the data output for illuminating a LED must be logic low.
This means that the logic 1 on all the data lines A3-A0 and B3-B0 will blank the display
and logic 0 in all these lines will display all the segments.
The software part for the display interface consists of initializing the 8279 for the
encoded output and for eight digit display.
Microprocessor
Page 40
.d o
.c
8279.
c u -tr a c k
.d o
lic
to
bu
17. Explain how to interface the and 7- segment LEDs and Hex Key pad (Keyboard ) using
w
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
c u -tr a c k
processor.
Keyboard interface using 8279
The keyboard matrix that can be interfaced using 8279 can be of any size from 2x2 to
8x8. Pins SL3-SL0 sequentially scans each column through a counting operation.
The 74LS138 decoder IC can drive 0's on one line at a time from the SL3-SL0 lines.
The 8279 scans RL pins synchronously with the scan. RL pins incorporate internal pullups, no need for external resistor pull-ups. 8279 does the three jobs of key board scan
putting a low in a scan line, checking a low on the return lines and detecting the key
pressed and then debouncing.
Three column select lines SL0-SL2 are used to apply a low on any one column line and do
consecutive scanning on all column lines.
Any key pressed can be sensed by a low on the return lines. 8279 does this scanning
automatically and stores the key code format into the FIFO RAM.
In this example, the CNTL and SHIFT lines are not used and are connected to logic low.
Microprocessor
Page 41
lic
.d o
.c
8279 will automatically keeps the displays refreshed without the help from the
.d o
lic
to
bu
Then writing the data for display into the display RAM will make the display in the digits.
to
bu
H
F-XC A N GE
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
bu
to
using 8255 programmable peripheral interface. (or) Draw and explain how a keyboard
and a seven segment LED display is connected with 8086.
8086 interfacing with keyboard
Microprocessor
Page 42
.d o
18. Draw and explain the block diagram to interface a keyboard and a 7 segment LED
lic
k
.c
m
o
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
bu
to
k
lic
Microprocessor
Page 43
.d o
.c
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c
H
F-XC A N GE
H
F-XC A N GE
c u -tr a c k
N
y
bu
to
k
lic
Microprocessor
Page 44
.d o
.c
.d o
lic
to
bu
O
W
!
PD
O
W
!
PD
c u -tr a c k
.c