SlideShare a Scribd company logo
1 of 175
SYLLABUS
UNIT III - I/O INTERFACING
Memory Interfacing and I/O interfacing -Parallel
communication interface –Serial communication interface –
D/A and A/D Interface -Timer –Keyboard /display controller –
Interrupt controller –DMA controller –Programming and
applications Case studies: Traffic Light control, LED display ,
LCD display, Keyboard display interface and Alarm
Controller.
PRIYADHARSHINI.S
MEMORY & IO INTERFACING
MEMORY DEVICES I/O DEVICES
2
 interface memory (RAM, ROM, EPROM'...) or I/O
devices to 8086 microprocessor. Several memory
chips or I/O devices can connected to a
microprocessor. An address decoding circuit is used
to select the required I/O device or a memory chip.
3
Memory Mapped IO
• Memory Instructions are
used.
• Memory control signals
are used.
• Arithmetic and logic
operations can be
performed on data.
• Data transfer b/w
register and IO.
IO Mapped IO
• Special Instructions
are used like IN, OUT.
• Special control signals
are used.
• Arithmetic and logic
operations can not be
performed on data.
• Data transfer b/w
accumulator and IO.
4
PARALLEL COMMUNICATION
INTERFACE
INTEL 8255
5
8255 PPI
• The 8255 chip is also called as Programmable Peripheral
Interface.
• The Intel’s 8255 is designed for use with Intel’s 8-bit, 16-bit and
higher capability microprocessors
• The 8255 is a 40 pin integrated circuit (IC), designed to perform
a variety of interface functions in a computer environment.
• It is flexible and economical.
6
PIN DIAGRAM OF 8255
7
SIGNALS OF 8085
8
8255 PIO/PPI
 It has 24 input/output lines which may be
individually programmed.
 2 groups of I/O pins are named as
Group A (Port-A & Port C Upper)
Group B (Port-B & Port C Lower)
 3 ports(each port has 8 bit)
Port A lines are identified by symbols PA0-PA7
Port B lines are identified by symbols PB0-PB7
Port C lines are identified by PC0-PC7 , PC3-PC0
ie: PORT C UPPER(PC7-PC4) , PORT C LOWER(PC3-PC0)
9
D0 - D7: data input/output lines for the device. All
information read from and written to the 8255 occurs via
these 8 data lines.
CS (Chip Select). If this line is a logical 0, the microprocessor
can read and write to the 8255.
RESET : The 8255 is placed into its reset state if this input
line is a logical 1
10
• RD : This is the input line driven by the microprocessor
and should be low to indicate read operation to 8255.
• WR : This is an input line driven by the microprocessor.
A low on this line indicates write operation.
• A1-A0 : These are the address input lines and are driven
by the microprocessor.
11
CONTROL LOGIC
 CS signal is the master Chip Select
 A0 and A1 specify one of the two I/O Ports
CS A1 A0 Selected
0 0 0 Port A
0 0 1 Port B
0 1 0 Port C
0 1 1 Control
Register
1 X X 8255 is not
selected12
BLOCK DIAGRAM OF 8255A
13
BLOCK DIAGRAM OF 8255 (ARCHITECTURE)
It has a 40 pins of 4 parts.
1. Data bus buffer
2. Read/Write control logic
3. Group A and Group B controls
4. Port A, B and C
14
1. DATA BUS BUFFER
 This is a tristate bidirectional buffer used to
interface the 8255 to system data bus. Data is
transmitted or received by the buffer on execution
of input or output instruction by the CPU.
15
2. READ/WRITE CONTROL LOGIC
 This unit accepts control signals ( RD, WR ) and
also inputs from address bus and issues
commands to individual group of control blocks
( Group A, Group B).
 It has the following pins.
CS , RD , WR , RESET , A1 , A0
16
3. GROUP A AND GROUP B CONTROLS
• These block receive control from the CPU and issues
commands to their respective ports.
Group A - PA and PCU ( PC7 –PC4)
Group B – PB and PCL ( PC3 –PC0)
a) Port A: This has an 8 bit latched/buffered O/P and 8 bit
input latch. It can be programmed in 3 modes – mode 0,
mode 1, mode 2.
17
b) Port B: It can be programmed in mode 0, mode1
c) Port C : It can be programmed in mode 0
18
CONTROL WORD REGISTER(CWR)
19
MODES OF OPERATION OF
8255
 Bit Set/Reset(BSR) Mode
 Set/Reset bits in Port C
 I/O Mode
 Mode 0 (Simple input/output)
 Mode 1 (Handshake mode)
 Mode 2 (Bidirectional Data Transfer)
20
1. BSR MODE
21
B3 B2 B1
Bit/pin of port C
selected
0 0 0 PC0
0 0 1 PC1
0 1 0 PC2
0 1 1 PC3
1 0 0 PC4
1 0 1 PC5
1 1 0 PC6
1 1 1 PC7
Concerned only with the 8-bits of Port C.
Set or Reset by control word
Ports A and B are not affected
22
A) MODE 0 (SIMPLE INPUT OR OUTPUT):
• Ports A and B are used as Simple I/O
Ports
• Port C as two 4-bit ports
• Features
– Outputs are latched
– Inputs are not latched
– Ports do not have handshake or
interrupt capability
2. I/O MODE
23
24
B) MODE 1: (INPUT OR OUTPUT WITH
HANDSHAKE)
• Handshake signals are exchanged
between MPU & Peripherals
• Features
– Ports A and B are used as Simple I/O Ports
– Each port uses 3 lines from Port C as
handshake signals
– Input & Output data are latched
– interrupt logic supported
25
c) Mode 2: Bidirectional Data
Transfer
• Used primarily in applications such as
data transfer between two computers
• Features
– Ports A can be configured as the
bidirectional Port
– Port B in Mode 0 or Mode 1.
– Port A uses 5 Signals from Port C as
handshake signals for data transfer
– Remaining 3 Signals from Port C Used as
– Simple I/O or handshake for Port B
26
FIND CONTROL WORD
(1) PORT A: OUTPUT WITH HANDSHAKE
(2) PORT B: INPUT WITH HANDSHAKE
(3) PORT CL: OUTPUT (4)PORT CU: INPUT
 Solution:
1 0 1 0 1 1 1 0 = AEH
27
FIND THE CONTROL WORD FOR THE REGISTER
ARRANGEMENT
OF THE PORTS OF INTEL 8255 FOR MODE 0 OPERATION.
 Port A: Output, Port B: Output,
 Port CU: Output, Port CL: Output
Solution:
1 0 0 0 0 0 0 0 = 80H
The control word register for the above ports of
Intel 8255 is 80H.
28
FIND THE CONTROL WORD FOR THE REGISTER
ARRANGEMENT
OF THE PORTS OF INTEL 8255 FOR MODE 0
OPERATION.
 Port A: Input, Port B: Input,
 Port CU: Input, Port CL: Input
Solution:
1 0 0 1 1 0 1 1 = 9BH
The control word register for the above ports of
intel 8255 is 9BH.
29
BASICS OF SERIAL COMMUNICATION
1. Transmitter:
- A parallel-in, serial-out
shift register
Receiver:
- A serial-in, parallel-out
shift register.
-
30
Parallel Transfer
TRANSMITTER
Receiver
31
SERIAL COMMUNICATION
INTERFACE
INTEL 8251 USART
32
UNIVERSAL SYNCHRONOUS
ASYNCHRONOUS RECEIVER
TRANSMITTER (USART)
 Programmable chip designed for synchronous and
asynchronous serial data transmission
 28 pin DIP
 Coverts the parallel data into a serial stream of bits
suitable for serial transmission.
 Receives a serial stream of bits and convert it into
parallel data bytes to be read by a microprocessor.
33
34
BLOCK DIAGRAM
35
FIVE SECTIONS
– Read/Write Control Logic
• Interfaces the chip with MPU
• Determine the functions according to the control word
• Monitors data flow
– Transmitter
• Converts parallel word received from MPU into serial bits
• Transmits serial bits over TXD line to a peripheral.
– Receiver
• Receives serial bits from peripheral
• Converts serial bits into parallel word
• Transfers the parallel word to the MPU
– Data Bus Buffer- 8 bit Bidirectional bus.
– Modem Controller
• Used to establish data communication modems over
telephone line
36
INPUT SIGNALS
 CS – Chip Select
 When this signal goes low, 8251 is selected by MPU for
communication
 C/D – Control/Data
 When this signal is high, the control register or status register
is addressed
 When it is low, the data buffer is addressed
 Control and Status register is differentiated by WR and RD
signals, respectively
37
• WR – Write
– writes in the control register or sends outputs to the data
buffer.
– This connected to IOW or MEMW
• RD – Read
– Either reads a status from status register or accepts data from
the data buffer
– This is connected to either IOR or MEMR
• RESET - Reset
• CLK - Clock
– Connected to system clock
– Necessary for communication with microprocessor.
38
CS C/D RD WR Function
0 1 1 0 MPU writes instruction in the
control register
0 1 0 1 MPU reads status from the status
register
0 0 1 0 MPU outputs the data to the Data
Buffer
0 0 0 1 MPU accepts data from the Data
Buffer
1 X X X USART is not Selected
39
• Control Register
– 16-bit register
– This register can be accessed an output port
when the C/D pin is high
• Status Register
– Checks ready status of a peripheral
• Data Buffer
40
TRANSMITTER SECTION
 Accepts parallel data and converts it into serial data
 Two registers
 Buffer Register
 To hold eight bits
 Output Register
 Converts eight bits into a stream of serial bits
 Transmits data on TxD pin with appropriate framing
bits(Start and Stop)
41
SIGNALS ASSOCIATED WITH TRANSMITTER
SECTION
• TxD – Transmit Data
– Serial bits are transmitted on this line
• TxC – Transmitter Clock
– Controls the rate at which bits are transmitted
• TxRDY – Transmitter Ready
– Can be used either to interrupt the MPU or indicate the status
• TxE – Transmitter Empty
– Logic 1 on this line indicate that the output register is empty
42
RECEIVER SECTION
 Accepts serial data from peripheral and converts it
into parallel data
 The section has two registers
 Input Register
 Buffer Register
43
SIGNALS ASSOCIATED WITH RECEIVER SECTION
 RxD – Receive Data
 Bits are received serially on this line and converted into
parallel byte in the receiver input
 RxC – Receiver Clock
 RxRDY – Receiver Ready
 It goes high when the USART has a character in the buffer
register and is ready to transfer it to the MPU
44
SIGNALS ASSOCIATED WITH MODEM CONTROL
• DSR- Data Set Ready
– Normally used to check if the Data Set is ready when
communicating with a modem
• DTR – Data Terminal Ready
– device is ready to accept data when the 8251 is communicating with
a modem.
• RTS – Request to send Data
– the receiver is ready to receive a data byte from modem
• CTS – Clear to Send
45
CONTROL WORDS
46
47
48
49
50
Interfacing of 8255(PPI) with 8085 processor:
51
52
11-
53
Programming 8251
 8251 mode register
7 6 5 4 3 2 1 0 Mode register
Number of
Stop bits
00: invalid
01: 1 bit
10: 1.5 bits
11: 2 bits
Parity
0: odd
1: even
Parity enable
0: disable
1: enable
Character length
00: 5 bits
01: 6 bits
10: 7 bits
11: 8 bits
Baud Rate
00: Syn. Mode
01: x1 clock
10: x16 clock
11: x64 clock
11-
54
 8251 command register
EH IR RTS ER SBRK RxE DTR TxE command register
TxE: transmit enable
DTR: data terminal ready, DTR pin will be low
RxE: receiver enable
SBPRK: send break character, TxD pin will be low
ER: error reset
RTS: request to send, CTS pin will be low
IR: internal reset
EH: enter hunt mode (1=enable search for SYN character)
11-
55
 8251 status register
DSR SYNDET FE OE PE TxEMPTY RxRDY TxRDY status
register
TxRDY: transmit ready
RxRDY: receiver ready
TxEMPTY: transmitter empty
PE: parity error
OE: overrun error
FE: framing error
SYNDET: sync. character detected
DSR: data set ready
ANALOG TO DIGITAL (A/D) INTERFACE
56
ADC 0808/0809
 The analog to digital converter chips 0808 and 0809 are
8-bit CMOS,successive approximation converters.
 Successive approximation technique is one of the fast
techniques for analog to digital conversion. The
conversion delay is 100 µs at a clock frequency of 640
kHz.
57
BLOCK DIAGRAM ADC 0808/0809
58
59
INTERFACING ADC 0808 WITH 8086
60
61
DIGITAL TO ANALOG (D/A) INTERFACE
62
INTERFACING DIGITAL TO ANALOG
ONVERTERS
The digital to analog converters convert binary
numbers into their analog equivalent voltages or
currents.
Techniques are employed for digital to analog
conversion.
 i. Weighted resistor network
 ii. R-2R ladder network
 iii. Current output D/A converter
63
 The DAC find applications in areas like digitally controlled
gains, motor speed control, programmable gain
amplifiers, digital voltmeters, panel meters, etc.
 In a compact disk audio player for example a 14 or16-bit
D/A converter is used to convert the binary data read off
the disk by a laser to an analog audio signal.
Characteristics :
1. Resolution: It is a change in analog output for one
LSB change in digital input.
It is given by(1/2^n )*Vref. If n=8 (i.e.8-bit DAC)
1/256*5V=39.06mV
2. Settling time: It is the time required for the DAC to
settle for a full scale code change.
64
DAC 0800 8-bit Digital to Analog converter
Features:
i. DAC0800 is a monolithic 8-bit DAC manufactured by
National semiconductor.
ii. It has settling time around 100ms
iii. It can operate on a range of power supply voltage i.e.
from 4.5V to +18V. Usually the supply V+ is 5V or
+12V.
The V- pin can be kept at a minimum of -12V.
iv. Resolution of the DAC is 39.06mV
65
PIN DIAGRAM OF DAC 0800
66
INTERFACING OF DAC0800 WITH 8086
67
TIMER/COUNTER
INTEL 8253/8254
68
PIN DIAGRAM
69
 RD: read signal
 WR: write signal
 CS: chip select signal
 A0, A1: address lines
 Clock :This is the clock input for the counter. The counter
is 16 bits.
 Out :This single output line is the signal that is the final
programmed output of the device.
 Gate :This input can act as a gate for the clock input line,
or it can act as a start pulse,
70
71
CONTROL WORD REGISTER :THIS INTERNAL REGISTER IS USED TO WRITE
INFORMATION
72
8254 PROGRAMMING
11-
73
8254 MODES
Gate is low the
count will be
paused
Gate is high
Will continue
counting
Mode 0: An events counter enabled with G.
Mode 1: One-shot mode. s
Gate is
High output
will be high
Counter will be reloaded
After gate high.
74
Mode 2: Counter generates a series of pulses 1 clock
pulse wide
Mode 3: Generates a continuous square-wave with G set to 1
cycle is repeated until
reprogrammed or G pin
set to 0
If count is even, 50% duty cycle
otherwise OUT is high 1 cycle
longer
75
Mode 4: Software triggered one-shot.
Mode 5: Hardware triggered one-shot. G controls similar to Mode 1.
In the last counting
Will be stop
(not repeated)
In the last count
Out will be low
76
KEYBOARD/DISPLAY
CONTROLLER
INTEL 8279
77
INTRODUCTION
The INTEL 8279 is specially developed for
interfacing keyboard and display devices to
8085/8086 microprocessor based system
78
FEATURES OF 8279
 Simultaneous keyboard and display operations
 Scanned keyboard mode
 Scanned sensor mode
 8-character keyboard FIFO
 1 6-character display
79
PIN DIAGRAM
80
4 SECTIONS
Keyboard section
Display section
Scan section
CPU interface section
81
82
83
KEYBOARD SECTION
 The keyboard section consists of 8 return lines
RL0 - RL7 that can be used to form the columns
of a keyboard matrix.
 It has two additional input : shift and
control/strobe. The keys are automatically
debounced.
 The two operating modes of keyboard section
are 2-key lockout and N-key rollover.
84
 In the 2-key lockout mode, if two keys are pressed
simultaneously, only the first key is recognized.
 In the N-key rollover mode simultaneous keys are
recognized and their codes are stored in FIFO.
 The keyboard section also have an 8 x 8 FIFO (First
In First Out) RAM.
 The FIFO can store eight key codes in the
scan keyboard mode. The status of the shift
key and control key are also stored along
with key code. The 8279 generate an interrupt
signal (IRQ)when there is an entry in FIFO.
85
DISPLAY SECTION
 The display section has eight output lines
divided into two groups A0-A3 and B0-B3.
 The output lines can be used either as a single
group of eight lines or as two groups of four
lines, in conjunction with the scan lines for a
multiplexed display.
 The output lines are connected to the anodes
through driver transistor in case of common
cathode 7-segment LEDs.
86
 The cathodes are connected to scan lines
through driver transistors.
 The display can be blanked by BD (low) line.
 The display section consists of 16 x 8 display
RAM. The CPU can read from or write into any
location of the display RAM.
87
SCAN SECTION
 The scan section has a scan counter and
four scan lines, SL0 to SL3.
 In decoded scan mode, the output of scan
lines will be similar to a 2-to-4 decoder.
 In encoded scan mode, the output of scan
lines will be binary count, and so an
external decoder should be used to convert
the binary count to decoded output.
 The scan lines are common for keyboard
and display.
88
CPU INTERFACE SECTION
 The CPU interface section takes care of data
transfer between 8279 and the processor.
 This section has eight bidirectional data lines
DB0 to DB7 for data transfer between 8279 and
CPU.
 It requires two internal address A =0 for
selecting data buffer and A = 1 for selecting
control register of8279.
89
 The control signals WR (low), RD (low), CS (low) and
A0 are used for read/write to 8279.
 It has an interrupt request line IRQ, for interrupt
driven data transfer with processor.
 The 8279 require an internal clock frequency of 100
kHz. This can be obtained by dividing the input clock
by an internal prescaler.
90
All the command words or status words are written or
read with A0 = 1 and CS = 0 to or from 8279.
a) Keyboard Display Mode Set : The format of the command word to select
different modes of operation of 8279 is given below with its bit definitions.
D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 D D K K K
91
SENSOR MATRIX
SENSOR MATRIX
92
B) Programmable clock :
The clock for operation of 8279 is obtained by
dividing the external clock input signal by a
programmable constant called prescaler.
 PPPPP is a 5-bit binary constant.
The input frequency is divided by a decimal
constant ranging from 2 to 31, decided by the bits of
an internal prescaler, PPPPP.
D7 D6 D5 D4 D3 D2 D1 D0
0 0 1 P P P P P
93
c) Read FIFO / Sensor RAM : The format of this command is
given below.
AI – Auto Increment Flag
AAA – Address pointer to 8 bit FIFO RAM
X- Don’t care
This word is written to set up 8279 for reading FIFO/ sensor
RAM.
In scanned keyboard mode, AI and AAA bits are of no use.
The 8279 will automatically drive data bus for each
subsequent read, in the same sequence, in which the data
was entered.
In sensor matrix mode, the bits AAA select one of the 8
rows of RAM.
If AI flag is set, each successive read will be from the
subsequent RAM location.
D7 D6 D5 D4 D3 D2 D1 D0
0 1 0 AI X A A A
94
d) Read Display RAM :
This command enables a programmer to read the display RAM
data.
The CPU writes this command word to 8279 to prepare
it for display RAM read operation.
AI is auto increment flag and AAAA, the 4-bit address
points to the 16-byte display RAM that is to be read.
If AI=1, the address will be automatically, incremented
after each read or write to the Display RAM.
The same address counter is used for reading and
writing.
D7 D6 D5 D4 D3 D2 D1 D0
0 1 1 AI A A A A
95
d) Write Display RAM :
This command enables a programmer to write the display RAM
data.
AI – Auto increment Flag.
AAAA – 4 bit address for 16-bit display RAM to be
written.
e) Display Write Inhibit/Blanking :
D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 AI A A A A
D7 D6 D5 D4 D3 D2 D1 D0
1 0 1 X IW IW BL BL
IW - inhibit write flag
BL - blank display bit flags
96
g) Clear Display RAM :
ENABLES CLEAR DISPLAY
WHEN CD2=1
• CD2 must be 1 for enabling the clear display command.
• If CD2 = 0, the clear display command is invoked by setting
CA(CLEAR ALL) =1 and maintaining CD1, CD0 bits exactly
same as above.
• If CF(CLEAR FIFO RAM STATUS) =1, FIFO status is
cleared and IRQ line is pulled down and the sensor RAM
pointer is set to row 0.
•If CA=1, this combines the effect of CD and CF bits.
D7 D6 D5 D4 D3 D2 D1 D0
1 1 0 CD2 CD1 CD0 CF CA
CD2 CD1 CD0
0X - All zeros ( x don’t care ) AB=00
10 - A3-A0 =2 (0010) and B3-B0=00 (0000)
11 - All ones (AB =FF), i.e. clear RAM
97
h) End Interrupt / Error mode Set :
E- Error mode
X- don’t care
For the sensor matrix mode, this command lowers
the IRQ line and enables further writing into the RAM.
Otherwise, if a change in sensor value is detected,
IRQ goes high that inhibits writing in the sensor RAM.
 For N-Key roll over mode, if the E bit is
programmed to be ‘1’, the 8279 operates in special
Error mode
D7 D6 D5 D4 D3 D2 D1 D0
1 1 1 E X X X 1
98
INTERRUPT
CONTROLLER
INTEL 8259
99
1. This IC is designed to simplify the implementation of the interrupt interface in the 8088
and 8086 based microcomputer systems.
2. This device is known as a ‘Programmable Interrupt Controller’ or PIC.
3. It is manufactured using the NMOS technology and It is available in 28-pin DIP.
4. The operation of the PIC is programmable under software control (Programmable)and it
can be configured for a wide variety of applications.
5. 8259A is treated as peripheral in a microcomputer system.
6. 8259A PIC adds eight vectored priority encoded interrupts to the microprocessor.
7. This controller can be expanded without additional hardware to accept up to 64
interrupt request inputs. This expansion required a master 8259A and eight 8259A
slaves.
8. Some of its programmable features are:
· The ability to accept level-triggered or edge-triggered inputs.
· The ability to be easily cascaded to expand from 8 to 64 interrupt-inputs.
· Its ability to be configured to implement a wide variety of priority schemes.
8259 Programmable Interrupt Controller (PIC)
8259A PIC- PIN DIGRAM
8
2
5
9
ASSINGMENT OF SIGNALS FOR 8259:
1. D7- D0 is connected to microprocessor data bus D7-D0 (AD7-AD0).
2. IR7- IR0, Interrupt Request inputs are used to request an interrupt and to connect to a
slave in a system with multiple 8259As.
3. WR - the write input connects to write strobe signal of microprocessor.
4. RD - the read input connects to the IORC signal.
5. INT - the interrupt output connects to the INTR pin on the microprocessor from the
master, and is connected to a master IR pin on a slave.
6. INTA - the interrupt acknowledge is an input that connects to the INTA signal on the
system. In a system with a master and slaves, only the master INTA signal is connected.
7. A0 - this address input selects different command words within the 8259A.
8. CS - chip select enables the 8259A for programming and control.
9. SP/EN - Slave Program/Enable Buffer is a dual-function pin.
When the 8259A is in buffered mode, this pin is an
output that controls the data bus transceivers in a
large microprocessor-based system.
When the 8259A is not in buffered mode, this pin
programs the device as a master (1) or a slave (0).
CAS2-CAS0, the cascade lines are used as outputs from
the master to the slaves for cascading multiple
8259As in a system.
8259A PIC- BLOCK DIAGRAM
The 82C59A accepts two types of command words generated by the
CPU:
1. Initialization Command Words (ICWs):
Before normal operation can begin, each 82C59A in the
system must be brought to a starting point - by a sequence of 2 to
4 bytes timed by WR pulses.
• Operational Command Words (OCWs):
These are the command words which command the 82C59A
to operate in various interrupt modes. Among these modes are:
a. Fully nested mode.
b. Rotating priority mode.
c. Special mask mode.
d. Polled mode.
The OCWs can be written into the 82C59A anytime after
initialization.
Programming the 8259A: -
 To program this ICW for 8086 we place a logic 1 in bit IC4.
 Bits D7, D6 , D5and D2 are don’t care for microprocessor operation and only
apply to the 8259A when used with an 8-bit 8085 microprocessor.
 This ICW selects single or cascade operation by programming the SNGL bit. If
cascade operation is selected, we must also program ICW3.
 The LTIM bit determines whether the interrupt request inputs are positive edge
triggered or level-triggered.
ICW1:
 Selects the vector number used with the interrupt request inputs.
 For example, if we decide to program the 8259A so that it functions at vector
locations 08H-0FH, we place a 08H into this command word.
 Likewise, if we decide to program the 8259A for vectors 70H-77H, we place a
70H in this ICW.
ICW2:
 Is used only when ICW1 indicates that the system is operated in cascade mode.
 This ICW indicates where the slave is connected to the master.
 For example, if we connected a slave to IR2, then to program ICW3 for this
connection, in both master and slave, we place a 04H in ICW3.
 Suppose we have two slaves connected to a master using IR0 and IR1. The
master is programmed with an ICW3 of 03H; one slave is programmed with an
ICW3 of 01H and the other with an ICW3 of 02H.
ICW3:
 Is programmed for use with the 8088/8086. This ICW
is not programmed in a system that functions with the
8085 microprocessors.
 The rightmost bit must be logic 1 to select operation
with the 8086 microprocessor, and the remaining bits
are programmed as follows:
ICW4:
 Is used to set and read the interrupt mask register.
 When a mask bit is set, it will turn off (mask) the corresponding
interrupt input. The mask register is read when OCW1 is read.
 Because the state of the mask bits is known when the 8259A is
first initialized, OCW1 must be programmed after programming
the ICW upon initialization.
Operation Command Words
OCW1:
 Is programmed only when the AEOI mod is not selected for the 8259A.
 In this case, this OCW selects how the 8259A responds to an interrupt.
 The modes are listed as follows in next slide:
OCW2:
 Selects the register to be read, the operation of the special mask register, and
the poll command.
 If polling is selected, the P-bit must be set and then output to the 8259A. The
next read operation would read the poll word. The rightmost three bits of the
poll word indicate the active interrupt request with the highest priority.
 The leftmost bit indicates whether there is an interrupt, and must be checked
to determine whether the rightmost three bits contain valid information.
OCW3:
INTRODUCTION:
 Direct Memory Access (DMA) is a method of allowing
data to be moved from one location to another in a
computer without intervention from the central processor
(CPU).
 It is also a fast way of transferring data within (and
sometimes between) computer.
 The DMA I/O technique provides direct access to the
memory while the microprocessor is temporarily
disabled.
 The DMA controller temporarily borrows the address
bus, data bus and control bus from the microprocessor
and transfers the data directly from the external devices
to a series of memory locations (and vice versa).
132
 Supplies memory and I/O with control signals and addresses
during DMA transfer
 4-channels (expandable)
 0: DRAM refresh
 1: Free
 2: Floppy disk controller
 3: Free
 1.6MByte/sec transfer rate
 64 KByte section of memory address capability with single
programming
 “fly-by” controller (data does not pass through the DMA-only
memory to I/O transfer capability)
 Initialization involves writing into each channel:
 i) The address of the first byte of the block of data that must be transferred
(called the base address).
 ii) The number of bytes to be transferred (called the word count).
133
THE 8237 DMA CONTROLLER
8237 PINS
 CLK: System clock
 CS΄: Chip select (decoder output)
 RESET: Clears registers, sets mask register
 READY: 0 for inserting wait states
 HLDA: Signals that the μp has relinquished buses
 DREQ3 – DREQ0: DMA request input for each channel
 DB7-DB0: Data bus pins
 IOR΄: Bidirectional pin used during programming
and during a DMA write cycle
 IOW΄: Bidirectional pin used during programming
and during a DMA read cycle
 EOP΄: End of process is a bidirectional signal used as input to terminate a DMA
process or as output to signal the end of the DMA transfer
 A3-A0: Address pins for selecting internal registers
 A7-A4: Outputs that provide part of the DMA transfer address
 HRQ: DMA request output
 DACK3-DACK0: DMA acknowledge for each channel.
 AEN: Address enable signal
 ADSTB: Address strobe
 MEMR΄: Memory read output used in DMA read cycle
 MEMW΄: Memory write output used in DMA write cycle
134
8237 BLOCK DIAGRAM
135
BLOCK DIAGRAM DESCRIPTION
 It containing Five main Blocks.
1. Data bus buffer
2. Read/Control logic
3. Control logic block
4. Priority resolver
5. DMA channels.
136
DATA BUS BUFFER:
 It contain tristate ,8 bit bi-directional buffer.
 Slave mode ,it transfer data between
microprocessor and internal data bus.
 Master mode ,the outputs A8-A15 bits of
memory address on data lines
(Unidirectional).
READ/CONTROL LOGIC:
 It control all internal Read/Write operation.
 Slave mode ,it accepts address bits and control signal from
microprocessor.
 Master mode ,it generate address bits and control signal.
137
Control logic block
 It contains ,
1. Control logic
2. Mode set register and
3. Status Register.
CONTROL LOGIC:
 Master mode ,It control the sequence of DMA
operation during all DMA cycles.
 It generates address and control signals.
 It increments 16 bit address and decrement 14
bit counter registers.
 It activate a HRQ signal on DMA channel
Request.
 Slave ,mode it is disabled. 138
DMA controller details
139
PROGRAMMING AND
APPLICATIONS CASE
STUDIES
1.TRAFFIC LIGHT CONTROL
2.LED DISPLAY
3.LCD DISPLAY
4.KEYBOARD DISPLAY INTERFACE
5.ALARM CONTROLLER
140
1. TRAFFIC
LIGHT
CONTROL 141
 Traffic lights, which may also be known as stoplights,
traffic lamps, traffic signals, signal lights, robots or
semaphore, are signaling devices positioned at road
intersections, pedestrian crossings and other
locations to control competing flows of traffic.
 INTERFACING TRAFFIC LIGHT WITH 8086
The Traffic light controller section consists of 12
Nos. point led’s arranged by 4Lanes in Traffic light
interface card. Each lane has Go(Green),
Listen(Yellow) and Stop(Red) LED is being placed.
142
LAN Direction 8086 LINES MODULES
SOUTH
PA.0 GO
PA.1 LISTEN
PA.2 STOP
EAST
PA.3 GO
PA.4 LISTEN
PA.5 STOP
NORTH
PA.6 GO
PA.7 LISTEN
PB.0 STOP
WEST
PB.1 GO
PB.2 LISTEN
PB.3 STOP
13-16 No Connection
PWR
17,189 Supply from
microcontroller
18,20
143
CIRCUIT DIAGRAM TO INTERFACE TRAFFIC LIGHT WITH 8086
144
8086 ALP:
1100: START: MOV BX, 1200H
MOV CX, 0008H
MOV AL,[BX]
MOV DX, CONTROL PORT
OUT DX, AL
INC BX
NEXT: MOV AL,[BX]
MOV DX, PORT A
OUT DX,AL
CALL DELAY
INC BX
LOOP NEXT
JMP START
DELAY: PUSH CX
MOV CX,0005H
REPEAT: MOV DX,0FFFFH
LOOP2: DEC DX
JNZ LOOP2
LOOP REPEAT
POP CX
RET
145
LOOKUP TABLE
 1200 80H
 1201 21H,09H,10H,00H (SOUTH WAY)
 1205 0CH,09H,80H,00H (EAST WAY)
 1209 64H,08H,00H,04H (NOURTH WAY)
 120D 24H,03H,02H,00H (WEST WAY)
 1211 END
146
2. LED
DISPLAY
147
Light Emitting Diodes (LED) is the most
commonly used components, usually for displaying pins
digital states. Typical uses of LEDs include alarm
devices, timers and confirmation of user input such as a
mouse click or keystroke.
INTERFACING LED
Anode is connected through a resistor to GND & the
Cathode is connected to the Microprocessor pin. So
when the Port Pin is HIGH the LED is OFF & when the
Port Pin is LOW the LED is turned ON.
148
PIN ASSIGNMENT WITH 8086
149
INTERFACE LED WITH 8255
150
8086 ALP LED INTERFACE
1100: START: MOV AL, 80
MOV DX, FF36
OUT DX, AL
BEGIN: MOV AL, 00
MOV DX, FF30
OUT DX, AL
CALL DELAY
MOV AL, FF
OUT DX, AL
CALL DELAY
JMP BEGIN
DELAY: MOV CX, FFFF
PO: DEC CX
JNE PO
RET
151
3. LCD
DISPLAY
152
153
HARDWARE CONFIGURATION OF LCD
WITH 8051/8086/8085
154
LCD INTERFACING WITH 8086
TRAINER KIT
 GPIO- I (8255) J1 Connector
PORTS ADDRESS
Control port FF26
PORT A FF20
PORT B FF22
PORT C FF24
 GPIO- I (8255) J4 Connector
PORTS ADDRESS
Control port FF36
PORT A FF30
PORT B FF32
PORT C FF34 155
156
LCD INTERFACING WITH 8051 TRAINER KIT
 GPIO- I (8255) J1 Connector
PORTS ADDRESS
Control port 4003
PORT A 4000
PORT B 4001
PORT C 4002
Used in UNIT 5 also
157
158
4. KEYBOARD DISPLAY
INTERFACE
159
HARDWARE DESCRIPTION OF 8279 INTERFACE CARD
Keyboard and display is configured in the encoded
mode. In the encoded mode, a binary count sequence is
put on the scan lines SL0-SL3. These lines must be
externally decoded to provide the scan lines for keyboard
and display. A 3 to 8 decoder 74LS138 is provided for this
purpose. The S0-S1 output lines of this decoder are
connected to the two rows of the keyboard. And QA0 to
QA7 is connected to 7 Segment Display
160
PIN DIAGRAM OF 8279 PIN DIAGRAMOF 74LS138
Presented by C.GOKUL,AP/EEE , Velalar College of Engg & Tech, Erode
161
DETECTING A MATRIX KEYBOARD KEY PRESS
162
163
MVI A, 00H Initialize keyboard/display in encoded
OUT 81H scan keyboard 2 key lockout mode
MVI A, 34H
OUT 81H Initialize prescaler count
MVI A, 0BH Load mask pattern to enable RST 7.5
SIM mask other interrupts
EI Enable Interrupt
HERE: JMP HERE Wait for the interrupt
Interrupt service routine
MVI A, 40H Initialize 8279 in read FIFO RAM mode
OUT 81H
IN 80H Get keycode
MVI H, 62H Initialize memory pointer to point
MOV L, A 7-Segment code
MVI A, 80H : Initialize 8279 in write display RAM mode
OUT 81H
MOV A, M : Get the 7 segment code
OUT 80H : Write 7-segment code in display RAM
EI : Enable interrupt
RET : Return to main program
164
5. ALARM
CONTROLLER
Relevant
Material
Not exact
165
HARDWARE DESCRIPTION OF RELAY
& BUZZER INTERFACE
166
TO INTERFACE RELAY AND BUZZER WITH 8086 TRAINER KIT
AND TO ON/OFF RELAY AND BUZZER CARD
 GPIO- I J1 Connecter
PORTS
ADDRESS
Control port FF26
PORT A
FF20
PORT B
FF22
PORT C
FF24
 GPIO- II J1 Connecter
PORTS
ADDRESS
Control port FF36
PORT A
FF30
PORT B
FF32
167
BASICS
MICROPROCESSOR &
MICROCONTROLLER
168
WHAT IS MICROCONTROLLER?
Micro Controller
169
Very Small A mechanism that controls
the operation of a machine
MICROPROCESSORS
 CPU for Computers
 No RAM, ROM, I/O on CPU chip itself
 Example: Intel's x86, Motorola’s 680x0
170
MICROCONTROLLER
 A smaller computer
 On-chip RAM, ROM, I/O ports...
 Example: Motorola’s 6811, Intel’s 8051, Zilog’s Z8 and PIC
171
172
MICROPROCESSOR VS. MICROCONTROLLER
Microprocessor
 CPU is stand-alone, RAM,
ROM, I/O, timer are
separate
 Designer can decide on the
amount of ROM, RAM and
I/O ports.
 Expansive
 General-purpose
Microcontroller
 CPU, RAM, ROM, I/O and timer
are all on a single chip
 Fix amount of on-chip ROM,
RAM, I/O ports
 For applications in which cost,
power and space are critical
 Not Expansive
 Single-purpose 173
MICROCONTROLLERS APPLICATIONS
 Home
 Appliances, intercom, telephones, security systems, garage door openers,
answering machines, fax machines, home computers, TVs, cable TV
tuner, VCR, camcorder, remote controls, video games, cellular phones,
musical instruments, sewing machines, lighting control, paging, camera,
pinball machines, toys, exercise equipment etc.
Office
 Telephones, computers, security systems, fax machines, microwave,
copier, laser printer, color printer, paging etc.
 Auto
 Trip computer, engine control, air bag, ABS, instrumentation, security
system, transmission control, entertainment, climate control, cellular
phone, keyless entry
174
Thank You

More Related Content

Similar to MicroProcessors and MicroControllersUnit3

MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pptMECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pptCHANDRA KUMAR S
 
UNIT 3 Peripheral Interfacing.pptx
UNIT 3 Peripheral Interfacing.pptxUNIT 3 Peripheral Interfacing.pptx
UNIT 3 Peripheral Interfacing.pptxGowrishankar C
 
8251 communication interface
8251 communication interface8251 communication interface
8251 communication interfaceLingalaSowjanya
 
8251 a usart programmable communication interface(1)
8251 a usart   programmable communication interface(1)8251 a usart   programmable communication interface(1)
8251 a usart programmable communication interface(1)divyangpit
 
8251 -USART.pptx
8251 -USART.pptx8251 -USART.pptx
8251 -USART.pptxVikasMahor3
 
UNIT- 3.pptx
UNIT- 3.pptxUNIT- 3.pptx
UNIT- 3.pptxBASKARS53
 
8251 usart programmable communication interface by aniket bhute
8251  usart  programmable communication interface by aniket bhute8251  usart  programmable communication interface by aniket bhute
8251 usart programmable communication interface by aniket bhuteAniket Bhute
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
Unit 3-1 (1)
Unit 3-1 (1)Unit 3-1 (1)
Unit 3-1 (1)Vasu Ch
 
8085-microprocessor
8085-microprocessor8085-microprocessor
8085-microprocessorATTO RATHORE
 
Programmableperipheralinterface 8255 ppt
Programmableperipheralinterface 8255 pptProgrammableperipheralinterface 8255 ppt
Programmableperipheralinterface 8255 pptsharan Kumar
 
Serial Io
Serial IoSerial Io
Serial IoAisu
 
28. 8251 programmable communication interface
28. 8251 programmable communication interface28. 8251 programmable communication interface
28. 8251 programmable communication interfacesandip das
 

Similar to MicroProcessors and MicroControllersUnit3 (20)

MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.pptMECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
MECHATRONICS-Unit 3-PROGRAMMABLE PERIPERAL INTERFACE.ppt
 
UNIT 3 Peripheral Interfacing.pptx
UNIT 3 Peripheral Interfacing.pptxUNIT 3 Peripheral Interfacing.pptx
UNIT 3 Peripheral Interfacing.pptx
 
8251 communication interface
8251 communication interface8251 communication interface
8251 communication interface
 
8255 class
8255 class8255 class
8255 class
 
8251 a usart programmable communication interface(1)
8251 a usart   programmable communication interface(1)8251 a usart   programmable communication interface(1)
8251 a usart programmable communication interface(1)
 
8251 -USART.pptx
8251 -USART.pptx8251 -USART.pptx
8251 -USART.pptx
 
UNIT- 3.pptx
UNIT- 3.pptxUNIT- 3.pptx
UNIT- 3.pptx
 
8251 usart programmable communication interface by aniket bhute
8251  usart  programmable communication interface by aniket bhute8251  usart  programmable communication interface by aniket bhute
8251 usart programmable communication interface by aniket bhute
 
8255 presentaion.ppt
8255 presentaion.ppt8255 presentaion.ppt
8255 presentaion.ppt
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
Unit 3-1 (1)
Unit 3-1 (1)Unit 3-1 (1)
Unit 3-1 (1)
 
8085-microprocessor
8085-microprocessor8085-microprocessor
8085-microprocessor
 
8255.pdf
8255.pdf8255.pdf
8255.pdf
 
L4-L6 8255 A.pptx
L4-L6 8255 A.pptxL4-L6 8255 A.pptx
L4-L6 8255 A.pptx
 
Programmable Peripheral Devices
Programmable Peripheral Devices Programmable Peripheral Devices
Programmable Peripheral Devices
 
Programmableperipheralinterface 8255 ppt
Programmableperipheralinterface 8255 pptProgrammableperipheralinterface 8255 ppt
Programmableperipheralinterface 8255 ppt
 
8255 & IO Interfacing.pdf
8255 & IO Interfacing.pdf8255 & IO Interfacing.pdf
8255 & IO Interfacing.pdf
 
Serial Io
Serial IoSerial Io
Serial Io
 
28. 8251 programmable communication interface
28. 8251 programmable communication interface28. 8251 programmable communication interface
28. 8251 programmable communication interface
 
unit-3-8255.pdf
unit-3-8255.pdfunit-3-8255.pdf
unit-3-8255.pdf
 

Recently uploaded

EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 

Recently uploaded (20)

EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 

MicroProcessors and MicroControllersUnit3

  • 1. SYLLABUS UNIT III - I/O INTERFACING Memory Interfacing and I/O interfacing -Parallel communication interface –Serial communication interface – D/A and A/D Interface -Timer –Keyboard /display controller – Interrupt controller –DMA controller –Programming and applications Case studies: Traffic Light control, LED display , LCD display, Keyboard display interface and Alarm Controller. PRIYADHARSHINI.S
  • 2. MEMORY & IO INTERFACING MEMORY DEVICES I/O DEVICES 2
  • 3.  interface memory (RAM, ROM, EPROM'...) or I/O devices to 8086 microprocessor. Several memory chips or I/O devices can connected to a microprocessor. An address decoding circuit is used to select the required I/O device or a memory chip. 3
  • 4. Memory Mapped IO • Memory Instructions are used. • Memory control signals are used. • Arithmetic and logic operations can be performed on data. • Data transfer b/w register and IO. IO Mapped IO • Special Instructions are used like IN, OUT. • Special control signals are used. • Arithmetic and logic operations can not be performed on data. • Data transfer b/w accumulator and IO. 4
  • 6. 8255 PPI • The 8255 chip is also called as Programmable Peripheral Interface. • The Intel’s 8255 is designed for use with Intel’s 8-bit, 16-bit and higher capability microprocessors • The 8255 is a 40 pin integrated circuit (IC), designed to perform a variety of interface functions in a computer environment. • It is flexible and economical. 6
  • 7. PIN DIAGRAM OF 8255 7
  • 9. 8255 PIO/PPI  It has 24 input/output lines which may be individually programmed.  2 groups of I/O pins are named as Group A (Port-A & Port C Upper) Group B (Port-B & Port C Lower)  3 ports(each port has 8 bit) Port A lines are identified by symbols PA0-PA7 Port B lines are identified by symbols PB0-PB7 Port C lines are identified by PC0-PC7 , PC3-PC0 ie: PORT C UPPER(PC7-PC4) , PORT C LOWER(PC3-PC0) 9
  • 10. D0 - D7: data input/output lines for the device. All information read from and written to the 8255 occurs via these 8 data lines. CS (Chip Select). If this line is a logical 0, the microprocessor can read and write to the 8255. RESET : The 8255 is placed into its reset state if this input line is a logical 1 10
  • 11. • RD : This is the input line driven by the microprocessor and should be low to indicate read operation to 8255. • WR : This is an input line driven by the microprocessor. A low on this line indicates write operation. • A1-A0 : These are the address input lines and are driven by the microprocessor. 11
  • 12. CONTROL LOGIC  CS signal is the master Chip Select  A0 and A1 specify one of the two I/O Ports CS A1 A0 Selected 0 0 0 Port A 0 0 1 Port B 0 1 0 Port C 0 1 1 Control Register 1 X X 8255 is not selected12
  • 13. BLOCK DIAGRAM OF 8255A 13
  • 14. BLOCK DIAGRAM OF 8255 (ARCHITECTURE) It has a 40 pins of 4 parts. 1. Data bus buffer 2. Read/Write control logic 3. Group A and Group B controls 4. Port A, B and C 14
  • 15. 1. DATA BUS BUFFER  This is a tristate bidirectional buffer used to interface the 8255 to system data bus. Data is transmitted or received by the buffer on execution of input or output instruction by the CPU. 15
  • 16. 2. READ/WRITE CONTROL LOGIC  This unit accepts control signals ( RD, WR ) and also inputs from address bus and issues commands to individual group of control blocks ( Group A, Group B).  It has the following pins. CS , RD , WR , RESET , A1 , A0 16
  • 17. 3. GROUP A AND GROUP B CONTROLS • These block receive control from the CPU and issues commands to their respective ports. Group A - PA and PCU ( PC7 –PC4) Group B – PB and PCL ( PC3 –PC0) a) Port A: This has an 8 bit latched/buffered O/P and 8 bit input latch. It can be programmed in 3 modes – mode 0, mode 1, mode 2. 17
  • 18. b) Port B: It can be programmed in mode 0, mode1 c) Port C : It can be programmed in mode 0 18
  • 20. MODES OF OPERATION OF 8255  Bit Set/Reset(BSR) Mode  Set/Reset bits in Port C  I/O Mode  Mode 0 (Simple input/output)  Mode 1 (Handshake mode)  Mode 2 (Bidirectional Data Transfer) 20
  • 22. B3 B2 B1 Bit/pin of port C selected 0 0 0 PC0 0 0 1 PC1 0 1 0 PC2 0 1 1 PC3 1 0 0 PC4 1 0 1 PC5 1 1 0 PC6 1 1 1 PC7 Concerned only with the 8-bits of Port C. Set or Reset by control word Ports A and B are not affected 22
  • 23. A) MODE 0 (SIMPLE INPUT OR OUTPUT): • Ports A and B are used as Simple I/O Ports • Port C as two 4-bit ports • Features – Outputs are latched – Inputs are not latched – Ports do not have handshake or interrupt capability 2. I/O MODE 23
  • 24. 24
  • 25. B) MODE 1: (INPUT OR OUTPUT WITH HANDSHAKE) • Handshake signals are exchanged between MPU & Peripherals • Features – Ports A and B are used as Simple I/O Ports – Each port uses 3 lines from Port C as handshake signals – Input & Output data are latched – interrupt logic supported 25
  • 26. c) Mode 2: Bidirectional Data Transfer • Used primarily in applications such as data transfer between two computers • Features – Ports A can be configured as the bidirectional Port – Port B in Mode 0 or Mode 1. – Port A uses 5 Signals from Port C as handshake signals for data transfer – Remaining 3 Signals from Port C Used as – Simple I/O or handshake for Port B 26
  • 27. FIND CONTROL WORD (1) PORT A: OUTPUT WITH HANDSHAKE (2) PORT B: INPUT WITH HANDSHAKE (3) PORT CL: OUTPUT (4)PORT CU: INPUT  Solution: 1 0 1 0 1 1 1 0 = AEH 27
  • 28. FIND THE CONTROL WORD FOR THE REGISTER ARRANGEMENT OF THE PORTS OF INTEL 8255 FOR MODE 0 OPERATION.  Port A: Output, Port B: Output,  Port CU: Output, Port CL: Output Solution: 1 0 0 0 0 0 0 0 = 80H The control word register for the above ports of Intel 8255 is 80H. 28
  • 29. FIND THE CONTROL WORD FOR THE REGISTER ARRANGEMENT OF THE PORTS OF INTEL 8255 FOR MODE 0 OPERATION.  Port A: Input, Port B: Input,  Port CU: Input, Port CL: Input Solution: 1 0 0 1 1 0 1 1 = 9BH The control word register for the above ports of intel 8255 is 9BH. 29
  • 30. BASICS OF SERIAL COMMUNICATION 1. Transmitter: - A parallel-in, serial-out shift register Receiver: - A serial-in, parallel-out shift register. - 30 Parallel Transfer
  • 33. UNIVERSAL SYNCHRONOUS ASYNCHRONOUS RECEIVER TRANSMITTER (USART)  Programmable chip designed for synchronous and asynchronous serial data transmission  28 pin DIP  Coverts the parallel data into a serial stream of bits suitable for serial transmission.  Receives a serial stream of bits and convert it into parallel data bytes to be read by a microprocessor. 33
  • 34. 34
  • 36. FIVE SECTIONS – Read/Write Control Logic • Interfaces the chip with MPU • Determine the functions according to the control word • Monitors data flow – Transmitter • Converts parallel word received from MPU into serial bits • Transmits serial bits over TXD line to a peripheral. – Receiver • Receives serial bits from peripheral • Converts serial bits into parallel word • Transfers the parallel word to the MPU – Data Bus Buffer- 8 bit Bidirectional bus. – Modem Controller • Used to establish data communication modems over telephone line 36
  • 37. INPUT SIGNALS  CS – Chip Select  When this signal goes low, 8251 is selected by MPU for communication  C/D – Control/Data  When this signal is high, the control register or status register is addressed  When it is low, the data buffer is addressed  Control and Status register is differentiated by WR and RD signals, respectively 37
  • 38. • WR – Write – writes in the control register or sends outputs to the data buffer. – This connected to IOW or MEMW • RD – Read – Either reads a status from status register or accepts data from the data buffer – This is connected to either IOR or MEMR • RESET - Reset • CLK - Clock – Connected to system clock – Necessary for communication with microprocessor. 38
  • 39. CS C/D RD WR Function 0 1 1 0 MPU writes instruction in the control register 0 1 0 1 MPU reads status from the status register 0 0 1 0 MPU outputs the data to the Data Buffer 0 0 0 1 MPU accepts data from the Data Buffer 1 X X X USART is not Selected 39
  • 40. • Control Register – 16-bit register – This register can be accessed an output port when the C/D pin is high • Status Register – Checks ready status of a peripheral • Data Buffer 40
  • 41. TRANSMITTER SECTION  Accepts parallel data and converts it into serial data  Two registers  Buffer Register  To hold eight bits  Output Register  Converts eight bits into a stream of serial bits  Transmits data on TxD pin with appropriate framing bits(Start and Stop) 41
  • 42. SIGNALS ASSOCIATED WITH TRANSMITTER SECTION • TxD – Transmit Data – Serial bits are transmitted on this line • TxC – Transmitter Clock – Controls the rate at which bits are transmitted • TxRDY – Transmitter Ready – Can be used either to interrupt the MPU or indicate the status • TxE – Transmitter Empty – Logic 1 on this line indicate that the output register is empty 42
  • 43. RECEIVER SECTION  Accepts serial data from peripheral and converts it into parallel data  The section has two registers  Input Register  Buffer Register 43
  • 44. SIGNALS ASSOCIATED WITH RECEIVER SECTION  RxD – Receive Data  Bits are received serially on this line and converted into parallel byte in the receiver input  RxC – Receiver Clock  RxRDY – Receiver Ready  It goes high when the USART has a character in the buffer register and is ready to transfer it to the MPU 44
  • 45. SIGNALS ASSOCIATED WITH MODEM CONTROL • DSR- Data Set Ready – Normally used to check if the Data Set is ready when communicating with a modem • DTR – Data Terminal Ready – device is ready to accept data when the 8251 is communicating with a modem. • RTS – Request to send Data – the receiver is ready to receive a data byte from modem • CTS – Clear to Send 45
  • 47. 47
  • 48. 48
  • 49. 49
  • 50. 50
  • 51. Interfacing of 8255(PPI) with 8085 processor: 51
  • 52. 52
  • 53. 11- 53 Programming 8251  8251 mode register 7 6 5 4 3 2 1 0 Mode register Number of Stop bits 00: invalid 01: 1 bit 10: 1.5 bits 11: 2 bits Parity 0: odd 1: even Parity enable 0: disable 1: enable Character length 00: 5 bits 01: 6 bits 10: 7 bits 11: 8 bits Baud Rate 00: Syn. Mode 01: x1 clock 10: x16 clock 11: x64 clock
  • 54. 11- 54  8251 command register EH IR RTS ER SBRK RxE DTR TxE command register TxE: transmit enable DTR: data terminal ready, DTR pin will be low RxE: receiver enable SBPRK: send break character, TxD pin will be low ER: error reset RTS: request to send, CTS pin will be low IR: internal reset EH: enter hunt mode (1=enable search for SYN character)
  • 55. 11- 55  8251 status register DSR SYNDET FE OE PE TxEMPTY RxRDY TxRDY status register TxRDY: transmit ready RxRDY: receiver ready TxEMPTY: transmitter empty PE: parity error OE: overrun error FE: framing error SYNDET: sync. character detected DSR: data set ready
  • 56. ANALOG TO DIGITAL (A/D) INTERFACE 56
  • 57. ADC 0808/0809  The analog to digital converter chips 0808 and 0809 are 8-bit CMOS,successive approximation converters.  Successive approximation technique is one of the fast techniques for analog to digital conversion. The conversion delay is 100 µs at a clock frequency of 640 kHz. 57
  • 58. BLOCK DIAGRAM ADC 0808/0809 58
  • 59. 59
  • 60. INTERFACING ADC 0808 WITH 8086 60
  • 61. 61
  • 62. DIGITAL TO ANALOG (D/A) INTERFACE 62
  • 63. INTERFACING DIGITAL TO ANALOG ONVERTERS The digital to analog converters convert binary numbers into their analog equivalent voltages or currents. Techniques are employed for digital to analog conversion.  i. Weighted resistor network  ii. R-2R ladder network  iii. Current output D/A converter 63
  • 64.  The DAC find applications in areas like digitally controlled gains, motor speed control, programmable gain amplifiers, digital voltmeters, panel meters, etc.  In a compact disk audio player for example a 14 or16-bit D/A converter is used to convert the binary data read off the disk by a laser to an analog audio signal. Characteristics : 1. Resolution: It is a change in analog output for one LSB change in digital input. It is given by(1/2^n )*Vref. If n=8 (i.e.8-bit DAC) 1/256*5V=39.06mV 2. Settling time: It is the time required for the DAC to settle for a full scale code change. 64
  • 65. DAC 0800 8-bit Digital to Analog converter Features: i. DAC0800 is a monolithic 8-bit DAC manufactured by National semiconductor. ii. It has settling time around 100ms iii. It can operate on a range of power supply voltage i.e. from 4.5V to +18V. Usually the supply V+ is 5V or +12V. The V- pin can be kept at a minimum of -12V. iv. Resolution of the DAC is 39.06mV 65
  • 66. PIN DIAGRAM OF DAC 0800 66
  • 67. INTERFACING OF DAC0800 WITH 8086 67
  • 70.  RD: read signal  WR: write signal  CS: chip select signal  A0, A1: address lines  Clock :This is the clock input for the counter. The counter is 16 bits.  Out :This single output line is the signal that is the final programmed output of the device.  Gate :This input can act as a gate for the clock input line, or it can act as a start pulse, 70
  • 71. 71
  • 72. CONTROL WORD REGISTER :THIS INTERNAL REGISTER IS USED TO WRITE INFORMATION 72
  • 74. 8254 MODES Gate is low the count will be paused Gate is high Will continue counting Mode 0: An events counter enabled with G. Mode 1: One-shot mode. s Gate is High output will be high Counter will be reloaded After gate high. 74
  • 75. Mode 2: Counter generates a series of pulses 1 clock pulse wide Mode 3: Generates a continuous square-wave with G set to 1 cycle is repeated until reprogrammed or G pin set to 0 If count is even, 50% duty cycle otherwise OUT is high 1 cycle longer 75
  • 76. Mode 4: Software triggered one-shot. Mode 5: Hardware triggered one-shot. G controls similar to Mode 1. In the last counting Will be stop (not repeated) In the last count Out will be low 76
  • 78. INTRODUCTION The INTEL 8279 is specially developed for interfacing keyboard and display devices to 8085/8086 microprocessor based system 78
  • 79. FEATURES OF 8279  Simultaneous keyboard and display operations  Scanned keyboard mode  Scanned sensor mode  8-character keyboard FIFO  1 6-character display 79
  • 81. 4 SECTIONS Keyboard section Display section Scan section CPU interface section 81
  • 82. 82
  • 83. 83
  • 84. KEYBOARD SECTION  The keyboard section consists of 8 return lines RL0 - RL7 that can be used to form the columns of a keyboard matrix.  It has two additional input : shift and control/strobe. The keys are automatically debounced.  The two operating modes of keyboard section are 2-key lockout and N-key rollover. 84
  • 85.  In the 2-key lockout mode, if two keys are pressed simultaneously, only the first key is recognized.  In the N-key rollover mode simultaneous keys are recognized and their codes are stored in FIFO.  The keyboard section also have an 8 x 8 FIFO (First In First Out) RAM.  The FIFO can store eight key codes in the scan keyboard mode. The status of the shift key and control key are also stored along with key code. The 8279 generate an interrupt signal (IRQ)when there is an entry in FIFO. 85
  • 86. DISPLAY SECTION  The display section has eight output lines divided into two groups A0-A3 and B0-B3.  The output lines can be used either as a single group of eight lines or as two groups of four lines, in conjunction with the scan lines for a multiplexed display.  The output lines are connected to the anodes through driver transistor in case of common cathode 7-segment LEDs. 86
  • 87.  The cathodes are connected to scan lines through driver transistors.  The display can be blanked by BD (low) line.  The display section consists of 16 x 8 display RAM. The CPU can read from or write into any location of the display RAM. 87
  • 88. SCAN SECTION  The scan section has a scan counter and four scan lines, SL0 to SL3.  In decoded scan mode, the output of scan lines will be similar to a 2-to-4 decoder.  In encoded scan mode, the output of scan lines will be binary count, and so an external decoder should be used to convert the binary count to decoded output.  The scan lines are common for keyboard and display. 88
  • 89. CPU INTERFACE SECTION  The CPU interface section takes care of data transfer between 8279 and the processor.  This section has eight bidirectional data lines DB0 to DB7 for data transfer between 8279 and CPU.  It requires two internal address A =0 for selecting data buffer and A = 1 for selecting control register of8279. 89
  • 90.  The control signals WR (low), RD (low), CS (low) and A0 are used for read/write to 8279.  It has an interrupt request line IRQ, for interrupt driven data transfer with processor.  The 8279 require an internal clock frequency of 100 kHz. This can be obtained by dividing the input clock by an internal prescaler. 90
  • 91. All the command words or status words are written or read with A0 = 1 and CS = 0 to or from 8279. a) Keyboard Display Mode Set : The format of the command word to select different modes of operation of 8279 is given below with its bit definitions. D7 D6 D5 D4 D3 D2 D1 D0 0 0 0 D D K K K 91
  • 93. B) Programmable clock : The clock for operation of 8279 is obtained by dividing the external clock input signal by a programmable constant called prescaler.  PPPPP is a 5-bit binary constant. The input frequency is divided by a decimal constant ranging from 2 to 31, decided by the bits of an internal prescaler, PPPPP. D7 D6 D5 D4 D3 D2 D1 D0 0 0 1 P P P P P 93
  • 94. c) Read FIFO / Sensor RAM : The format of this command is given below. AI – Auto Increment Flag AAA – Address pointer to 8 bit FIFO RAM X- Don’t care This word is written to set up 8279 for reading FIFO/ sensor RAM. In scanned keyboard mode, AI and AAA bits are of no use. The 8279 will automatically drive data bus for each subsequent read, in the same sequence, in which the data was entered. In sensor matrix mode, the bits AAA select one of the 8 rows of RAM. If AI flag is set, each successive read will be from the subsequent RAM location. D7 D6 D5 D4 D3 D2 D1 D0 0 1 0 AI X A A A 94
  • 95. d) Read Display RAM : This command enables a programmer to read the display RAM data. The CPU writes this command word to 8279 to prepare it for display RAM read operation. AI is auto increment flag and AAAA, the 4-bit address points to the 16-byte display RAM that is to be read. If AI=1, the address will be automatically, incremented after each read or write to the Display RAM. The same address counter is used for reading and writing. D7 D6 D5 D4 D3 D2 D1 D0 0 1 1 AI A A A A 95
  • 96. d) Write Display RAM : This command enables a programmer to write the display RAM data. AI – Auto increment Flag. AAAA – 4 bit address for 16-bit display RAM to be written. e) Display Write Inhibit/Blanking : D7 D6 D5 D4 D3 D2 D1 D0 1 0 0 AI A A A A D7 D6 D5 D4 D3 D2 D1 D0 1 0 1 X IW IW BL BL IW - inhibit write flag BL - blank display bit flags 96
  • 97. g) Clear Display RAM : ENABLES CLEAR DISPLAY WHEN CD2=1 • CD2 must be 1 for enabling the clear display command. • If CD2 = 0, the clear display command is invoked by setting CA(CLEAR ALL) =1 and maintaining CD1, CD0 bits exactly same as above. • If CF(CLEAR FIFO RAM STATUS) =1, FIFO status is cleared and IRQ line is pulled down and the sensor RAM pointer is set to row 0. •If CA=1, this combines the effect of CD and CF bits. D7 D6 D5 D4 D3 D2 D1 D0 1 1 0 CD2 CD1 CD0 CF CA CD2 CD1 CD0 0X - All zeros ( x don’t care ) AB=00 10 - A3-A0 =2 (0010) and B3-B0=00 (0000) 11 - All ones (AB =FF), i.e. clear RAM 97
  • 98. h) End Interrupt / Error mode Set : E- Error mode X- don’t care For the sensor matrix mode, this command lowers the IRQ line and enables further writing into the RAM. Otherwise, if a change in sensor value is detected, IRQ goes high that inhibits writing in the sensor RAM.  For N-Key roll over mode, if the E bit is programmed to be ‘1’, the 8279 operates in special Error mode D7 D6 D5 D4 D3 D2 D1 D0 1 1 1 E X X X 1 98
  • 100.
  • 101. 1. This IC is designed to simplify the implementation of the interrupt interface in the 8088 and 8086 based microcomputer systems. 2. This device is known as a ‘Programmable Interrupt Controller’ or PIC. 3. It is manufactured using the NMOS technology and It is available in 28-pin DIP. 4. The operation of the PIC is programmable under software control (Programmable)and it can be configured for a wide variety of applications. 5. 8259A is treated as peripheral in a microcomputer system. 6. 8259A PIC adds eight vectored priority encoded interrupts to the microprocessor. 7. This controller can be expanded without additional hardware to accept up to 64 interrupt request inputs. This expansion required a master 8259A and eight 8259A slaves. 8. Some of its programmable features are: · The ability to accept level-triggered or edge-triggered inputs. · The ability to be easily cascaded to expand from 8 to 64 interrupt-inputs. · Its ability to be configured to implement a wide variety of priority schemes. 8259 Programmable Interrupt Controller (PIC)
  • 102. 8259A PIC- PIN DIGRAM 8 2 5 9
  • 103.
  • 104. ASSINGMENT OF SIGNALS FOR 8259: 1. D7- D0 is connected to microprocessor data bus D7-D0 (AD7-AD0). 2. IR7- IR0, Interrupt Request inputs are used to request an interrupt and to connect to a slave in a system with multiple 8259As. 3. WR - the write input connects to write strobe signal of microprocessor. 4. RD - the read input connects to the IORC signal. 5. INT - the interrupt output connects to the INTR pin on the microprocessor from the master, and is connected to a master IR pin on a slave. 6. INTA - the interrupt acknowledge is an input that connects to the INTA signal on the system. In a system with a master and slaves, only the master INTA signal is connected. 7. A0 - this address input selects different command words within the 8259A. 8. CS - chip select enables the 8259A for programming and control. 9. SP/EN - Slave Program/Enable Buffer is a dual-function pin.
  • 105. When the 8259A is in buffered mode, this pin is an output that controls the data bus transceivers in a large microprocessor-based system. When the 8259A is not in buffered mode, this pin programs the device as a master (1) or a slave (0). CAS2-CAS0, the cascade lines are used as outputs from the master to the slaves for cascading multiple 8259As in a system.
  • 106. 8259A PIC- BLOCK DIAGRAM
  • 107.
  • 108.
  • 109.
  • 110.
  • 111.
  • 112.
  • 113.
  • 114.
  • 115.
  • 116.
  • 117.
  • 118.
  • 119.
  • 120.
  • 121.
  • 122.
  • 123.
  • 124. The 82C59A accepts two types of command words generated by the CPU: 1. Initialization Command Words (ICWs): Before normal operation can begin, each 82C59A in the system must be brought to a starting point - by a sequence of 2 to 4 bytes timed by WR pulses. • Operational Command Words (OCWs): These are the command words which command the 82C59A to operate in various interrupt modes. Among these modes are: a. Fully nested mode. b. Rotating priority mode. c. Special mask mode. d. Polled mode. The OCWs can be written into the 82C59A anytime after initialization. Programming the 8259A: -
  • 125.  To program this ICW for 8086 we place a logic 1 in bit IC4.  Bits D7, D6 , D5and D2 are don’t care for microprocessor operation and only apply to the 8259A when used with an 8-bit 8085 microprocessor.  This ICW selects single or cascade operation by programming the SNGL bit. If cascade operation is selected, we must also program ICW3.  The LTIM bit determines whether the interrupt request inputs are positive edge triggered or level-triggered. ICW1:
  • 126.  Selects the vector number used with the interrupt request inputs.  For example, if we decide to program the 8259A so that it functions at vector locations 08H-0FH, we place a 08H into this command word.  Likewise, if we decide to program the 8259A for vectors 70H-77H, we place a 70H in this ICW. ICW2:
  • 127.  Is used only when ICW1 indicates that the system is operated in cascade mode.  This ICW indicates where the slave is connected to the master.  For example, if we connected a slave to IR2, then to program ICW3 for this connection, in both master and slave, we place a 04H in ICW3.  Suppose we have two slaves connected to a master using IR0 and IR1. The master is programmed with an ICW3 of 03H; one slave is programmed with an ICW3 of 01H and the other with an ICW3 of 02H. ICW3:
  • 128.  Is programmed for use with the 8088/8086. This ICW is not programmed in a system that functions with the 8085 microprocessors.  The rightmost bit must be logic 1 to select operation with the 8086 microprocessor, and the remaining bits are programmed as follows: ICW4:
  • 129.  Is used to set and read the interrupt mask register.  When a mask bit is set, it will turn off (mask) the corresponding interrupt input. The mask register is read when OCW1 is read.  Because the state of the mask bits is known when the 8259A is first initialized, OCW1 must be programmed after programming the ICW upon initialization. Operation Command Words OCW1:
  • 130.  Is programmed only when the AEOI mod is not selected for the 8259A.  In this case, this OCW selects how the 8259A responds to an interrupt.  The modes are listed as follows in next slide: OCW2:
  • 131.  Selects the register to be read, the operation of the special mask register, and the poll command.  If polling is selected, the P-bit must be set and then output to the 8259A. The next read operation would read the poll word. The rightmost three bits of the poll word indicate the active interrupt request with the highest priority.  The leftmost bit indicates whether there is an interrupt, and must be checked to determine whether the rightmost three bits contain valid information. OCW3:
  • 132. INTRODUCTION:  Direct Memory Access (DMA) is a method of allowing data to be moved from one location to another in a computer without intervention from the central processor (CPU).  It is also a fast way of transferring data within (and sometimes between) computer.  The DMA I/O technique provides direct access to the memory while the microprocessor is temporarily disabled.  The DMA controller temporarily borrows the address bus, data bus and control bus from the microprocessor and transfers the data directly from the external devices to a series of memory locations (and vice versa). 132
  • 133.  Supplies memory and I/O with control signals and addresses during DMA transfer  4-channels (expandable)  0: DRAM refresh  1: Free  2: Floppy disk controller  3: Free  1.6MByte/sec transfer rate  64 KByte section of memory address capability with single programming  “fly-by” controller (data does not pass through the DMA-only memory to I/O transfer capability)  Initialization involves writing into each channel:  i) The address of the first byte of the block of data that must be transferred (called the base address).  ii) The number of bytes to be transferred (called the word count). 133 THE 8237 DMA CONTROLLER
  • 134. 8237 PINS  CLK: System clock  CS΄: Chip select (decoder output)  RESET: Clears registers, sets mask register  READY: 0 for inserting wait states  HLDA: Signals that the μp has relinquished buses  DREQ3 – DREQ0: DMA request input for each channel  DB7-DB0: Data bus pins  IOR΄: Bidirectional pin used during programming and during a DMA write cycle  IOW΄: Bidirectional pin used during programming and during a DMA read cycle  EOP΄: End of process is a bidirectional signal used as input to terminate a DMA process or as output to signal the end of the DMA transfer  A3-A0: Address pins for selecting internal registers  A7-A4: Outputs that provide part of the DMA transfer address  HRQ: DMA request output  DACK3-DACK0: DMA acknowledge for each channel.  AEN: Address enable signal  ADSTB: Address strobe  MEMR΄: Memory read output used in DMA read cycle  MEMW΄: Memory write output used in DMA write cycle 134
  • 136. BLOCK DIAGRAM DESCRIPTION  It containing Five main Blocks. 1. Data bus buffer 2. Read/Control logic 3. Control logic block 4. Priority resolver 5. DMA channels. 136
  • 137. DATA BUS BUFFER:  It contain tristate ,8 bit bi-directional buffer.  Slave mode ,it transfer data between microprocessor and internal data bus.  Master mode ,the outputs A8-A15 bits of memory address on data lines (Unidirectional). READ/CONTROL LOGIC:  It control all internal Read/Write operation.  Slave mode ,it accepts address bits and control signal from microprocessor.  Master mode ,it generate address bits and control signal. 137
  • 138. Control logic block  It contains , 1. Control logic 2. Mode set register and 3. Status Register. CONTROL LOGIC:  Master mode ,It control the sequence of DMA operation during all DMA cycles.  It generates address and control signals.  It increments 16 bit address and decrement 14 bit counter registers.  It activate a HRQ signal on DMA channel Request.  Slave ,mode it is disabled. 138
  • 140. PROGRAMMING AND APPLICATIONS CASE STUDIES 1.TRAFFIC LIGHT CONTROL 2.LED DISPLAY 3.LCD DISPLAY 4.KEYBOARD DISPLAY INTERFACE 5.ALARM CONTROLLER 140
  • 142.  Traffic lights, which may also be known as stoplights, traffic lamps, traffic signals, signal lights, robots or semaphore, are signaling devices positioned at road intersections, pedestrian crossings and other locations to control competing flows of traffic.  INTERFACING TRAFFIC LIGHT WITH 8086 The Traffic light controller section consists of 12 Nos. point led’s arranged by 4Lanes in Traffic light interface card. Each lane has Go(Green), Listen(Yellow) and Stop(Red) LED is being placed. 142
  • 143. LAN Direction 8086 LINES MODULES SOUTH PA.0 GO PA.1 LISTEN PA.2 STOP EAST PA.3 GO PA.4 LISTEN PA.5 STOP NORTH PA.6 GO PA.7 LISTEN PB.0 STOP WEST PB.1 GO PB.2 LISTEN PB.3 STOP 13-16 No Connection PWR 17,189 Supply from microcontroller 18,20 143
  • 144. CIRCUIT DIAGRAM TO INTERFACE TRAFFIC LIGHT WITH 8086 144
  • 145. 8086 ALP: 1100: START: MOV BX, 1200H MOV CX, 0008H MOV AL,[BX] MOV DX, CONTROL PORT OUT DX, AL INC BX NEXT: MOV AL,[BX] MOV DX, PORT A OUT DX,AL CALL DELAY INC BX LOOP NEXT JMP START DELAY: PUSH CX MOV CX,0005H REPEAT: MOV DX,0FFFFH LOOP2: DEC DX JNZ LOOP2 LOOP REPEAT POP CX RET 145
  • 146. LOOKUP TABLE  1200 80H  1201 21H,09H,10H,00H (SOUTH WAY)  1205 0CH,09H,80H,00H (EAST WAY)  1209 64H,08H,00H,04H (NOURTH WAY)  120D 24H,03H,02H,00H (WEST WAY)  1211 END 146
  • 148. Light Emitting Diodes (LED) is the most commonly used components, usually for displaying pins digital states. Typical uses of LEDs include alarm devices, timers and confirmation of user input such as a mouse click or keystroke. INTERFACING LED Anode is connected through a resistor to GND & the Cathode is connected to the Microprocessor pin. So when the Port Pin is HIGH the LED is OFF & when the Port Pin is LOW the LED is turned ON. 148
  • 149. PIN ASSIGNMENT WITH 8086 149
  • 150. INTERFACE LED WITH 8255 150
  • 151. 8086 ALP LED INTERFACE 1100: START: MOV AL, 80 MOV DX, FF36 OUT DX, AL BEGIN: MOV AL, 00 MOV DX, FF30 OUT DX, AL CALL DELAY MOV AL, FF OUT DX, AL CALL DELAY JMP BEGIN DELAY: MOV CX, FFFF PO: DEC CX JNE PO RET 151
  • 153. 153
  • 154. HARDWARE CONFIGURATION OF LCD WITH 8051/8086/8085 154
  • 155. LCD INTERFACING WITH 8086 TRAINER KIT  GPIO- I (8255) J1 Connector PORTS ADDRESS Control port FF26 PORT A FF20 PORT B FF22 PORT C FF24  GPIO- I (8255) J4 Connector PORTS ADDRESS Control port FF36 PORT A FF30 PORT B FF32 PORT C FF34 155
  • 156. 156
  • 157. LCD INTERFACING WITH 8051 TRAINER KIT  GPIO- I (8255) J1 Connector PORTS ADDRESS Control port 4003 PORT A 4000 PORT B 4001 PORT C 4002 Used in UNIT 5 also 157
  • 158. 158
  • 160. HARDWARE DESCRIPTION OF 8279 INTERFACE CARD Keyboard and display is configured in the encoded mode. In the encoded mode, a binary count sequence is put on the scan lines SL0-SL3. These lines must be externally decoded to provide the scan lines for keyboard and display. A 3 to 8 decoder 74LS138 is provided for this purpose. The S0-S1 output lines of this decoder are connected to the two rows of the keyboard. And QA0 to QA7 is connected to 7 Segment Display 160
  • 161. PIN DIAGRAM OF 8279 PIN DIAGRAMOF 74LS138 Presented by C.GOKUL,AP/EEE , Velalar College of Engg & Tech, Erode 161
  • 162. DETECTING A MATRIX KEYBOARD KEY PRESS 162
  • 163. 163
  • 164. MVI A, 00H Initialize keyboard/display in encoded OUT 81H scan keyboard 2 key lockout mode MVI A, 34H OUT 81H Initialize prescaler count MVI A, 0BH Load mask pattern to enable RST 7.5 SIM mask other interrupts EI Enable Interrupt HERE: JMP HERE Wait for the interrupt Interrupt service routine MVI A, 40H Initialize 8279 in read FIFO RAM mode OUT 81H IN 80H Get keycode MVI H, 62H Initialize memory pointer to point MOV L, A 7-Segment code MVI A, 80H : Initialize 8279 in write display RAM mode OUT 81H MOV A, M : Get the 7 segment code OUT 80H : Write 7-segment code in display RAM EI : Enable interrupt RET : Return to main program 164
  • 166. HARDWARE DESCRIPTION OF RELAY & BUZZER INTERFACE 166
  • 167. TO INTERFACE RELAY AND BUZZER WITH 8086 TRAINER KIT AND TO ON/OFF RELAY AND BUZZER CARD  GPIO- I J1 Connecter PORTS ADDRESS Control port FF26 PORT A FF20 PORT B FF22 PORT C FF24  GPIO- II J1 Connecter PORTS ADDRESS Control port FF36 PORT A FF30 PORT B FF32 167
  • 169. WHAT IS MICROCONTROLLER? Micro Controller 169 Very Small A mechanism that controls the operation of a machine
  • 170. MICROPROCESSORS  CPU for Computers  No RAM, ROM, I/O on CPU chip itself  Example: Intel's x86, Motorola’s 680x0 170
  • 171. MICROCONTROLLER  A smaller computer  On-chip RAM, ROM, I/O ports...  Example: Motorola’s 6811, Intel’s 8051, Zilog’s Z8 and PIC 171
  • 172. 172
  • 173. MICROPROCESSOR VS. MICROCONTROLLER Microprocessor  CPU is stand-alone, RAM, ROM, I/O, timer are separate  Designer can decide on the amount of ROM, RAM and I/O ports.  Expansive  General-purpose Microcontroller  CPU, RAM, ROM, I/O and timer are all on a single chip  Fix amount of on-chip ROM, RAM, I/O ports  For applications in which cost, power and space are critical  Not Expansive  Single-purpose 173
  • 174. MICROCONTROLLERS APPLICATIONS  Home  Appliances, intercom, telephones, security systems, garage door openers, answering machines, fax machines, home computers, TVs, cable TV tuner, VCR, camcorder, remote controls, video games, cellular phones, musical instruments, sewing machines, lighting control, paging, camera, pinball machines, toys, exercise equipment etc. Office  Telephones, computers, security systems, fax machines, microwave, copier, laser printer, color printer, paging etc.  Auto  Trip computer, engine control, air bag, ABS, instrumentation, security system, transmission control, entertainment, climate control, cellular phone, keyless entry 174