COMP3221: Microprocessors and Embedded Systems Lecture 18: Computer Buses and Parallel Input/Output (II) Lecturer: Hui.

Slides:



Advertisements
Similar presentations
IO Interfaces and Bus Standards. Interface circuits Consists of the cktry required to connect an i/o device to a computer. On one side we have data bus.
Advertisements

Computer Architecture
I/O Organization popo.
Lab 9: Matrix Keypad : ”No Key Press” Analysis Slide #2 Slide #3 ”Press and Hold Key 5” Analysis.
Programmable Interval Timer
Input/Output Ports and Interfacing ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
82C55 82C55 Programmable Peripheral Interface Interfacing Part III.
COMP3221: Microprocessors and Embedded Systems Lecture 17: Computer Buses and Parallel Input/Output (I) Lecturer: Hui.
I/O Unit.
CS-334: Computer Architecture
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
COMP3221: Microprocessors and Embedded Systems Lecture 20: Analog Output Lecturer: Hui Wu Session 2, 2004.
680XX Hardware Interface Outline Goal Reading
P Address bus Data bus Read-Only Memory (ROM) Read-Write Memory (RAM)
Informationsteknologi Friday, October 19, 2007Computer Architecture I - Class 81 Today’s class Digital Logic.
INPUT/OUTPUT ORGANIZATION INTERRUPTS CS147 Summer 2001 Professor: Sin-Min Lee Presented by: Jing Chen.
Lecture – 7 Basic input and output
ECE 447 Fall 2009 Lecture 6: TI MSP430 IO Interfacing.
Lecture 12 Today’s topics –CPU basics Registers ALU Control Unit –The bus –Clocks –Input/output subsystem 1.
CS-334: Computer Architecture
 Keyboards, LCDs most widely used input/output devices of the 8051  Contents to be covered:  keyboard fundamentals  key press and key detection mechanisms.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 6
Input/Output Ports and Interfacing
MICROPROCESSOR INPUT/OUTPUT
I/O devices Peripheral devices (also called I/O devices) are pieces of equipment that exchange data with a CPU Examples: switches, LED, CRT, printers,
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
MSI Devices M. Mano & C. Kime: Logic and Computer Design Fundamentals (Chapter 5) Dr. Costas Kyriacou and Dr. Konstantinos Tatas ACOE161 - Digital Logic.
8086/8088 Hardware Specifications Power supply:  +5V with tolerance of ±10%;  360mA. Input characteristics:  Logic 0 – 0.8V maximum, ±10μA maximum;
Top Level View of Computer Function and Interconnection.
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
© 2000 Morgan Kaufman Overheads for Computers as Components I/O devices  I/O devices:  serial links  timers and counters  keyboards  displays  analog.
University of Houston ECE 5440/6370 Advanced Digital Design Lecture on Debouncing Circuit Yuhua Chen Spring 2010.
8279 KEYBOARD AND DISPLAY INTERFACING
Computer Architecture Lecture 2 System Buses. Program Concept Hardwired systems are inflexible General purpose hardware can do different tasks, given.
EEE440 Computer Architecture
1 ECE 372 – Microcontroller Design Parallel IO Ports - Inputs.
Chapter 4 MARIE: An Introduction to a Simple Computer.
L/O/G/O Input Output Chapter 4 CS.216 Computer Architecture and Organization.
8279 KEYBOARD AND DISPLAY INTERFACING
CSCI1600: Embedded and Real Time Software Lecture 9: Input Output Concepts Steven Reiss, Fall 2015.
Magnitude Comparator Dr. Ahmed Telba.
IT3002 Computer Architecture
KEYBOARD INTERFACING Keyboards are organized in a matrix of rows and columns The CPU accesses both rows and columns through ports. ƒTherefore, with two.
Chapter 3 System Buses.  Hardwired systems are inflexible  General purpose hardware can do different tasks, given correct control signals  Instead.
ECE 447: Lecture 12 Keypads ECE 447: Lecture 10. ECE 447: Matrix Keypad.
ACOE161 (Spring2007)MSI Devices1 Revision on MSI Devices M. Mano & C. Kime: Logic and Computer Design Fundamentals (Chapter 5)
BIRLA VISHVAKARMA MAHAVIDYALAYA TOPIC : Keyboard interfacing and flowchart MADE BY: Nidhi Bhangale ( ) Gargi Patel ( ) Meghna Rathod.
Peripherals – Keypad The Keypad provides a simple means of numerical data or control input. The keys can be attributed whatever data or control values.
LCD AND KEYBOARD INTERFACING
Basics of digital systems
COMP2121: Microprocessors and Interfacing
COMP2121: Microprocessors and Interfacing
Subject Name: Microprocessors Subject Code:10EC46 Department: Electronics and Communication Date: /10/2018.
Interfacing Memory Interfacing.
CSCI1600: Embedded and Real Time Software
82C55 Programmable Peripheral Interface
8279 – Programmable Keyboard/Display Interface
CSCI1600: Embedded and Real Time Software
COMP3221: Microprocessors and Embedded Systems
LCD AND KEYBOARD INTERFACING
Presentation transcript:

COMP3221: Microprocessors and Embedded Systems Lecture 18: Computer Buses and Parallel Input/Output (II) Lecturer: Hui Wu Session 2, 2004

COMP3221/9221: Microprocessors and Embedded Systems 2 Overview Bus Arbitration Switches

COMP3221/9221: Microprocessors and Embedded Systems 3 Bus Masters and Slaves A bus master is either a CPU or a hardware component (DMA Controller for instance) that controls the buses. A bus slave is a device that takes its orders from the bus master. What if two or more bus masters want to control the buses simultaneously?  Bus arbitration is required.

4 Bus Arbitration Daisy chain bus arbitration. Hardware priority bus arbitration.

5 Daisy Chain Bus Arbitration Master 1Master 2Master n HOLDA HOLD Intel 8086 CPU

6 Daisy Chain Bus Arbitration (Cont.) Whenever a device wants to control the bus, it asserts HOLD and opens the switch in the HOLDA (HOLD_ACKNOLEDGE) line. When HOLDA is asserted by the CPU, it passes through each of the inactive one. If a bus master farther right on the chain asserts HOLD before another master is finished, HOLDA is not passed along until the higher priority device (closer to CPU) is finished with its tasks and closes its switch.

7 Hardware Priority Bus Arbitration Priority Encoder Priority Resolution Hardware Intel 8086 CPU Master 1Master 2Master n HOLD HOLDA HOLD1HOLD2HOLDn HOLDA1HOLDA2HOLDAn

8 Hardware Priority Bus Arbitration Each device is pre-assigned a priority. Simultaneous HOLD signals are encoded so that only the highest priority device receives HOLDA.

9 Input Switches Most basic of all binary input devices. The switch output is high or low depends on the the switch position. Pull-up resistors are necessary in each switch to provide a high logic level when the switch is open. Problem with switches:  Switch bounce.  When a switch makes contact, its mechanical springiness will cause the contact to bounce, or make and break, for a few millisecond (typically 5 to 10 ms).

10 Input Switches (Cont.) Data Bus ½ 74LS244 Octal Buffer Vcc (a) Single-pole, single-throw (SPST) logic switch Data Bus (b) Multiple pole switch. R Typically 1K Ohm Logic high with switch open Logic low with switch closed

11 Software Debouncing Wait and see:  If the software detects a low logic level, indicating that switch has closed, it simply waits for longer than 10 ms, say 20 to 100ms, and then test for the switch still being low. Counter-based approach:  Initialize a counter to 10.  Poll the switch every millisecond until the counter is either 0 or 20. If the switch output is low, decrement the counter; otherwise, increment the counter.  If the counter is 0, we know that switch output has been low for at least 10 ms. If, on the other hand, the counter reaches 20, we know that the switch has been closed for at least 10 ms. Two software debouncing approaches:

12 NAND Latch Debouncer R Typically 1K Ohm Logic high with switch up Logic low with switch down

13 NOR Latch Debouncer Logic high with switch up Logic low with switch down Vcc

14 Integrating Debouncer with Schmitt Trigger R Logic high with switch up Logic low with switch down 74LS14 Schmitt Trigger

15 One-Dimensional Array of Switches I0 I2 I3 I4 I5 I6 I7 I1 ES2S1S0 Selected Input From Output Port Z Scanned Switch Data To Input Port 74LS151 8 to 1 Multiplexer A Vcc

16 One-Dimensional Array of Switches Switch bounce problem must be solved. The array of switches must be scanned to find out which switches are closed or open.  Software is required to scan the array. As the software outputs a 3-bits sequence from 000 to 111, the multiplexer selects each of the switch inputs. The software scanner then read one bit at an input port. The output of switch array could be interfaced directly to an eight-bit port at point A. To save I/O lines, a 74LS151 8_Inpu Multiplexer can be used.

17 Keyboard Matrix of Switches I0 I2 I3 I4 I5 I6 I7 I1 E S2S1S0 Select Input From Output Port Z Scanned Switch Data To Input Port O0O1O2O3O7O6O5O4 74LS151 8-Input Multiplexer A0A1A2E3E2E1 Vcc B A Scan Input From Output Port 74LS138 3-of- 8 Decoder Vcc 11

18 Keyboard Matrix of Switches (Cont.) A keyboard is an array of switches arranged in a two- dimensional matrix. A switch is connected at each intersection of vertical and horizontal lines to the vertical. Closing the switch connects the horizontal line to the vertical line. 8*8 keyboard can be interfaced directly into 8-bit output and input ports at point A and B. Some input and output lines can be saved by using a 74LS138 3-of-8 decoder and a 74LS151 8-Input Multiplexer.

19 Keyboard Matrix of Switches (Cont.) Software can scan the key board by outputting a three-bit code to 74LS138 and then scanning the 74LS151 multiplexer to find the closed switch.  The combination of the two 3-bit scan codes identifies which switch is closed. For example, the code scan switch 00 in the upper left- hand corner. The diode prevents a problem called ghosting.

20 Ghosting Col 0Col 1Col R3R2R1 Row 0 (Pulled low, error) Row 1 (Pulled low, OK) Row 2 (High, OK) Low (Scanned column) Vcc

21 Ghosting (Cont.) Ghosting occurs when several keys are pushed at once. Consider the case shown in the figure where three switches 01, 10 and 11 are all closed. Column 0 is selected with a logic low and assume that the circuit does not contain the diodes. As the rows are scanned, a low is sensed on Row 1, which is acceptable because switch 10 is closed. In addition, Row 0 is seen to be low, indicating switch 00 is closed, which is NOT true. The diodes in the switches eliminate this problem by preventing current flow from R1 through switches 01 and 11. Thus Row 0 will not be low when it is scanned.

COMP3221/9221: Microprocessors and Embedded Systems 22 Reading 1.Chapter 7: Computer Buses and Parallel Input and Output. Microcontrollers and Microcomputers by Fredrick M. Cady.