Here is the coding for my count up in the two seven segments. It’s working perfectly.
(Data lookup table starting from retlw 0 to 9)
Here is the coding for my count down in the two seven segments. But this is not working.
All the time it’s showing “99” (Data lookup table starting from retlw 9 to 0)
Can somebody tell what’s wrong with countdown?
(Data lookup table starting from retlw 0 to 9)
Code:
COUNTUP incf DIGIT1,1 ;increase digit1
movlw 0AH ;check whether it has reach ten
xorwf DIGIT1,w ;compare
btfss STATUS,Z
goto MULTIPLEX
clrf DIGIT1
incf DIGIT2,1 ;increase digit2
movlw 0AH ;check whether it has reach ten
xorwf DIGIT2,w ;compare
btfsc STATUS,Z
clrf DIGIT2
goto MULTIPLEX
Here is the coding for my count down in the two seven segments. But this is not working.
All the time it’s showing “99” (Data lookup table starting from retlw 9 to 0)
Code:
COUNTUP decf DIGIT1,1 ;decrease digit1
movlw 00H ;check whether it has reach zero
xorwf DIGIT1,w ;compare
btfss STATUS,Z
goto MULTIPLEX
clrf DIGIT1
decf DIGIT2,1 ;decrease digit2
movlw 00H ;check whether it has reach zero
xorwf DIGIT2,w ;compare
btfsc STATUS,Z
clrf DIGIT2
goto MULTIPLEX
Can somebody tell what’s wrong with countdown?