VTech Alphabert s Magic Readport User Manual Page 32

  • Download
  • Add to my manuals
  • Print
  • Page
    / 80
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 31
Lab Manual of Microcontroller & Interfacing Page 32
INC DPTR
AJMP next ; Next digit
DELAY: MOV R7,#22h
L3: MOV R6,#0FFh
L2: MOV R5,#0FFh
L1: DJNZ R5,L1
DJNZ R6,L2
DJNZ R7,L3
RET
CODE: db 0C0h,0F9h,0A4h,0B0h,99h,92h,82h,0F8h,80h,90h,00h,
END
Program 2: Interface DIP Switch with port P2 (P2.0 to P2.3). Write a program to read status
of the switch and display its HEX value on the seven segment display connected
at port P1.
Circuit diagram:
Program:
start: ORG 00h
AJMP start
ORG 03h
RETI
MOV P1,#00h ;Configure port 1 as output port
MOV P2,#0FFh ;Configure port 2 as input port
again: MOV DPTR,#CODE ;Initialize DPTR as a base address for code
MOV A,P2 ;Read status of the switch
Page view 31
1 2 ... 27 28 29 30 31 32 33 34 35 36 37 ... 79 80

Comments to this Manuals

No comments