Presentation is loading. Please wait.

Presentation is loading. Please wait.

Diagram of microprocessor interface with IO devices

Similar presentations


Presentation on theme: "Diagram of microprocessor interface with IO devices"— Presentation transcript:

1 Diagram of microprocessor interface with IO devices

2 IO Controller (Port memory)
It converts data & control information from microprocessor interface to the specific signal required by the peripheral device. They are also known as port memory.

3 Functions of IO controller
Data conversion : match signal format, Synchronization : match timing characteristic of microprocessor and IO device. Device selection.

4 Salient features of IO controller
Programmable, Communicates with the outside world, Very few registers, Two buses System bus on MPU side - (data, address, /RD, /WR, /CS lines) Peripheral bus on IO device side – (data, handshake, interrupt lines).

5 Programmable interfacing device
Device that can be configured (changing its working mode) by writing an instruction to the device through the microprocessor.

6 Requirements for a programmable interfacing device
Input output data registers, Capability for bidirectional data flow, Hand shake and interrupt signals, Control logic, Chip select logic,

7 Representation of IO controller

8 Registers of a programmable interfacing device
Essentially Data register, Control register, and optionally Status register.

9 Data register Registers that can be used as I/O ports to input or output data. These are bidirectional latches built out of input and output buffers.  Can be programmed to function as an input or output port with the help of command word written in control register. There may be one or more data registers in a programmable interfacing device.

10 Control register The control register configures the data registers to work in various modes with the help of control word written into this register. There is only a single control register in a programmable interfacing device. Control register is write only register.

11 Control word The bit pattern which inputted into the control register, changes the configuration of the programmable device.

12 Status register It monitors the data lines of the data register, (viz., to monitor the data ready signal). Used in data input / output with handshake. There may be a single status register in a programmable interfacing device. Status register is read only register. Status register may have the same address as that of control register which is write only.

13 Working principle of programmable IO device
A programmable I/O device is programmed by writing a control word into the control register. Its status can be verified by reading the status register. Afterwards data can be read or write to the data register as it is configured.

14 Access IO controller An IO controller is accessed
by the addresses of various registers contained in the IO port device, and using data transfer instructions.

15 Programming the IO controller
1. Preparation Determine whether the IO controller is memory or IO mapped and the appropriate data transfer instructions, Determine the full address of Control (CR), Data (DR) and Status registers (SR), Determine the control word (CW) for configuring the data registers

16 Programming the IO controller (cont.)
2. Configuration of IO controller (through Control register) The program: MVI A, CW OUT CR8

17 Programming the IO controller (cont.)
3. Data Input / Output (through Data register) Input data - read the data from IO controller’s data register into accumulator register IN DR8 Output data- write data from accumulator register into IO controller’s data register MVI A, databyte OUT DR8

18 Example: A simple IO controller Construction (cont.)

19 Registers of the IO controller (cont.)
It includes a control, a data and a status register. The data register ( two 8 bit latches in opposite directions), its IO mode is determined by bit D0 in the control register, Input mode : If D0 = 1; Input latch is enabled and MPU can read a byte of data uses RD⌐ signal. Output mode: if D0 = 0; MPU uses WR⌐ signal to write to the port and send out a byte. Summary of the various registers

20 Programming the IO controller as output (cont.)
Control word to configure IO port as output device - 00h (set D0=0) input device h (set D0=1) Address of registers control register (CR) is FFh data register (DR) is FEh Codes: 1. Configuration MVIA, 00h ; control word = 00h OUT FFh ; write into control register (DR as output) 2. Data transfer MVIA, ABYTE ; load a data byte OUT FEh ; send data out to DR

21 Steps in data input with handshake
Peripheral device places a data byte in the input port of the interfacing device and informs it by sending handshake signal STB (strobe), The interfacing device informs the peripheral that its input port is full by sending handshake signal IBF (input buffer full), The MPU keeps checking the status until a byte is available or the interfacing device informs the MPU by sending an interrupt, that it has a byte to read,

22 Steps in data input with handshake (cont.)
4. The MPU reads the byte by sending control signal /RD. 5. After the data is read by MPU, The MPU deactivates the /RD line, The interface controller also deactivate the IBF line to inform the peripheral device that it can send more data

23 Diagram of data input with handshake

24 Timing diagram for data input with handshake

25 Steps in data output with handshake
MPU writes a byte into output port of the interfacing device by sending control signal WR⌐. Interfacing device informs the peripheral device by sending handshake signal OBF (output buffer full), The peripheral device acknowledges the byte by sending back ACK (acknowledge) signal to interfacing device, The interfacing device interrupts the MPU to ask for the next byte or the MPU finds out that the byte has been acknowledged through the status check.

26 Diagram of data output with handshake

27 Timing diagram for data output with handshake

28 Popular interface controllers:
Parallel IO controller - (parallel port) Serial synchronous / asynchronous IO controller - (serial port) Universal Serial Bus controllers Programmable timer Programmable interrupt controller

29 IO Controllers compatible with Intel MPU / MCU
8255 programmable peripheral interface (PPI) 8251 universal asynchronous / synchronous receiver transmitter (USART) 8254 programmable interval timer 8259 programmable interrupt controller 8279 keyboard / display controller

30 Information needed to use IO Controllers
Pinout diagram – designation of the pins, Internal registers and their addresses, Working modes and format Application circuit diagram, These information can be obtained from user manual provided by the manufacturer.


Download ppt "Diagram of microprocessor interface with IO devices"

Similar presentations


Ads by Google