Decrementing packed BCD question

Thread Starter

RG23

Joined Dec 6, 2010
304
I am trying to implement a decrement counter for the seconds register
It works quite fine.

But I have the following issue.
When I am in the edit mode my seconds value should keep blinking on LCD
It works fine for all other values except 00

When the value 00 should keep blinking somehow '5A' blinks in place of 00

If anyone has an idea please let me know.

Thanks


label921:

movlw 0x01
subwf SECS1,0
btfss STATUS,DC
addlw -0x06
movwf SECS1
movlw 0xC6/////////position on display
movwf PORTD
call SND_CMD//////////send command to LCD
movf SECS1,0
call writebcd//////display data on LCD
movf SECS1,0
btfsc ZERO
call label_S0
return

label_S0:
movlw 0x00
movwf SECS1
movlw 0xC6
movwf PORTD
call SND_CMD
movf SECS1,0
call writebcd//////display data on LCD

movlw h'5A'
movwf SECS1
return
 

Markd77

Joined Sep 7, 2009
2,806
It looks like if 5A is in SECS1 then the first part will display that, then straight afterwards the second part will send 0 to the display. If you put the check for zero earlier in the first part so that it skips over sending 5A to the display, will that fix it?
 
Top