Professional Documents
Culture Documents
UNIT 4
Peripheral
Memory DMA
Devices
CS:
● It is active low, Chip select input line.
● Used to enable controller onto the data bus for CPU communication.
RESET:
● Used to clear mode set registers and status registers, request and temporary
registers i.e. becomes zero
● Active High signal (1)
● Reset the DMA by disabling all the channels.
HRQ:
● It is used to receive the hold request signal from the output device.
HLDA:
● It is acknowledgment signal from microprocessor
DACK0-DACK3:
● These are the active low DMA acknowledge output lines.
● Low level indicate that ,peripheral is selected for giving the information (DMA
cycle).
● In master mode it is used for chip select.
IOR:
● It is active low bidirectional lines.
● It is used to access data from the peripherals.
IOW:
● It is active low ,tri-state ,buffered ,Bidirectional control lines.
● In the slave mode it is an input signal used by CPU to load data into 8257.
● In the master mode it is an output signal used by 8257 to load data to the peripherals.
MEMW:
● It is active low control input line.
● Write the data into selected memory location
TC (Terminal Count):
● It is a status of output line.
● It is activated in master mode only.
● If it is high ,it selects the peripheral.
● If it is low ,its free and looks for a new peripheral.
MARK:
● It is a modulo 128 MARK output line.
● It is activated in master mode only.
● It goes high ,after transferring every 128 bytes of data block.
Prepared by M.V.Bhuvaneswari, Asst.Prof, CSE,MVGRA
Internal Architecture/ Block Diagram of 8257
Read/Write Logic:
● In the slave mode, the read/write logic accepts the I/O Read or I/O Write signals, decodes the
Ao-A3 lines and either writes the contents of the data bus to the addressed internal register or
reads the selected register depending upon whether IOW or IOR signal is activated.
● In master mode, the read/write logic generates the IOR and IOW signals to control the data flow
to or from the selected peripheral.
Prepared by M.V.Bhuvaneswari, Asst.Prof, CSE,MVGRA
Control Logic:
The control logic controls the sequences of operations and generates the
required control signals like AEN, ADSTB, MEMR,MEMW, TC and MARK
along with the address lines A4-A7, in master mode.
Priority Resolver:
The priority resolver resolves the priority of the four DMA channels depending
upon whether normal priority or rotating priority is programmed.
selected channel is disabled after the terminal count condition is reached, and it further
count reaches zero and further request are allowed on the same channel.
● The auto load bit, if set, enables channel 2 for the repeat block chaining operations,
activating them earlier, which is useful in interfacing the peripherals with different access
times.
Prepared by M.V.Bhuvaneswari, Asst.Prof, CSE,MVGRA
Status register
● The lower order 4-bits of this register contain the terminal count status for the
four individual channels. If any of these bits is set, it indicates that the specific
channel has reached the terminal count condition.
● The update flag is not affected by the read operation. This flag can only be
cleared by resetting 8257.
● The update flag is set every time, the channel 2 registers are loaded with
contents of the channel 3 registers. It is cleared by the completion of the first
DMA cycle of the new block. This register can only read.
Rotating priority
● In mode set register Bit D4 is
● set to one then the channels will have rotating priority and if it is zero, then channels will have the
fixed priority.
● In rotating priority the channels will have a circular sequence. In this channel being serviced will
get the lowest priority and the channel next to it will get the highest priority.
Prepared by M.V.Bhuvaneswari, Asst.Prof, CSE,MVGRA
● Thus with rotating priority mode in a single chip DMA system, any device
requesting services is guaranteed to be recognized after no more than three
high priority services have occurred.
TC STOP mode
● If the Bit 6 is set to one then the DMA operation is stopped at the terminal count.
● If TC STOP bit is set, a channel is disabled.
● DMA READ : In this cycle, data is transferred from memory to I/O device.
● DMA Write : In this cycle, data is transferred from I/O device to memory.
● DMA Verify : In this cycle, data is not transferred between memory and I/O It
is used by the, peripheral device to verify the data that has been recently
transferred. To avoid overwriting registers of channel 3, update flag in the
status register can be monitored by the CPU.
● It is a 40 pin chip available for dual line packaging. Power supply of +5 Volt DC
is needed for its working.
● 24 I/O lines
3 ports
4 lines Cupper PC4 – PC7
RD : Read Input
When this signal is low 8255 sends out data or status information to the CPU on the
data bus i.e. CPU reads data from the ports.
CPU 8255
WR
1 1 1 0 0 Control Register
D0 – D7 : Data bus
● These tri-state bidirectional data bus lines are connected to the system data bus.
● They are used to transfer data and control word from microprocessor to 8255 or
to receive data or status word form 8255 to the microprocessor.
00
EN
Control
Register WR RD
Port C
EN
CS
11 10
EN
10
A1 Port C WR RD
Internal
Decoding 01
A0 Port B Port B
00
Port A
01
EN
Prepared by M.V.Bhuvaneswari, Asst.Prof, CSE,MVGRA
Hex Ports
CS Address
A7 A6 A5 A4 A3 A2
A1 A0
1 0 0 0 0 0 0 0 80H Port A
0 1 81H Port B
1 0 82H Port C
1 1 83H Control
Register
8085 8255
A0 – A7 I/O device
Prepared by M.V.Bhuvaneswari, Asst.Prof, CSE,MVGRA
● So these addresses are provided by the 8085 MP and when these addresses are
given, then the respective ports or the control register is selected by the 8255.
● For example if the 82H address is given and RD signal is activated then whatever the
data available in port C that is being read by the microprocessor which is given by the
8255.
● Now when the 83H address is sent and WR signal is activated then the 8bit data which
is available on the data bus D0-D7 in 8085, that 8bit data will be written into the control
register. This 8bit data is called control word.
● This control word decides in which mode the 8255 is working.
D7 D6 D5 D4 D3 D2 D1 D0
1 / 0
Group A Group B
Prepared by M.V.Bhuvaneswari, Asst.Prof, CSE,MVGRA
● Mode 0: Simple I/O mode
● Mode 1: I/O mode with handshake
when ports use some of the lines of other
ports for its use.
To sync MP and I/O devices i.e. valid
connection.
● Mode 2: Bidirectional mode
Used to transfer data between two computers or floppy disks.
Ex: Configure
● Port A and port CU as out port
● Port B and port CL as in port
1 0 0 0 0 0 1 0
82H
Port A 0 0 0 0 0 1 1 1 0 1 0 0 0 0 0 0 0740H
Port B 0 0 0 0 0 1 1 1 0 1 0 0 0 0 1 0 0742H
Port C 0 0 0 0 0 1 1 1 0 1 0 0 0 1 0 0 0744H
CWR 0 0 0 0 0 1 1 1 0 1 0 0 0 1 1 0 0746H