Microprocessors InputOutput Interface Chapter 10 Dr Costas Kyriacou

  • Slides: 42
Download presentation
Microprocessors Input/Output Interface (Chapter 10) Dr. Costas Kyriacou and Dr. Konstantinos Tatas ACOE 255

Microprocessors Input/Output Interface (Chapter 10) Dr. Costas Kyriacou and Dr. Konstantinos Tatas ACOE 255 Microprocessors I - Frederick University

Introduction • In a typical computer system, the user communicates with the computer via

Introduction • In a typical computer system, the user communicates with the computer via standard peripheral devices such as the keyboard, mouse, display, printer e. t. c. • Furthermore computers and microprocessor based systems are used in instrumentation or automatic control applications. In such cases it is necessary that the microprocessor reads the state of input devices (switches, sensors) and activate some output devices (motors, heaters, lights). • The I/O interface is required to enable the interface between the microprocessor and the peripheral devices. • The peripheral devices are connected on a microprocessor system through the Input/Output ports. • The I/O interface provides the following: – Isolation between the buses and the peripheral devices. – Address decoding. – Synchronization/Latching. ACOE 255 Microprocessors I - Frederick University 2

Isolated vs Memory-mapped I/O • Isolated I/O – I/O locations are separate from memory

Isolated vs Memory-mapped I/O • Isolated I/O – I/O locations are separate from memory locations – Special I/O instructions are used – The most common technique for Intel microprocessors – Advantage: More space for memory – Disadvantage: Additional control signals (IO/M) and instructions increase complexity • Memory-mapped I/O – I/O devices are treated as memory locations in the memory map – Any memory transfer instruction can be used (MOV, LDR, STR etc) – Advantages: Simpler decoding circuitry, no special instructions required – Disadvantage: A portion of the memory system is used as the I/O map, reducing the memory available to applications ACOE 255 Microprocessors I - Frederick University 3

Input/Output Instructions • The 8088 and 80 X 86 processors use the 16 lower

Input/Output Instructions • The 8088 and 80 X 86 processors use the 16 lower address lines (A 0 to A 15) to address I/O devices. This limits the maximum number of I/O ports to 64 K. • The IN instruction copies the content of an input port to register AL, AX or EAX. • The OUT instruction copies the content of register AL, AX, or EAX to an output port. • Register AL is used for 8 -bit ports, AX for 16 -bit ports and EAX for 32 -bit ports. • The 8088 and 80 X 86 processors support two I/O addressing modes. – Fixed Address. The address is directly specified in the instruction as an 8 -bit number. That is loaded on the address lines A 0 to A 7. Address lines A 8 to A 15 are set to 00. • IN AL, 30 H ; Read input port 0030 H into register AL • OUT 30 H, AL ; Copy register AL to output port 0030 H. – Variable Address. The address is specified through register DX as a 16 -bit address. • MOV DX, 3 A 0 H ; Set I/O address • IN AL, DX ; Read input port [DX] or 3 A 0 H into register AL. • OUT DX, AL ; Copy register AL to output port [DX] or 3 A 0 H ACOE 255 Microprocessors I - Frederick University 4

High Level Language Input/Output Instructions (Pascal) • Input/Output using Pascal: I/O is obtained using

High Level Language Input/Output Instructions (Pascal) • Input/Output using Pascal: I/O is obtained using the ‘Port[ ]’ instruction. – X : = Port[Port. Address]; /* Copy the contents of the specified port into X */ – Port[Port. Address] : = X; /* Copy the contents of X into the specified port */ • Input/Output using Delphi: Delphi does not allow direct access to I/O ports. This can be done by inserting assembly language code into Delphi as follows: asm ; code equivalent to ‘value: =port[portaddress]; begin mov dx, portaddress ; specify the port address in al, dx ; input from the port specified by “dx” into “al” mov value, al ; copy input data into variable ‘value’ end; asm ; code equivalent to ‘port[portaddress] : = value; begin mov dx, portaddress ; specify the port address mov al, value ; move output data into register “al” out dx, al ; output data to the port specified by “dx” end; ACOE 255 Microprocessors I - Frederick University 5

High Level Language Input/Output Instructions (C/C++) • C/C++ does not allow direct access to

High Level Language Input/Output Instructions (C/C++) • C/C++ does not allow direct access to I/O ports. This can be done by inserting assembly language code into the C/C++ code as follows: __asm ; code equivalent to ‘value: =port[portaddress]; { mov dx, portaddress ; specify the port address in al, dx ; input from the port specified by “dx” into “al” mov value, al } ; copy input data into variable ‘value’ __asm ; code equivalent to ‘port[portaddress] : = value; { mov dx, portaddress ; specify the port address mov al, value ; move output data into register “al” out dx, al ; output data to the port specified by “dx” } ACOE 255 Microprocessors I - Frederick University 6

Input/Output Using DLLs (C/C++) • For protection purposes, modern operating systems such as the

Input/Output Using DLLs (C/C++) • For protection purposes, modern operating systems such as the Windows XP do not allow the use of the IN and the OUT instructions in the users programs. • A way to have access to I/O ports is through libraries (DLL files) developed for this purpose. Such a library is the inout 32. dll • To use this library in Visual Studio (C++) we must: – Add the inout 32. lib file in the Linker properties • Project ->Properties->Linker->Input->Additional Dependencies – Define the two functions for input and output and use them accordingly short _stdcall Inp 32(short Port. Address); void _stdcall Out 32(short Port. Address, short data); main() { short Inval = Inp 32(889); /* input from port 889 into variable “Inval”*/ Out 32(888, 0 x 2 f); /* Output the hex value 2 f to port 888 */ } ACOE 255 Microprocessors I - Frederick University 7

Simple Input Port • An input port can be implemented using a simple octal

Simple Input Port • An input port can be implemented using a simple octal buffer such as the 74 LS 244. • The address decoding circuit enables the three-state buffers of the 74 LS 244 whenever the port address is selected by the processor. In such a case the state of the input devices appears on the data bus. • The address decoding circuit is enabled only if the IO/M signal is set High by the 8088 (Low for the x 86 processors) and the RD signal is Low. ACOE 255 Microprocessors I - Frederick University Switch Open => Logic 1 Switch Closed => Logic 0 8

Simple Output Port (Using the 74 LS 373) • An output port can be

Simple Output Port (Using the 74 LS 373) • An output port can be implemented using a simple octal latch such as the 74 LS 373. • The address decoding circuit enables the D-latches of the 74 LS 373 whenever the port address is selected by the processor. In such a case the state of the data bus is latched to the output devices. • The address decoding circuit is enabled only if the IO/M signal is set High by the 8088 (Low for the x 86 processors) and the WR signal is Low. ACOE 255 Microprocessors I - Frederick University Logic 1 => LED is OFF Logic 0 => LED is ON 9

Simple Output Port (Using the 74 HCT 573) • The 74 HCT 573 is

Simple Output Port (Using the 74 HCT 573) • The 74 HCT 573 is pin compatible with the 74 LS 373. There are three significant differences: Logic 1 => LED is OFF Logic 0 => LED is ON – The ‘ 573 has all inputs on the left side and all outputs on the right side of the IC, while the ‘ 373 has the even numbered inputs on the left side and the odd numbered inputs on the right side. Thus the ‘ 573 is easier to by handled on PCB boards. – The HCT 573 has a 20 m. A current sink and a 20 m. A current source, thus it can drive a LED connected either to the ground or to +5 V. The LS 373 has a 16 m. A current sink and a 400 u. A current source, thus it can only drive a LED connected to +5 V. Logic 1 => LED is ON Logic 0 => LED is OFF – The HCT family is faster than the LS family. ACOE 255 Microprocessors I - Frederick University 10

Simple I/O Example 1 (Hardware) • Draw a circuit to show 8 switches can

Simple I/O Example 1 (Hardware) • Draw a circuit to show 8 switches can be connected on the input port 3 AH and 8 LEDs on the output port 5 CH. ACOE 255 Microprocessors I - Frederick University 11

Simple I/O Example 1 (Software) Write a program to keep reading the state of

Simple I/O Example 1 (Software) Write a program to keep reading the state of the switches and switch ON the LED at the position form by the switches at D 2, D 1 and D 0 (i. e. 3 X 8 decoder). C/C++ Code Pseudo Code: Repeat Read Input port in In. Val Mask out D 2, D 1, D 0 from In. Val if In. Val = 0 then Out. Val = 1 if if In. Val = 1 then Out. Val = 2 if In. Val = 2 then Out. Val = 4 if In. Val = 3 then Out. Val = 8 if In. Val = 4 then Out. Val = 16 if if In. Val = 5 then Out. Val = 32 if In. Val = 6 then Out. Val = 64 if In. Val = 7 then Out. Val = 128 Write Out. Val to Output port Until keypressed ACOE 255 main() { short In. Val, Out. Val = 0; do { In. Val = Inp 32(0 x 3 a); In. Val = In. Val & 0 x 7; if (In. Val == 0) Out. Val = 0 x 1; if (In. Val == 1) Out. Val = 0 x 2; if (In. Val == 2) Out. Val = 0 x 4; if (In. Val == 3) Out. Val = 0 x 8; if (In. Val == 4) Out. Val = 0 x 10; if (In. Val == 5) Out. Val = 0 x 20; if (In. Val == 6) Out. Val = 0 x 40; if (In. Val == 7) Out. Val = 0 x 80; Out 32(0 x 5 c, Out. Val); } while (!_kbhit()); } Microprocessors I - Frederick University 12

Mask Operations (a) Write a program to keep reading the . ACOE 255 (b)

Mask Operations (a) Write a program to keep reading the . ACOE 255 (b) Write a program to keep reading the state of the switches and switch ON the LEDs for which the corresponding switch is closed. Microprocessors I - Frederick University 13

Simple I/O Example 2 Four float switches and four LEDs are used to indicate

Simple I/O Example 2 Four float switches and four LEDs are used to indicate the level of a liquid in the tank shown below. The switches and the LEDs are connected on a computer through an interface board with an input and an output port occupying the address 460 H to 46 FH. • Draw the circuit diagram of the interface board. • Write a program to keep reading the state of the float switches and display the liquid level on the LEDs. If an error is detected then switch ON all LEDs. ACOE 255 Microprocessors I - Frederick University 14

Simple I/O Example 2 (Circuit Diagram) ACOE 255 Microprocessors I - Frederick University 15

Simple I/O Example 2 (Circuit Diagram) ACOE 255 Microprocessors I - Frederick University 15

Simple I/O Example 2 (Software using Case/Switch Statement) Pseudo Code: C/C++ Code Set Out.

Simple I/O Example 2 (Software using Case/Switch Statement) Pseudo Code: C/C++ Code Set Out. Val to 0, i. e switch off all leds main() { short In. Val, Out. Val = 0; Repeat do { Read Input port in In. Val = Inp 32(0 x 460); Mask out D 3, D 2, D 1, D 0 from In. Val = In. Val & 0 xf; Case of In. Val switch (In. Val) { 0: Out. Mask = 1 case 0: Out. Mask = 1; break; 1: Out. Mask = 2 case 1: Out. Mask = 2; break; 3: Out. Mask = 4 case 3: Out. Mask = 4; break; 7: Out. Mask = 8 case 7: Out. Mask = 8; break; FH: Out. Mask = 10 H case 0 xf: Out. Mask = 0 x 10; break; else Out. Mask = 1 FH default Out. Mask = 0 x 1 f; } Mask in D 4 to D 0 of Out. Mask in Out. Val Write Out. Val to Output port Until keypressed ACOE 255 Out. Val = (Out. Val & 0 xe 0) | Out. Mask; Out 32(0 x 460, Out. Val); } while (!_kbhit()); } Microprocessors I - Frederick University 16

Simple I/O Example 2 (Software using array as a lookup table) C/C++ Code Pseudo

Simple I/O Example 2 (Software using array as a lookup table) C/C++ Code Pseudo Code: main() { short In. Val, Out. Val = 0; Table[0] = 00001 /* Table[1] = 00010 /* Table[3] = 00100 /* short Table[16] = 0 x 1, 0 x 2, 0 x 1 f, 0 x 4, Table[7] = 01000 /* 0 x 1 f, 0 x 8, Table[15] = 10000 /* 0 x 1 f, Table[rest] = 111111 /* 0 x 1 f, 0 x 10; do { Repeat In. Val = Inp 32(0 x 460); Read Input port in In. Val Mask out D 2, D 1, D 0 from In. Val Mask in D 2, D 1, D 0 of Table[In. Val] to Out. Val Write Out. Val to Output port Until keypressed ACOE 255 In. Val = In. Val & 0 xf; Out. Mask = Table[In. Val]; Out. Val = (Out. Val & 0 xe 0) | Out. Mask; Out 32(0 x 460, Out. Val); } while (!_kbhit()); } Microprocessors I - Frederick University 17

DC Motor Speed and Direction Control • The speed of a DC motor is

DC Motor Speed and Direction Control • The speed of a DC motor is proportional to the DC voltage applied at its terminal. – Thus the speed can be controlled by controlling the DC voltage. • The DC voltage can be controlled by: – Inserting a resistor in series with the DC motor. • Unnecessary dissipation of energy on the resistor. – Using Pulse Width Modulation (PWM) • The direction of rotation a DC motor is reversed by reversing the polarity of the DC voltage applied at its terminal. – This can be obtained using a relay (change-over connection). – Connecting a relay on an output port requires the use of high current drivers such as the ULN 2803 and diodes to protect the output transistors due to Lenz’s law. • Special drivers (H-drivers) can also be used to provide both speed control and direction control. ACOE 255 Microprocessors I - Frederick University 18

DC motor interface example A DC motor is connected to a computer as shown

DC motor interface example A DC motor is connected to a computer as shown below. The switches and the motor are connected on an input and an output port occupying the address 460 H to 46 FH. • Draw a circuit of the interface and the connections to the motor • Write a program to keep reading the state of the switches and control the operation of the motor accordingly. ACOE 255 Microprocessors I - Frederick University 19

DC motor interface example(Circuit Diagram) ACOE 255 Microprocessors I - Frederick University 20

DC motor interface example(Circuit Diagram) ACOE 255 Microprocessors I - Frederick University 20

DC motor interface example (Software using conditional execution) Pseudo Code: Set Out. Val to

DC motor interface example (Software using conditional execution) Pseudo Code: Set Out. Val to 0, i. e motor is OFF Repeat Read Input port in In. Val If On/Off bit = 1 then Out. Val(D 0) = 1 else Out. Val(D 0) = 0 If Fast/Slow bit = 1 then Out. Val(D 1) = 1 else Out. Val(D 1) = 0 If Frwd/Rev bit = 1 then Out. Val(D 2) = 1 else Out. Val(D 2) = 0 Write Out. Val to Output port Until keypressed ACOE 255 Microprocessors I - Frederick University 21

DC motor interface example (Software using a lookup table) Pseudo Code: Table[0] Table[1] Table[2]

DC motor interface example (Software using a lookup table) Pseudo Code: Table[0] Table[1] Table[2] Table[3] Table[4] Table[5] Table[6] Table[7] = 000 = 010 = 011 = 000 = 110 = 111 /* 000 ->motor is Off /* 001 ->motor is Off /* 010 -> On-Slow-Rev /* 011 -> On-Slow-Frwd /* 100 -> motor is Off /* 101 -> motor is Off /* 110 ->On-Fast-Rev /* 111 ->On-Fast-Frwd Repeat Read Input port in In. Val Mask out D 2, D 1, D 0 from In. Val Mask in D 2, D 1, D 0 of Table[In. Val] to Out. Val Write Out. Val to Output port Until keypressed ACOE 255 Microprocessors I - Frederick University 22

7 -Segment Displays • Used to display the digits from 0 to 9, as

7 -Segment Displays • Used to display the digits from 0 to 9, as well as many letters (A, b, C, d, E, F, L, H) • Consists of seven leds connected to a common point • Can be common-anode or common-cathode Can be connected directly on an O/P port ACOE 255 OR Through a BCD/7 segment decoder Microprocessors I - Frederick University 23

7 -segment Displays – Example 1 • Draw a circuit to show a common

7 -segment Displays – Example 1 • Draw a circuit to show a common cathode 7 -segment display can be connected on an o/p port and four switches on an i/p port both occupying the address range 860 h to 86 Fh. • Write a program to read the state of the switches and display the binary number formed by the switches as a hexadecimal digit. ACOE 255 Microprocessors I - Frederick University 24

7 -segment Displays – Example 1: Program ACOE 255 Microprocessors I - Frederick University

7 -segment Displays – Example 1: Program ACOE 255 Microprocessors I - Frederick University 25

7 -Segment Displays: Example 2 Four float switches and a 7 -segment display are

7 -Segment Displays: Example 2 Four float switches and a 7 -segment display are used to indicate the level of a liquid in the tank shown below. The switches and the display are connected on a computer through an interface board with an input and an output port occupying the address 460 H to 46 FH. Draw the circuit diagram of the interface board. Write a program to keep reading the state of the float switches and display the liquid level on the display using the digits F(Full), H(High), A (Half), L(Low) and E(Empty). If an error is detected then switch ON the decimal point. ACOE 255 Microprocessors I - Frederick University 26

7 -segment Displays – Example 1: Program ACOE 255 Microprocessors I - Frederick University

7 -segment Displays – Example 1: Program ACOE 255 Microprocessors I - Frederick University 27

7 -segment Displays – Example 3 • Draw a circuit to show a common

7 -segment Displays – Example 3 • Draw a circuit to show a common cathode 7 -segment display can be connected on an o/p port and four switches on an i/p port both occupying the address range 860 h to 86 Fh. • Write a program to read the state of the switches and display the binary number formed by the switches as a hexadecimal digit. ACOE 255 Microprocessors I - Frederick University 28

7 -segment Displays – Example 1: Program ACOE 255 Microprocessors I - Frederick University

7 -segment Displays – Example 1: Program ACOE 255 Microprocessors I - Frederick University 29

7 -segment Displays – Example 1 • Draw a circuit to show common cathode

7 -segment Displays – Example 1 • Draw a circuit to show common cathode 7 -segment display can be connected on an o/p port and four switches on an i/p port both occupying the address range 860 h to 86 Fh. • Write a program to read the state of the switches and display the binary number formed by the switches as a hexadecimal digit. ACOE 255 Microprocessors I - Frederick University 30

Homework- Question 1 a) Draw a circuit diagram to show four switches and two

Homework- Question 1 a) Draw a circuit diagram to show four switches and two 7 -segment displays can be interfaced to an 8088 based system occupying the address 10 H to 1 FH, 20 H to 2 FH and 30 H to 3 FH respectively. b) Write a program to read the binary number formed by the four switches and display the equivalent decimal number on the 7 -segment displays. For example if the switches form the number 0110, the displays should display the number 06, and if the switches form the number 1110, then the displays should display the number 14. ACOE 255 Microprocessors I - Frederick University 31

Homework- Question 2 a) Draw a circuit diagram to show four switches and a

Homework- Question 2 a) Draw a circuit diagram to show four switches and a 7 -segment display can be interfaced to an 8088 based system occupying the address A 0 H to AFH, F 0 H to FFH respectively. b) Write a program to read the state of the switches and display on the 7 -segment display the letter: • • • H, if there are more switches closed than open, L, if there are less switches closed than open, E, if the number of switches closed is equal to the number of switches open. ACOE 255 Microprocessors I - Frederick University 32

Homework- Question 3 a) Draw a circuit diagram to show six switches and eight

Homework- Question 3 a) Draw a circuit diagram to show six switches and eight Leds can be interfaced to an 8088 based system occupying the address 30 H to 3 FH, 20 H to 2 FH respectively. b) Write a program to read the binary number formed by the six switches and display the equivalent Binary Coded Decimal number on the Leds. For example if the switches form the number 100101, the displays should display the number 00110111, since (100101)2 = (00110111)BCD. ACOE 255 Microprocessors I - Frederick University 33

Homework- Question 4 a) Draw a circuit diagram to show the following can be

Homework- Question 4 a) Draw a circuit diagram to show the following can be interfaced to an 8088 based system: i. Four switches connected on an I/P port occupying the address range from 30 H to 3 FH. ii. Eight Leds connected on an O/P port occupying the address range from 20 H to 2 FH. b) Write a program to read the BCD number formed by the four switches, and display it on the eight Leds the square of the input number in BCD form. If the number formed by the switches is an invalid BCD number, then all of the Leds should be switched ON. – – ACOE 255 For example if the switches form the number 00000101 then the Leds should display 00100101, since (00000101)BCD = (05)10 and 52 = 25 = (00100101)BCD If the number formed by the switches is 00001100 then the Leds should display 1111 since 1100 is an invalid BCD number. Microprocessors I - Frederick University 34

Homework- Question 5 a) Draw a circuit diagram to show a common cathode 7

Homework- Question 5 a) Draw a circuit diagram to show a common cathode 7 -segment display can be connected on an output port, occupying the address CAH. b) Write a program to display the digits from 0 to 9 on the 7 -segment display with a 1 -second delay between digits. c) Write a procedure to display on the 7 -segment display, the letter E if the contents of the variable INVAL is equal to 80 H, the letter H if INVAL is greater than 80 H, or the letter L if INVAL is less than 80 H. d) Write a program that keeps reading the binary number from the input port 0 AAH and displays on the 7 -segment display, a letter according to the table given below. xxxxx 000 xxxxx 001 xxxxx 010 xxxxx 011 xxxxx 100 xxxxx 101 xxxxx 110 xxxxx 111 E ACOE 255 I L U H Microprocessors I - Frederick University Γ Ξ F 35

Homework- Question 6 a) Draw a circuit diagram to show the following can be

Homework- Question 6 a) Draw a circuit diagram to show the following can be interfaced to an 8088 system i. ii. Three switches connected on an I/P port occupying the address range from 60 H to 6 FH. Eight Leds connected on an O/P port occupying the address range from 50 H to 5 FH. b) Write a program to i. ii. read the code formed by the three switches in a 1 -second time intervals, convert the input code into a binary value according to the table below and store it in an array called BINV, and iii. display it as a bar graph on the eight Leds as shown in figure below For example if the switches form the number 101 then the number 110 must be stored in the array BINV and the Leds should display 11111110. ACOE 255 Microprocessors I - Frederick University 36

THE 82 C 55 PROGRAMMABLE PERIPHERAL INTERFACE (PPI) • A popular interfacing component, for

THE 82 C 55 PROGRAMMABLE PERIPHERAL INTERFACE (PPI) • A popular interfacing component, for interfacing TTL-compatible I/O devices to the microprocessor. • Requires insertion of wait states if used with a microprocessor using higher that an 8 MHz clock. • PPI has 24 pins for I/O that are programmable in groups of 12 pins and three modes of operation (Basic I/O, Strobed Bi-directional Bus I/O). • In the PC, an 82 C 55 or its equivalent is decoded at I/O ports 60 H-63 H, interfacing keyboard and Parallel printer port). ACOE 255 VCC: The +5 V power supply pin. GND: GROUND D 0 -D 7: I/O DATA BUS RESET: A high on this input clears the control register and all ports (A, B, C) are set to the input mode with the “Bus Hold” circuitry turned on. CS: Chip select is an active low input used to enable the 82 C 55 A onto the Data Bus for CPU communications. RD: Read is an active low input control signal used by the CPU to read status information or data via the data bus. WR: Write is an active low input control signal used by the CPU to load control words and data into the 82 C 55 A. A 0 -A 1: Address input signals, in conjunction with the RD and WR inputs, control the selection of one of the three ports or the control word register (00 – Port A, 01 – Port B, 10 – Port C, 11 – CR). PA 0 -PA 7 (I/O PORT A): 8 -bit input and output port. PB 0 -PB 7 (I/O PORT B): 8 -bit input and output port. PC 0 -PC 7 (I/O PORT C): 8 -bit input and output port. Microprocessors I - Frederick University 37

INTERFACING 82 C 55 TO AN 8088 SYSTEM (ports 60 H-63 H) ACOE 255

INTERFACING 82 C 55 TO AN 8088 SYSTEM (ports 60 H-63 H) ACOE 255 Microprocessors I - Frederick University 38

EXAMPLE • Use a 82 C 55 PPI to interface four switches at address

EXAMPLE • Use a 82 C 55 PPI to interface four switches at address 60 H and a SSD at address 62 H ACOE 255 Microprocessors I - Frederick University 39

PROGRAMMING THE 82 C 55 • Mode 0 operation causes the PPI to function

PROGRAMMING THE 82 C 55 • Mode 0 operation causes the PPI to function as either buffered input or latched output • The 82 C 55 is programmed through two internal command registers, selected through bit 7. • Command byte A – 0 Port C, PC 3 -PC 0 (1 -input, 0 -output) – 1 Port B (1 -input, 0 -output) – 2 Mode (0 -mode 0, 1 -mode 1) – 3 Port C, PC 7 -PC 4 (1 -input, 0 -output) – 4 Port A (1 -input, 0 -output) – 5 -6 Mode (00 -mode 0, 01 -mode 2, 1 X-mode 2) – 7 Command byte select (always 1 for Command byte A) • Command byte B – Used in mode 1 and mode 2 ACOE 255 Microprocessors I - Frederick University 40

Example • Rewrite the program of the example of slide 30, this time using

Example • Rewrite the program of the example of slide 30, this time using the PPI and setting up the ports as shown in the previous slide ACOE 255 Microprocessors I - Frederick University 41

Homework • All examples of slides 31 -36 can be modified to include PPI

Homework • All examples of slides 31 -36 can be modified to include PPI interfacing ACOE 255 Microprocessors I - Frederick University 42