This will do what you require.
I've added the bit in blue. By altering the delay values (1000 & 7000) you should be able to find a compromise between drawing enough current and the pic not getting too warm.
Mike.
Code:
Display swapf PORTA,W ; W = hi nybble in b3..b0 bits |B0
btfss DigSel,7 ; left digit? yes, skip, else |B0
movf PORTA,W ; W = lo nybble in b3..b0 bits |B0
andlw b'00001111' ; mask off upper 4 bits |B0
call SegData ; get segment data in W |B0
iorwf DigSel,W ; add digit select bit in b7 |B0
movwf PORTB ; display new digit |B0
DelayUS(7000-23) ; 8-msecs including loop time |B0
; ^ changed so total loop time is the same.
[COLOR="Blue"] clrf PORTA ;clear the output latches
bsf STATUS,RP0 ;bank 1
clrf TRISA ;make port A output
bcf STATUS,RP0 ;bank 0
DelayUS(1000) ;pause
bsf STATUS,RP0 ;bank 1
movlw 0xff
movwf TRISA ;make port A input
bcf STATUS,RP0 ;bank 0[/COLOR]
movlw b'10000000' ; mask for digit select bit |B0
xorwf DigSel,F ; toggle b7 digit select bit |B0
goto Display ; loop forever |B0
I've added the bit in blue. By altering the delay values (1000 & 7000) you should be able to find a compromise between drawing enough current and the pic not getting too warm.
Mike.