Independent keyboard to realize counting function program (assembly)

Publisher:快乐旅行Latest update time:2016-09-13 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Independent keyboard to achieve counting function program (assembly) - gududesiling - suixin

//This program function is: manual counter, when the button is pressed, the count is increased by one, and the LCD displays once (the result of the increase).
//Source program and proteus download address: http://proteus.5d6d.com/thread-9003-1-1.html
             ORG 0000H
             LJMP START

             ORG 0030H
START: MOV DPTR,#TABLE ; Set the first address of the segment code
             MOV R0,#00H ; Store the initial value of the count in R0
             MOV P0,#3FH
             MOV P2,#3FH ; When reset, the digital tube displays 0

S1: INC R0
             CJNE R0,#100,S2
             MOV R0,#00H

S2: JB P3.3,$ ; Wait for the button
              LCALL DELAY ; Eliminate jitter delay
             JB P3.3,S2

S3: MOV A,R0
               MOV B,#10
              DIV AB ; Separate the ones and tens of the count value
              MOVC A,@A+DPTR
               MOV P0,A
               MOV A,B
               MOVC A,@A+DPTR
               MOV P2,A
               JB P3.3,S1 ; Wait for the key to pick up
               LJMP S3

DELAY: MOV R5,#20H ; Delay 10ms
D1: MOV R6,#250
              DJNZ R6,$
              DJNZ R5,D1
              RET

TABLE: DB 3FH,06H,5BH,4FH,66H; 0-9 seven-segment code value
             DB 6DH,7DH,07H,7FH,6FH

             END

Reference address:Independent keyboard to realize counting function program (assembly)

Previous article:Nested assembly method in C51
Next article:8*8 dot matrix display program (assembly)

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号