Hi Peter,
Looks like you're reloading timer1 before it can over-flow (not sure without knowing the osc speed), but try something like this.
Code:
PRESET VAR WORD
ELAPSED VAR BYTE
PRESET = 12000
T1CON=%00110000 ' Set timer1 prescaler as 1:8
PIR1.0=0 ' Clear timer1 overflow flag
PIE1=%00000001 ' Enable interrupt on timer1 overflow
TMR1H=PRESET.highbyte ' Load timer1 high byte
TMR1L=PRESET.Lowbyte ' Load timer1 low byte
T1CON.0=1 ' Turm on timer1
INTCON=%11000000 ' Global & peripheral interrupts enabled
ON INTERRUPT goto TICKER
MAINLOOP:
TOGGLE PORTB.5
ELAPSED = ELAPSED + 1
GOTO MAINLOOP
DISABLE
TICKER:
TOGGLE PORTB.0 ' Toggle PORTB.0
TMR1H = PRESET.highbyte ' Load timer1 high byte
TMR1L = PRESET.Lowbyte ' Load timer1 low byte
PIR1.0=0 ' Clear TMR1 overflow flag
RESUME
ENABLE
END
HTH....;o}
Bookmarks