I cant get my head around timers at all. Tryin to get an accurate clock which will increment every 0.01 (10ms) Using a 4Mhz crystal with a pic16f77 and trying to set up the Timer1 module. so far ive got

countertotal var word
countertotal.Lowbyte = TMR1L
countertotal.highbyte = TMR1H

TMR1Preset con $D8F1


DEFINE OSC 4
'================================================= =============================
'Setting LCD parameters
'================================================= =============================

DEFINE LCD_DREG PORTD 'sets LCD data port
DEFINE LCD_DBIT 4 'sets starting bit
DEFINE LCD_RSREG PORTD 'sets LCD register select port
DEFINE LCD_RSBIT 0 'sets LCD register select bit
DEFINE LCD_EREG PORTD 'sets LCD enable port
DEFINE LCD_EBIT 1 'sets LCD enable bit
DEFINE LCD_BITS 4 'sets LCD bus size (4 bits)
DEFINE LCD_LINES 2 'sets number of lines on the LCD display

'Tie R/W pin to oV since the LCDIN will not be used.

DEFINE LCD_COMMANDUS 2000 'sets command delay time in us
DEFINE LCD_DATAUS 50 'sets data delay time in us

'================================================= =============================
'Initialisation of PORT's
'================================================= =============================

TRISA=%00000000 'bits 0 and 1 need to be outputs for RS and E on LCD
TRISB=%11111000
TRISC=%00000000
TRISD=%00000000 'set to outputs to drive the LCD

OPTION_REG.7=0 'Enable Pull-Up's on PORTB

ADCON1 = $07

T1CON = %00000000 'bits 6 & 7 are unimplemented
'bits 4 & 5 set the prescale value to 1:1
'bit 3 shuts off oscillator
'bit 2 is set to 0 to put tmr1 into timer mode - 0 is counter mode
'bit 1 is set to 0 for internal clock1
'bit 0 is set to 0 in order to stop the clock - 1 enables the timer

PIE1.0 = 1 'enables the tmr1 overflow interrupt
PIR1.0 = 0 'resets tmr1 interrupt flag
INTCON.6 = 1 'enables all unmasked peripheral interrupts
INTCON.7 = 1 'enables all unmasked global interrupts

'================================================= =============================
'Main Program
'================================================= =============================

pause 500 'initialise LCD

LCDOUT $FE, 1, "Hello"
LCDOUT $FE, $C0, "World"

pause 2000 'displays the above for 5 seconds



TMR1H = $D8
TMR1L = $F1






waitforstart:
if PORTB.5 = 0 then
T1CON.0 = 1 'starts timer
LCDOUT $FE, 1, "Timer started"
goto loop
else
goto waitforstart
endif

loop:

ticker var byte
if PIR1.0 = 1 then
PIR1.0 = 0
ticker = ticker + 1
endif

LCDout $FE, $C0,Dec5 ticker


goto loop

end.

I believe that you need to preset the timer and using mister_e calculator it seems to want to be preloaded with 55537 (D8F1 hex)

It does count up, but nowhere near every 10ms

Any ideas?