cricket over counting display

Status
Not open for further replies.

harishwww

Member level 3
Joined
Aug 12, 2010
Messages
57
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,696
dear sir
i am doing over counting digital display using 89c51 micro i tried a lot to do for 99.6 overs but the code worked for only 9.6 overs how to make 99.6 overs
port 1 is for hundred display
port 0 is for tens
port 2 is for units
how to adjust my code to this i tried alot

ORG 00H
START: MOV DPTR,#TABLE ;Set the first address segment code table
MOV R0,#00H ;R0 keep count
MOV P0,#00H
MOV P2,#00H ;Digital Display initialization
MOV p1,#00H

S1: INC R0 ;Plus 1 count
CJNE R0,#60,S2 ;Determine whether the maximum count

MOV R0,#00H



S2: JB P3.7,$ ;Wait for button
LCALL DELAY
JB P3.7,S2 ;Remove button jitter


S3: MOV A,R0
MOV B,#006
DIV AB ;Separate count of ten and a bit

MOVC A,@A+DPTR ;Were taken 10 and a bit of the segment code and

display:
MOV P0,A

MOV A,B
MOVC A,@A+DPTR
MOV P2,A

JB P3.7,S1 ;Wait for the lift button
LJMP S3




DELAY: MOV R5,#001 ;10 ms delay
D1: MOV R6,#250
DJNZ R6,$
DJNZ R5,D1
RET

TABLE: DB 3FH,06H,5BH,4FH,66H
DB 6DH,7DH,07H,7FH,6FH
END
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…