VTech Alphabert s Magic Readport User Manual Page 55

  • Download
  • Add to my manuals
  • Print
  • Page
    / 80
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 54
BM Dept., Govt. Engg. College, Gandhinagar Page 55
EXPERIMENT NO. 13
AIM: Interface matrix keyboard with 8051. Write program to display key pressed on seven
segment display.
Circuit Diagram:
Interfacing details:
Rows of matrix keyboard are connected to port pins P1.0 to P1.3
Columns of matrix keyboard are connected to port pins P2.0 to P2.3
Common anode seven segment display is connected to port P0
LEDs are connected to port P1.7 to P1.4 and P2.4 to P2.7. These LEDs may be used to
indicate which row is scanned and which column is read by the program. It may be used
to indicate which key is pressed at present.
Program:
; Program to interface matrix keyboard 4x4. Rows are connected to the Port pins
; P1.0-P1.3 & Columns are connected to Port pins P2.0-P2.3. Rows are grounded
; one by one and read columns
; Seven segment display is connected at port P0
ORG 00h
AJMP START
ORG 13h
RETI
START:
MOV P0,#00h
MOV P2,#0FH ; Port Pins P2.0 to P2.3 i/p pins and P2.4 to P2.7 o/p pins
MOV P1,#00H ;Port P0 output port
REL: MOV P1,#00H ; Make All Rows Ground To Check All Keys
MOV A,P2 ;Read Port P2 To Ensure That All Keys Released
Page view 54
1 2 ... 50 51 52 53 54 55 56 57 58 59 60 ... 79 80

Comments to this Manuals

No comments