Hi I have a small code problem in my 4 digit SSD circuit.
When I power up it shows 0000 & check every time the RB7 has press.
If it presses then the CURSOR (G segment) is moving to DIGIT1.
When I press RB7 again the CURSOR moves to DIGIT2 using RLF & continues.
My problem is when the CURSOR register comes to 5th bit (btfss Cursor,5) it wont go to the count routine it goes to the Keychk routine so I cannot continue to start counting.
Somebody please help me to solve this problem
When I power up it shows 0000 & check every time the RB7 has press.
If it presses then the CURSOR (G segment) is moving to DIGIT1.
When I press RB7 again the CURSOR moves to DIGIT2 using RLF & continues.
My problem is when the CURSOR register comes to 5th bit (btfss Cursor,5) it wont go to the count routine it goes to the Keychk routine so I cannot continue to start counting.
Somebody please help me to solve this problem
Code:
Scan ---- ;contains multiplexing stuff
----
return
Count ---- ;increment digits
----
Keychk ---- ;checks the four buttons
----
goto main
Main call Scan
moclw b'01111110' ;make portb,7 low
movwf PORTB
call SmallDel ;small delay to settle
btfsc PORTB,7 ;check the RB7 press or not?
goto Keychk ;no then goto keycheck
bcf STATUS,C ;yes then clear the carry bit
rlf CURSOR,f ;move cursor to left by one
btfss CURSOR,5 ;has the 5th bit cursor set?
goto Loop1 ;no then goto loop1
clrf Cursor ;yes 5th bit is set then -
goto Count ;- goto count routine
Loop1 call Scan
btfss PORTB,7 ;check the RB7 has released?
goto Loop1
goto Keychk