|
On my clock, I hard wired the decimal point of the second digit to zero volts via a 180 ohm resistor, which is the simplest solution. However, we missed this when we moved the display into a different section. To make the change is software, change the table so that the decimal point is normally out.
RETLW 0x81 ;Zero
RETLW 0xD7 ;One
RETLW 0xA2 ;Two
RETLW 0x92 ;Three
RETLW 0xD4 ;Four
RETLW 0x98 ;Five
RETLW 0x88 ;Six
RETLW 0xD3 ;Seven
RETLW 0x80 ;Eight
RETLW 0xD0 ;Nine
RETLW 0x8F ;10 = "U"
RETLW 0xAC ;11 = "T"
RETLW 0xAE ;12 = "C"
Then, change the display code by adding the code in bold so that the decimal point is lit on the second character:
;Update Display
TICK MOVLW 0xFF
MOVWF PORTB ;Clear Display
MOVF DIGIT, W ;Update PortA
ADDLW 0x04
ANDLW 0x1C
MOVWF DIGIT
MOVWF PORTA
INCF CHAR, W ;Update character
ANDLW 0x07
MOVWF CHAR
ADDLW 0x10
MOVWF FSR
MOVF INDR, W ;Get char
ANDLW 0x0F
CALL TABLE ;Returns with display in W
MOVWF 0x21 ;STORE RESULTS IN TEMPORARY REGISTER
MOVF CHAR, W ;MOVE OFFSET TO W
XORLW 0x01 ;IS IT SECOND DIGIT
BTFSS STATUS,2 ;CHECK ZERO BIT
GOTO OK ;NOT THIS DIGIT
MOVLW 0x80 ;THIS DIGIT SO SWITCH ON DOT
SUBWF 0x21, 1
OK MOVF 0x21, 0 ;GET CHARACTER TO DISPLAY
MOVWF PORTB
MOVLW 0xC9
MOVWF DELAY
LOOP1 DECFSZ DELAY, F
GOTO LOOP1
Note that this will take some additional time and therefore the delay loops will also need to be modified.
|