Yes, here is a quick code example:
FastLoop:
IF PIR1.0 = 1 THEN
PIR1.0 = 0
TMR1H = TimerPreloadValue.Highbyte
TMR1L = TimerPreloadValue.Lowbyte
GOSUB MainProgram
ENDIF
IF PIR1.5 = 1 THEN
Gosub KeyboardInputRoutine ' HSERIN clears PIR1.5
ENDIF
GOTO FastLoop
MainProgram:
'Do something here every time the timer rolls over
RETURN
' This works perfectly as long as your 'Main Program' never takes as long as the timer period. The code sits in the FastLoop waiting for either a keyboard input or a timer timeout. When the timer timeout occurs, then the MainProgram is executed. If you output data in your MainProgram, that data will be output at a regular interval regarless of the length of your program.
Just remember - stay away from PAUSEs in your main program whenever possible!
Bookmarks