Ok, let me have a go first with TMR1 of pic 16F877:
TMR1H:TMR1L = TMR1:0x0000 -> 0xFFFF
Each round of TMR1: 0xFFFF = 65535 instructions = 65.5 msec
If I take a prescaler of 1:16, the result would be: 65.5 * 16 = 1048 msec
which means 1.048 sec.
This is close enough to 1 sec.
However I could not find a prescaler register for this TMR1.
I dont know, maybe we dont have prescaler for TMR1 like TMR0. :roll:
So I think just loop the TMR1 for 16 times:
movlw d'16'
movwf counter ; counter of 16 times
ISR ; when TMR1 overflows
decf counter
movfw counter
xorlw d'0'
btfss status, z ; if z = 1, counter = 0 , skip
call reset_timer
call TurnOnLED
retfie
Wow, this code seems too complex. Please correct me if I am incorrect. Thanks again