Presentation is loading. Please wait.

Presentation is loading. Please wait.

P Address bus Data bus Read-Only Memory (ROM) Read-Write Memory (RAM)

Similar presentations


Presentation on theme: "P Address bus Data bus Read-Only Memory (ROM) Read-Write Memory (RAM)"— Presentation transcript:

1 P Address bus Data bus Read-Only Memory (ROM) Read-Write Memory (RAM)
IOWC MWTC IORC MRDC Read-Only Memory (ROM) Read-Write Memory (RAM) Keyboard (Input) Printer (Output)

2 I/O Any microprocessor need to be interfaced with I/O devices.
The I/O address is 16 bit.

3 Modes of I/O Instructions
Direct I/O – the port address is one of the operands. Address must be 00-FFh. IN AL, 27h Data flows through the accumulator MOV AX, BX OUT 26h, AX ; move 16-bit data from AX to port ; 26h (AL to 26h and AH to 27h) Indirect I/O – the port address is preloaded into DX Address can be 0000-FFFFh String I/O – allows data to pass directly to or from a memory location.

4 80x86 I/O Instructions

5 FIGURE 8-2 Sixteen-bit 80x86 input port
FIGURE Sixteen-bit 80x86 input port. Tristate buffers are used to place the input data on the data bus lines. John Uffenbeck The 80x86 Family: Design, Programming, and Interfacing, 3e Copyright ©2002 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

6 FIGURE 8-4 Eight-bit 80x86 output port
FIGURE Eight-bit 80x86 output port. Eight latches are required to store the output data. John Uffenbeck The 80x86 Family: Design, Programming, and Interfacing, 3e Copyright ©2002 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

7 FIGURE 8-6 Using device-select pulses to control a relay
FIGURE Using device-select pulses to control a relay. An IN AL,0 instruction will turn the relay on; an OUT 0,AL instruction will turn it off. John Uffenbeck The 80x86 Family: Design, Programming, and Interfacing, 3e Copyright ©2002 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

8 Memory mapped I/O

9 I/O Map

10 Programmed I/O

11 Parallel Printer Interface example

12 Parallel Printer Interface example

13 Parallel Printer Interface example Polling loop

14 Peripheral Controllers
Intel has developed several peripheral controller chips designed to support its processors. The goal is to give a complete I/O interface in one chip. Examples: 8255 is Programmable Peripheral Interface (PPI). 8259 is Programmable Interrupt Controller (PIC) 8253/8254 is Programmable Interval Timer (PIT) 8237 is Programmable DMA controller. In PC/XT computers these chips are built into the system board and can be seen by inspection. In modern Computers the functionality of these chips has been built into the system board chipset.

15 8255A Is one of the peripheral controller chips designed to support its processors. 8255 is Programmable Peripheral Interface (PPI). It is a general purpose parallel I/O Interfacing device. It provides 24 I/O lines organized in three 8-bit I/O ports in one 40-pin package. The ports are usually labeled A,B, and C fig 8.11

16 Size of ports Ports A and B can be programmed as an 8-bit input or output port. In port C each nipple (four bits) can be programmed separately to be a 4-bit input or output port. Only the above size of ports (byte or nipple) can be programmed. For Example, individual bit in a port cannot be programmed. However, what make 8254 a versatile devise is its programming modes

17 Programming modes Mode 0: the 8255A is programmed to look like three simple I/O ports. Mode 1: the 8255A is programmed to have two handshaking I/O ports. Mode 1: the 8255A is programmed to have one bidirectional port with five handshaking signals. The modes can be intermixed, for example, port A is programmed to operate in mode 2, while port B operates in mode 0. bit set/reset mode allows individual bits of port C to be set or reset for control purposes.

18 FIGURE 8-11 8255 programmable peripheral interface (PPI)
FIGURE programmable peripheral interface (PPI). Twenty-four I/O pins are provided grouped as three 8-bit I/O ports. There is one 8-bit control port. (Courtesy of Intel Corporation.) John Uffenbeck The 80x86 Family: Design, Programming, and Interfacing, 3e Copyright ©2002 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

19 FIGURE 8-12 Interfacing the 8255 to the 386/486 processors
FIGURE Interfacing the 8255 to the 386/486 processors. The four PPI ports are mapped to addresses 0, 4, 8, and C. John Uffenbeck The 80x86 Family: Design, Programming, and Interfacing, 3e Copyright ©2002 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

20 8255 A1 A0 RD WR CS Direction 0 0 0 1 0 PORT A to data bus
PORT B to data bus PORT C to data bus data bus to PORT A data bus to PORT B data bus to PORT C data bus to control x x x x data bus in 3rd state illegal condition x x data bus in 3rd state

21 FIGURE 8-13 Two types of 8255A control bytes
FIGURE Two types of 8255A control bytes. (a) When bit 7 = 0, a bit set/reset operation is indicated; (b) When bit 7 = 1, any of the modes 0, 1, or 2 can be programmed. (From J. Uffenbeck, Microcomputers and Microprocessors: The 8080, 8085 and Z 80, Prentice Hall, Englewood Cliffs, NJ, 1991.) John Uffenbeck The 80x86 Family: Design, Programming, and Interfacing, 3e Copyright ©2002 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

22 FIGURE Interfacing a 16-key switch matrix to the 8255A (assumed interfaced to the 386/486 circuit shown in Figure 8-12). Port A is programmed as a mode 0 input port and port C (upper) as a mode 0 output port. John Uffenbeck The 80x86 Family: Design, Programming, and Interfacing, 3e Copyright ©2002 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

23 FIGURE Flowchart of the process required to detect a key closure, debounce the key, and encode with a value between 0 and F. John Uffenbeck The 80x86 Family: Design, Programming, and Interfacing, 3e Copyright ©2002 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

24 FIGURE Block diagram and pin descriptions for the 8254 programmable interval timer. Three separate timers/counters are provided. (Courtesy of Intel Corporation.) John Uffenbeck The 80x86 Family: Design, Programming, and Interfacing, 3e Copyright ©2002 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

25 FIGURE Interfacing the 8254 to the three-bus architecture of the 8088 processor. Four I/O ports are required. The port addresses and connections shown correspond to those used in the IBM PC. John Uffenbeck The 80x86 Family: Design, Programming, and Interfacing, 3e Copyright ©2002 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

26 FIGURE control word. The standard form is used to specify the operating mode. The counter latch and read-back commands are used when the present count or status is to be read. John Uffenbeck The 80x86 Family: Design, Programming, and Interfacing, 3e Copyright ©2002 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

27 FIGURE 8-22 The 8254 has six different operating modes (mode 0-5)
FIGURE The 8254 has six different operating modes (mode 0-5). If not shown the GATE (G) input is assumed high to enable the counter. John Uffenbeck The 80x86 Family: Design, Programming, and Interfacing, 3e Copyright ©2002 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved.

28 Mode 0: Mode 1: Event counter (example: timer for interrupt)
When the counter initiated it will start decrement count from the next T. Out is low for time of count: (n+1)T. Gate should be high for the counter to decrement. Mode 1: Hardware initiated counter using Gate (positive pulse). When the counter initiated it will start decrement count. Out is low for time of count: nT.

29 Mode 2: The counter will generate a series of continuous pulses. Out will pulse low for one period low at the end of the count. f= clk/n duty cycle=(n-1)/n Gate should be high. Mode 3: Square wave generator. Like mode2 Half of the count, out is high and low in the other half.

30 Mode 4: The counter will generate a series of continuous pulses. Out will have one active low pulse when at the end of the count. out is high for (n+1)T and then one active low pulse Gate should be high. Mode 5: Like mode4 But hardware imitated by Gate. out is high for nT and then one active low pulse


Download ppt "P Address bus Data bus Read-Only Memory (ROM) Read-Write Memory (RAM)"

Similar presentations


Ads by Google