Presentation is loading. Please wait.

Presentation is loading. Please wait.

BIRLA VISHVAKARMA MAHAVIDYALAYA TOPIC : Keyboard interfacing and flowchart MADE BY: Nidhi Bhangale (130080112010) Gargi Patel (130080112039) Meghna Rathod.

Similar presentations


Presentation on theme: "BIRLA VISHVAKARMA MAHAVIDYALAYA TOPIC : Keyboard interfacing and flowchart MADE BY: Nidhi Bhangale (130080112010) Gargi Patel (130080112039) Meghna Rathod."— Presentation transcript:

1 BIRLA VISHVAKARMA MAHAVIDYALAYA TOPIC : Keyboard interfacing and flowchart MADE BY: Nidhi Bhangale (130080112010) Gargi Patel (130080112039) Meghna Rathod (130080112042) GUIDED BY: PROF. HIREN PATEL

2 INTRODUCTION Keyboards are part of HMI and plays an important role in a small embedded system where human interaction is needed. Used in many circuits for entering data or characters. Used as an input device to provide input from outside world to the microcontroller. Makes an application more users interactive.

3 Interfacing is connection between parts of software. This concept of interfacing a keyboard with AVR is similar as interfacing it with any other microcontroller.

4 Why we use matrix keyboard? Simple architecture Ease of interfacing with any microcontroller Connect more keys to a microcontroller

5 If we directly interface 16 switches with a microcontroller it requires 16 pins and if we connect those 16 switches in form of a matrix then only 8 pins are required. So it reduces the number of required pins. There is a key between each overlapping row and column line.

6 SCANNING AND IDENTIFYING THE KEY Figure shows a 4 * 4 matrix to two ports. The rows are connected to an output port that is port 0(P0)and the columns are connected to an input port that is port 1(P1). If no key has been pressed the input port is connected to high(Vcc).

7 If all rows are grounded and a key is pressed, one of the columns will have 0 since the key pressed provides the path to grounded. The function of microcontroller is to scan the keyboard continuously to detect and identifying the key pressed.

8 Grounding rows and identifying the columns To detect a pressed key, the microcontroller grounds all rows by providing 0 to the output, and then it reads the columns. If the data read from the columns is D3-D0=1111, no key has been pressed and the process continues until a key press is detected. If one of the column bits has a zero, this means that a key press is occurred. For example, if D3-D0=1101,this means that a key in the D1 column has been pressed. After key press is detected, the microcontroller will go through the process of identifying the key.

9 EXAMPLE : From the figure identifying the rows and column of the pressed key for each: 1.D3-D0=1110 for the row,D3- D0=1011 for the column: The row belongs to D0 and the column belongs to D2; therefore, key number 2 was pressed. 2.D3-D0=1101 for the row,D3- D0=0111 for the column: The row belongs to D1 and the column belongs to D3;therefore, key number 7 was pressed.

10 Flow chart of keyboard interfacing

11 Start Ground all rows Read all columns All keys open? Read all columns Any key down? Wait for debounce Read all columns Any key down? 1 1 Ground next rows Read all columns Key press in this row? Get scan code from table Return Find which key is pressed Yes No Yes No

12 Debounce After the key press detection, the microcontroller waits 20ms for the bounce and then scans the column again. This serves two functions:(a) It ensures that the first key press detection was not an erroneous one due to it spike noise, and (b) the 20-ms delay prevents the same key press from being interpreted as a multiple key press. vcc GND unstable unstable

13


Download ppt "BIRLA VISHVAKARMA MAHAVIDYALAYA TOPIC : Keyboard interfacing and flowchart MADE BY: Nidhi Bhangale (130080112010) Gargi Patel (130080112039) Meghna Rathod."

Similar presentations


Ads by Google