18ECC203J - Unit 3 Session 1 - 3
18ECC203J - Unit 3 Session 1 - 3
Prepared by,
Mr. R. Prithiviraj
Dr. Diwakar R. Marur
2
S–1
Semiconductor memory interfacing & Dynamic
RAM interfacing
3 Semiconductor RAM
🠶
4 RECAP:- Physical Memory Organisation
(Module 1, Session 6, Slide No. 12)
• Certain locations in memory are reserved for specific CPU operations. The locations
from FFFF0H to FFFFFH are reserved for operations including jump to initialisation
programme and I/O-processor initialisation.
• The locations 00000H to 003FFH are reserved for interrupt vector table.
5 Procedure to Interface RAM
🠶
6 Example Problem
🠶 The function of capacitor is carried out by diode that operates in a reverse bias
mode.
12 Dynamic RAM (Contd…)
🠶 The reverse-biased diode has leakage current that tends to discharge the capacitor giving
rise to the possibility of data loss. To avoid this, the stored data in the cell is refreshed in
regular intervals. The process is called as Refresh cycle.
🠶 The refresh activity is similar to reading the data from each and every cell of memory,
independent of the requirement of microprocessor. During this refresh period all other
operations related to the memory subsystem are suspended. Hence the refresh activity
causes loss of time, resulting in reduce system performance.
🠶 However keeping in view the advantages of dynamic RAM, like low power consumption,
high packaging density and low cost, most of the advanced computing system are
designed using dynamic RAM, at the cost of operating speed.
🠶 A dedicated hardware chip called as dynamic RAM controller is the most important part
of the interfacing circuit.
13 Refresh Cycle
🠶 The Refresh cycle is different from the memory read cycle in the following aspects.
1. The memory address is not provided by the CPU address bus, rather it is generated by a
refresh mechanism counter called as refresh counter.
2. Unlike memory read cycle, more than one memory chip may be enabled at a time so as to
reduce the number of total memory refresh cycles.
3. The data enable control of the selected memory chip is deactivated, and data is not
allowed to appear on the system data bus during refresh, as more than one memory units
are refreshed simultaneously. This is to avoid the data from the different chips to appear on
the bus simultaneously.
4. Memory read is either a processor initiated or an external bus master initiated and carried
out by the refresh mechanism.
14 Refresh Cycle (2)
🠶 Dynamic RAM is available in units of several kilobits to megabits of memory. This
memory is arranged internally in a 2 – D matrix so that it will have n rows and m
columns. The row address n and column address m are important for the
refreshing operation.
🠶 A timer, called refresh timer, derives a pulse for refreshing action after each
refresh interval.
🠶 Refresh interval can be qualitatively defined as the time for which a dynamic
RAM cell can hold data charge level practically constant, i.e. no data loss takes
place.
🠶 If a dynamic RAM chip has 64 rows, then all the 64 rows are to refreshed in a
single refresh interval.
16 Refresh Cycle (4)
🠶
17 DRAM
🠶
19
S–2
Programmable Peripheral Interface 8255 & Interfacing
8255 with 8086 and programming
20 8255 – Ports
🠶 The Parallel Input-Output Port chip 8255 is also called as Programmable
Peripheral Input-Output Port. The Intel’s 8255 is designed for use with Intel’s 8-
bit, 16-bit and higher capability microprocessors. It has 24 input/output lines
which may be individually programmed in two groups of 12 lines each, OR or
three groups of eight lines.
PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0 Port A Port C upper
Port B GROUP B
PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0 PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0 PC3 PC2 PC1 PC0
🠶 The port A lines are identified by symbols PA 0-PA7 while the port C upper lines are
identified as PC7-PC4. Similarly, Group B contains an 8-bit port B, containing lines PB 0-PB7
and a 4-bit port C with lower bits PC 0- PC3. The port C upper and port C lower can be used
in combination as an 8-bit port C. Upper and lower port C are assigned the same address.
🠶 Either Three 8- bit I/O ports or two 8-bit and two 4-bit C ports from 8255 are possible. All
of these ports can function independently either as input or as output ports. This can be
achieved by programming the bits of an internal register of 8255 called as Control Word
Register (CWR).
22 8255 – Ports (3)
🠶
23 Pin Diagram
🠶 PC7 – PC4 : Upper nibble of port C lines. They may act as either output latches or
input buffers lines. This port also can be used for generation of handshake lines
in mode 1 or mode 2.
🠶 PC3 – PC0 : These are the lower port C lines; other details are the same as PC 7 –
PC4 lines.
🠶 PB7 – PB4 : These are the eight port B lines which are used as latched output lines
or buffered input lines in the same way as port A.
25 Signal Description (2)
🠶
26 8255 –
Addressing
Ports
🠶 In case of 8086 systems, if the 8255 is to be interfaced with lower order data bus,
the A0 and A1 pins of 8255 are connected with A1 and A2 respectively.
🠶 D0-D7: These are the data bus lines those carry data or control word to/from the
microprocessor.
🠶 RESET: A logic high on this line clears the control word register of 8255. All ports
are set as input ports by default after reset.
SECTIONS
1. Data bus
2. Read Write control logic
3. Group A and Group B
controls
4. Port A, B and C
🠶 In BSR mode only port C (PC0-PC7) can be used to set or reset its individual port
bits. In I/O mode, the 8255 ports work as programmable I/O ports. Under the
I/O mode of operation, mode 0, mode 1 and mode 2 is possible
🠶 BSR Mode: In this mode any of the 8-bits of port C can be set or reset
depending on D0 of the control word. The bit to be set or reset is selected by bit
select flags D3, D2 and D1 of the CWR.
32 BSR Mode
Example
D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 0 1 1 0 1
Example
D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 1 1 0 0 0
IO Mode 0 Port A Port C Mode Port B Port C
mode input (up) 0 output (low)
input output
S–3
Interfacing ADC with 8086 and programming &
Interfacing DAC with 8086 and programming
38 Analog-to-Digital Converter (ADC)
🠶 µP considers ADC as a input device. So, it sends Start of Conversation (SoC) signal
(pulse of a specific duration) to ADC.
🠶 Analog to digital conversion is a slow process. So, ADC will send a End of
Conversion (EoC) signal to µP, when the conversion is over. Then µP can take the
result from the buffer. EoC signal can trigger a interrupt in 8086 or µP can poll
the EoC signal.
🠶 Usually µP will use the IO ports of 8255 to interact with ADC. Like reading EoC
signal from ADC and reading digital output of ADC.
39 Analog-to-Digital Converter (2)
🠶 The time taken by the ADC from the active edge of SoC pulse till the active edge
of EoC signal is called as the conversion delay of the ADC.
🠶 No need of external zero or full scale adjustments. They are inbuilt in the chip.
🠶 These converters internally have a 3:8 analog multiplexer so that at a time 8 different
analog conversion can be carried out. Use address lines - ADD A, ADD B, ADD C.
🠶 In multichannel applications – The CPU drive the lines using output port.
In single channel applications – the lines are hardwired to select the input.
🠶 There are unipolar analog to digital converters, i.e. they are able to convert only
positive analog input voltage to their digital equivalent. These chips do no contain any
internal sample and hold circuit.
42 Table
Address mapping
NOTE
▪ The signal I/P0 is referred as IN0 in Pin Diagram
▪ The signals O0, O2, … O7 are referred as 2-8, 2-7 … 2-1 in Pin Diagram
43 Block
Diagram
🠶 The DAC find applications in areas like digitally controlled gains, motors
speed controls, programmable gain amplifiers etc. AD 7523
🠶 Usually a Zener is connected between OUT1 and OUT2 to save the DAC from
negative transients. An operational amplifier is used as a current to voltage
converter at the output of AD to convert the current output of AD to a
proportional output voltage.
🠶 An external feedback resistor acts to control the gain. No need to connect any
external feedback resistor, if no gain control is required.
50
Pin Diagram
🠶 After that the saw tooth wave again starts from 00H, i.e. 0 V (analog) and the
procedure is repeated.
🠶 Here the count F2H has been calculated by dividing the required delay of 1ms by
the time required for the execution of the loop once. The ramp slope can be
controlled by calling a controllable delay after the OUT instruction.
54 Learning Resource
[1] K. M. Bhurchandi and A. K. Ray, “Advanced Microprocessors
and Peripherals – with ARM and an Introduction to
Microcontrollers and Interfacing”, Tata McGraw Hill, 3rd ed.,
2015.
Note: Almost all figures and text content taken from the above
stated book.
Thank You