© 2006 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved.Brey: The Intel Microprocessors, 7e Interfacing a 4x4 Key Matrix Row Inputs.

Slides:



Advertisements
Similar presentations
BINARY & HEX I/O. Binary input : read in a binary number from keyboard, followed by a carriage return. character strings of 1’s & 0’ we need to convert.
Advertisements

DOS and BIOS Interrupts DOS and BIOS interrupts are used to perform some very useful functions, such as displaying data to the monitor, reading data from.
NEG Instruction Change operand content into two’s complement (negative value) and stored back into its operand mov bl, b neg bl; bl = mov.
Digital Interfacing.
University of Tehran 1 Microprocessor System Design Interrupt Omid Fatemi
ACOE2511 Assembly Language Arithmetic and Logic Instructions.
Computer Organization & Assembly Language
80x86 Instruction Set Dr. Qiang Lin.
Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 13 Direct Memory Access (DMA)
Chapter 7 Programming with DOS and BIOS Function Calls Objectives: The use of DOS and BIOS function call How to read the PC’s keyboard How to send text.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 5 Arithmetic and Logic Instructions.
Kip Irvine: Assembly Language for Intel-Based Computers
7-1 Keypad Scanning interface Used for interfacing push-button(momentary) switches Used for large number(>8) push-buttons Relies on matrix arrangement.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 4 Data Movement Instructions by.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 11 Basic I/O Interface WK 8.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 11 Basic I/O Interfacing WK 8.
Microcomputer & Interfacing Lecture 3
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 2 The Microprocessor and its Architecture.
Introduction to Computer Engineering by Richard E. Haskell Shift and Rotate Instructions Module M16.2 Section 10.3.
 Keyboards, LCDs most widely used input/output devices of the 8051  Contents to be covered:  keyboard fundamentals  key press and key detection mechanisms.
Lab 5 Part C Write to the screen a character string that uses a ‘$’ to indicate the end of the string. Do not write the ‘$’ to the screen. Use DOS Interrupt.
ORG ; FOUR INT 21H and INT 10H Programming and Macros Dec Hex Bin
Ch. 7 Logic, Shift and Rotate instr.
Input/Output Ports and Interfacing
COSC 456 Lesson 8 Cool Codes ADD AL,SIAL AL + SI ADD AL,[SI]AL AL + [SI] INC BXBX BX + 1 INC [BX]Ambiguity error INC BYTE PTR [BX][BX] [BX] + 1 INC WORD.
COMP3221: Microprocessors and Embedded Systems Lecture 18: Computer Buses and Parallel Input/Output (II) Lecturer: Hui.
ICS312 Set 9 Logic & Shift Instructions. Logic & Shift Instructions Logic and Shift Instructions can be used to change the bit values in an operand. The.
8279 KEYBOARD AND DISPLAY INTERFACING
Microprocessors Monday, Apr. 13 Dr. Asmaa Farouk Faculty of Engineering, Electrical Department, Assiut University.
1 ECE 372 – Microcontroller Design Parallel IO Ports - Inputs.
1 Logic, Shift, and Rotate Instructions Read Sections 6.2, 7.2 and 7.3 of textbook.
Keyboard interfacing.
8279 KEYBOARD AND DISPLAY INTERFACING
UNIT-IV 8255 PPI Various Modes Of Operation Interfacing To 8086.
Assembly 05. Outline Bit mapping Boolean logic (review) Bitwise logic Bit masking Bit shifting Lookup table 1.
KEYBOARD INTERFACING Keyboards are organized in a matrix of rows and columns The CPU accesses both rows and columns through ports. ƒTherefore, with two.
Alpha/Numeric Keypad Functions using AVR Preliminary Design Review Luke R. Morgan ECE /17/2008.
Lecture 12 Integer Arithmetic Assembly Language for Intel-Based Computers, 4th edition Kip R. Irvine.
Chapter 7 Bit Manipulation. 7.1 Logical Operations.
ECE 447: Lecture 12 Keypads ECE 447: Lecture 10. ECE 447: Matrix Keypad.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Bitwise and Logical Manipulations Assembly Language Programming University of Akron Dr. Tim Margush.
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
Microprocessor Systems Design I
Chapter 3 Bit Operations
Instruction System - Bit Manipulation Instruction
Machine control instruction
Assembly Language Programming Part 2
Keyboard/Display Controller INTEL 8279
9/17/2018 Kiến Trúc Máy Tính.
COMP2121: Microprocessors and Interfacing
UNIT: 2 INSTRUCTION SET OF 8086.
Engineering 4862 Microprocessors Lecture 25
Keypad Source: under under
Microprocessor Lab CSL1543 0:0:2
Shift & Rotate Instructions)
Shift & Rotate Instructions)
Decoding and Using a 4x4 Keyboard
8279 – Programmable Keyboard/Display Interface
Keypad Source: under under
Keypad Source: under under
UNIT-II Assembly Language Programs Involving Logical
Microprocessor and Assembly Language
Some Assembly (Part 2) set.html.
LCD AND KEYBOARD INTERFACING
Shift and Rotate Instructions.
Presentation transcript:

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Interfacing a 4x4 Key Matrix Row Inputs Column Outputs With no keys pressed, all row inputs are 1’s due to the pull up resistors connected to Vcc Column outputs are sequentially scanned as 0’s If key (X,Y) is pressed, it connects the scanning 0 from column X output to row Y input. If no other key is pressed on the same column, this allows the pressed key to be identified. X Y 0 2. Scan columns with one 0 to locate a pressed key O/P I/P All 0’s To check For any Press/Release

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Scan for the next key pressed and locate its column Wait for any remaining pressed keys to be Released Wait for next key to be Pressed to determine it Scan again after things have settled, and determine coordinates (row, column) of pressed key Software Debounce Of Switch Release Software Debounce Of Switch Press Use key position determined To get its corresponding Code stored in a lookup table In memory  Still Here, column is known row Determine row of key pressed (look for 0 bit in read data) into CF Read Input Pattern

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e ;assembly language version; ;KEY scans the keyboard and returns the key code in AL. COLSEQU4 ROWSEQU4 PORTAEQU50H PORTBEQU51H KEYPROCNEAR USES CX BX MOV BL,FFH;compute row mask SHL BL,ROWS MOV AL,0 OUT PORTB,AL ;place all zeros on Port B.REPEAT;wait for release.REPEAT CALL SCAN.UNTIL ZERO? CALL DELAY10; Release debounce CALL SCAN.UNTIL ZERO?.REPEAT;wait for key press (to be determined).REPEAT CALL SCAN.UNTIL !ZERO?; (not zero, i.e. not = FF) CALL DELAY10; Press debounce CALL SCAN, scan again after things have settled.UNTIL !ZERO? MOV CX,00FEH.WHILE 1;find column MOV AL,CL OUT PORTB,AL CALL SHORTDELAY;Wait till data outputted to PortB have settled! CALL SCAN.BREAK !ZERO?;Key found at this column- Quit WHILE1! ADD CH,COLS;Key not found at this row- move on to next row – add COLS to CH ROL CL,1 ; AL = on 2 nd trial.ENDW.WHILE 1;find row from pattern Read into PortA in SCAN SHR AL,1.BREAK.IF !CARRY? ; LSB of AL is shifted into the carry flag by SHR! So we stop on 1 st zero bit INC CH ; for each shift until row is found.ENDW MOV AL,CH ;get key code into AL: AL = CH = (COLS) X + Y = 4 X + Y; X = 0, 1,..,3, Y = 0, 1,.., 3 RET KEYENDP SCANPROCNEAR IN AL,PORTA;read rows OR AL,BL CMP AL,0FFH;test for no keys RET SCANENDP Program the 8255 for: Port A: Input Port B: Output Size in ROWS, COLS can be set, up to 8 x 8, here 4 X 4 BL = F0, for rows = 4 Mask for Oring in SCAN BL: = F0H AL: XXXX1111 (No Keys Pressed) Oring: = FF Keep calling SCAN Until FF (no key pressed) i.e. wait for key release Keep calling SCAN Until (Not FF) (a key pressed) i.e. wait for key stroke Determine X,Y of Pressed Key as Number In CH  AL AL = st Column (for a key pressed on row 3) After SCAN: AL = XXXX1011 Column # Row # AL from SCAN ASCII? ZERO: No Pressed !ZERO: Pressed SHR into Carry X (Column) Y (row)