START
call ReadADC ; Read RA0 and convert to decimal
movf Hund,w ; Get Hund Result
call Table ; get segment data
w1 btfss TMR0,2 ; ~1-ms interval? yes, skip, else
goto w1 ; loop (wait)
clrf TMR0 ; reset TMR0
bcf PORTA,4 ; display 3 OFF (blank display)
movwf PORTB ; to PORTB
bsf PORTA,2 ; display 1 ON
movf Tens,W ; Get Tens Result
call Table ; get segment data
w2 btfss TMR0,2 ; ~1-ms interval? yes, skip, else
goto w2 ; loop (wait)
clrf TMR0 ; reset TMR0
bcf PORTA,2 ; display 1 OFF
movwf PORTB ; to PORTB
bsf PORTA,3 ; display 2 ON
movf Ones,w ; Get Ones Result
call Table ; get segment data
w3 btfss TMR0,2 ; ~1-ms interval? yes, skip, else
goto w3 ; loop (wait)
clrf TMR0 ; reset TMR0
bcf PORTA,3 ; display 2 OFF
movwf PORTB ; to PORTB
bsf PORTA,4 ; display 3 ON
goto START ;
;