Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Keyboard Interfacing with 8051 microcontroller

11,724 views

Published on

Keyboard Interfacing with 8051 microcontroller

Published in: Engineering
  • Be the first to comment

Keyboard Interfacing with 8051 microcontroller

  1. 1. CONTENTS: 1.Introduction 2.Working principle 3. Components required 4. Programming for AT89C51 microcontroller 5. Application 6.Results and future implementations.
  2. 2. Keyboard is one of the best input device now a days. From very ancient time keyboard was used to get proper input in the machine. Interfacing microcontroller with keyboard makes it faultless and make input rate faster. Whether the input is any numeric or any alphabet microcontroller breaks those input into hex code and with the help of lookup table and proper programming language it helps to give a prompt input from the users. Introduction
  3. 3.  1.Christopher Latham Sholes invented the modern QWERTY keyboard in the 1870s  2.Herman Hollerith developed the first keypunch devices  3.In the 1930's electric typewriters were invented.  4.In 1936, August Dvorak patented a new layout to Dvorak keyboard.  5.Personal Computers keyboard in 1970's  6.XPeRT is a keyboard Built in 2003 for Speed ..... AND ...... easy transition from Qwerty. 05/23/15 History
  4. 4. About Our Work  1.Matrix keypads are well known for their simple architecture.  2.Interfacing a hex keypad to 8051 microcontroller. To build this project we use Hex keypad, a 8051 microcontroller, display it in 7 segment display.  3.Here we are using AT89C51.we can also use any number of seven segment display or LCD module where encoder and multiplexer is required.  designing of the basic keyboard. 05/23/15
  5. 5. Hex keypad 1.Hex keypad,16 key-from 0 to 9 and A to F 2.Matrix form is required to reduce the pin count in microcontroller. Row Column Construction of Hexkeypad
  6. 6. To Detect A Key Two Approaches 1.column scanning 2.row scanning We are using column scanning.  Making each row 1 and others 0 and then scan the each column If any switch pressed corresponding column's sense value is 0 The pressed switch make the corresponding column and row shorted. Tow scanning is just the opposite of the column scanning technique.
  7. 7. Whole Arrangement
  8. 8. Components Required AT89C51 Microcontroller:- 8-bit CPU 4 KB of on-chip program memory 128 bytes of on-chip data RAM Four ports of eight bits each Two 16-bit timers Full duplex serial port On-chip clock oscillator
  9. 9. The 7-segment Display:- Common cathode diodes require positive voltage Common anode diodes require negative voltage Both works in forward bias Programming should be done according to the diode we use in display.
  10. 10. Components:- 1.17 piece tact switch 2.eight 330 ohm registers 3.one 8.2 KΩ register 4.11.0592 crystal oscillator. 5.33 pf capacitor. 6.10 mf capacitor. 7.5 volt power supply. Use:- 1. 16 tact switch and 1 for reset 2. Control the current in seven segment display 3. Use to create the time constant with capacitor 4. Use to create the clock 5. Use in clock generation 6. For time constant purpose 7. To give life to the arrangement Other Components
  11. 11. 05/23/15 ORG 00H MOV DPTR,#LUT // moves starting address of LUT to DPTR MOV A,#11111111B // loads A with all 1's MOV P0,#00000000B // initializes P0 as output port BACK:MOV P1,#11111111B // loads P1 with all 1's CLR P1.0 // makes row 1 low JB P1.4,NEXT1 // checks whether column 1 is low and jumps to NEXT1 if not Program
  12. 12. MOV A,#0D // loads a with 0D if column is low (that means key 1 is pressed) ACALL DISPLAY // calls DISPLAY subroutine NEXT1:JB P1.5,NEXT2 // checks whether column 2 is low and so on... MOV A,#1D ACALL DISPLAY NEXT2:JB P1.6,NEXT3 MOV A,#2D ACALL DISPLAY NEXT3:JB P1.7,NEXT4 MOV A,#3D ACALL DISPLAY NEXT4:SETB P1.0 CLR P1.1 JB P1.4,NEXT5 MOV A,#4D ACALL DISPLAY
  13. 13. NEXT5:JB P1.5,NEXT6 MOV A,#5D ACALL DISPLAY NEXT6:JB P1.6,NEXT7 MOV A,#6D ACALL DISPLAY NEXT7:JB P1.7,NEXT8 MOV A,#7D ACALL DISPLAY NEXT8:SETB P1.1 CLR P1.2 JB P1.4,NEXT9 MOV A,#8D ACALL DISPLAY NEXT9:JB P1.5,NEXT10 MOV A,#9D ACALL DISPLAY NEXT10:JB P1.6,NEXT11 MOV A,#10D ACALL DISPLAY NEXT11:JB P1.7,NEXT12
  14. 14. 05/23/15 MOV A,#11D ACALL DISPLAY NEXT12:SETB P1.2 CLR P1.3 JB P1.4,NEXT13 MOV A,#12D ACALL DISPLAY NEXT13:JB P1.5,NEXT14 MOV A,#13D ACALL DISPLAY NEXT14:JB P1.6,NEXT15 MOV A,#14D ACALL DISPLAY NEXT15:JB P1.7,BACK MOV A,#15D ACALL DISPLAY LJMP BACK DISPLAY:MOVC A,@A+DPTR // gets digit drive pattern for the current key from LUT MOV P0,A // puts corresponding digit drive pattern into P0 RET
  15. 15. 05/23/15 LUT: DB 01100000B // Look up table starts here DB 11011010B DB 11110010B DB 11101110B DB 01100110B DB 10110110B DB 10111110B DB 00111110B DB 11100000B DB 11111110B DB 11110110B DB 10011100B DB 10011110B DB 11111100B DB 10001110B DB 01111010B END
  16. 16. 05/23/15 Main Problem Debouncing Problem: Switch contacts do not come to rest immediately after pressing. Processor sense multible key press due to multiple pulse generation. A human can not press and release a key in less than 20 ms. Debouncing problem solution: Hardware Approach Software Approach
  17. 17. 05/23/15 Other Problems We Faced  The voltage directly goes to the seven segment display.  The voltage in the two legs of crystal oscillator is totally different from the college kit.  Soldering is not up to the mark according to mriganka sir.  We burn the seven segment display twice giving 5v directly to it.  Burned the program in different pin in the microcontroller.  We tried lots of coding or program for the hexkeypad.
  18. 18. Result & Future Work Basic Calculator: Here we can use LCD module instead of seven segment display. Here we can perform and display various operations like addition, substraction, multiplication and division.
  19. 19. 05/23/15 Multiple Display Device: Here we can use multiple seven segment display. It can be used to display 2-digit numbers.
  20. 20. Projection keyboards That brings us to the similar but significantly older idea of projection keyboards, which do exactly that: project a virtual keyboard onto a surface and track your finger movements as you type. Depending on configuration, projection keyboards typically use a combination of lasers, sensors, and infrared beams to replicate a traditional QWERTY keyboard on a flat surface. The idea is to optimize portability by providing a full-size keyboard for mobile devices, while at the same time eliminating the pesky tradition of, you know, physical matter. (You can get projection pianos too, by the way.) It's all well and good, and the technology is improving every year. But surely we can all agree that the concept reached its zenith with the frankly awesome R2-D2 Virtual Keyboard.
  21. 21. THANK YOU

×