I have a 4 digit multiplex routine as below. But the digit4 (the last digit) brightness is low. Because I’m not scanning all four digits equally. Its like this
Ex:
*when Dselect bit = 3 it must show all four digits.
*when Dselect bit = 2 it must show the first three digits.
*when Dselect bit = 1 it must show the first two digits.
*when Dselect bit = clear it must show the first digit.
Any method to solve this.
Ex:
*when Dselect bit = 3 it must show all four digits.
*when Dselect bit = 2 it must show the first three digits.
*when Dselect bit = 1 it must show the first two digits.
*when Dselect bit = clear it must show the first digit.
Any method to solve this.
Code:
Mulpx clrf PORTB
clrf PORTA
btfsc Dselect,1 ;if Dselect bit = 1
call One ;Show only digit 0 & 1
btfsc Dselect,2 ;if Dselect bit = 2
call Two ;Show only digit 0 & 1 & 2
btfsc Dselect,3 ;if Dselect bit = 3
call Three ;Show only digit 0 & 1 & 2 & 3
btfss Dselect,0 ;if Dselect bit = 0
call Zero ;show only 0 digit
goto Mulpx
Three movlw b'00001000' ;enable digit3
movwf PORTA
movf Digit3,W
call Table
movwf PORTB
call Delay
Two movlw b'00000100' ;enable digit2
movwf PORTA
movf Digit2,W
call Table
movwf PORTB
call Delay
One movlw b'00000010' ;enable digit1
movwf PORTA
movf Digit1,W
call Table
movwf PORTB
call Delay
Zero movlw b'00000001' ;enable digit0
movwf PORTA
movf Digit0,W
call Table
movwf PORTB
call Delay
return
Last edited: