Module 3 - Io Interface PDF
Module 3 - Io Interface PDF
By
Engr. Theresa D. Zacarias
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
• What is an Interface
• Pins of 8085 used in Interfacing
• Memory – Microprocessor Interface
• I/O – Microprocessor Interface
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
What is an Interface
• An interface is a concept that refers to a point of
interaction between components, and is applicable at
the level of both hardware and software.
• This allows a component, (such as a graphics card or an
Internet browser), to function independently while
using interfaces to communicate with other
components via an input/output system and an
associated protocol.
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
As mentioned earlier,
read/write memories
consist of an array of
registers, in which each
register has unique
address
The size of the memory is
NxM as shown below
where N is the number of
registers and M is the
word length, in number of
bits Logic Diagram for RAM
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
Example
• If memory is having 12 address lines and 8 data
lines, then Number of registers/ memory locations
(capacity) = 2𝑁 = 212 = 4096
• Word length = M bit = 8 bit
• Example 2: if memory has 8192 memory locations,
then it has 13 address lines. (How?)
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
EPROM layout
Shows the logic diagram
of typical EPROM
(Erasable Programmable
Read-Only Memory) with
4096 (4k) registers.
It has 12 address lines
(A0-A11), one chip selct
(CS), one Read control
signal.
No WR signal, why?
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
Example
We have to implement 32 kB of program memory and 4kB
EEPROMs are available. In this case, we can connect 8 EPROMs in
parallel.
We can place EPROM/RAM anywhere in full 64 kB address space.
But program memory (EPROM) should be located from address
0000H.
The memory interfacing requires to:
Select the chip
Identify the register
Enable the appropriate buffer
Microprocessor system includes memory and I/O devices.
It is important to note that microprocessor can communicate
(read/write) with only one device at a time, so address decoding
needed.
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
Memory map
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
Linear Decoding
In small systems, h/w for the decoding logic can be
eliminated by using individual high-order address lines to
select memory chips.
This is referred to as linear decoding.
The figure on succeeding slide shows the addressing of
RAM with linear decoding techniques.
This technique is called partial decoding.
It reduces the cost of the decoding cct., but it has a
drawback of multiple address (shadow addresses)
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
Linear Decoding
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
Memory Mapped IO
• It considers them like any other
memory location.
– They are assigned a 16-bit address within the
address range of the 8085.
– The exchange of data with these devices follows
the transfer of data with memory. The user uses
the same instructions used for memory.
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
IO Mapped IO
• It treats them separately from memory.
– I/O devices are assigned a “port number” within
the 8-bit address range of 00H to FFH.
– The user in this case would access these devices
using the IN and OUT instructions only.
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
Note: In IO interfacing, only one segment of the address bus (low or high
addresses) is sufficient (both segment have same address).
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
Input Interface
Figure : IN FFH
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
Input Interface
• The assembly instruction for that circuit in fig. 4 is IN
FFH.
• Note: FFH = 1111 1111 binary
• The line address is decoded using NAND gates.
• When address A7-A0 is active high (FFH), the output of
NAND gate will have an active low signal and then
combined with control signals IOR at G2.
• Suppose the μp run the IN FFH instruction, data at DIP
switches will be placed at data bus and copied to
accumulator.
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN
Bits: X 1 1 0 0 1 1 0 = 66 H
Segments: NC G F E D C B A
PhilCST
PHILIPPINE COLLEGE OF SCIENCE & TECHNOLOGY
OLD NALSIAN ROAD, BRGY. NALSIAN, CALASIAO, PANGASINAN