Hi guys I have this 10 bit BCD routine its working well.
The problem is the brightness of 4 digitis is varying. It means from the AD value 256, 512, and 768 the brightness is varying.
Ex: If the AD result is 400 it put 256 to the display & decrementing other remaining 8 bits all the time. When the remaining value gets bigger the brightness falls off.
Does anybody give me a clue to show a fix brightness level?
The problem is the brightness of 4 digitis is varying. It means from the AD value 256, 512, and 768 the brightness is varying.
Ex: If the AD result is 400 it put 256 to the display & decrementing other remaining 8 bits all the time. When the remaining value gets bigger the brightness falls off.
Does anybody give me a clue to show a fix brightness level?
Code:
clrf D1 ;One segment digit1
clrf D2 ;Ten segment digit2
clrf D3 ;Hundred segment digit3
clrf D4 ;Thousand segment digit4
btfss ADH,1
goto __256
btfss ADH,0
goto __512
movlw .7 ;move 768
movwf D3
movlw .6
movwf D2
movlw .8
movwf D1
goto Trans
__512 movlw .5 ;move 512
movwf D3
movlw .1
movwf D2
movlw .2
movwf D1
goto Trans
__256 btfss ADH,0
goto Trans ;move 256
movlw .2
movwf D3
movlw .5
movwf D2
movlw .6
movwf D1
goto Trans
Trans movf ADL,W
xorlw 00h
btfsc STATUS,Z
return
call Incr
decfsz ADL,F ;decrementing the lower8 bits
goto $-2
return
Last edited: