Hi.
Im working on a datalogger project that needs to take a reading every exactly 1 second. I want to make TMR1 interrupt every 10 ms, so that every 100 TMR1 interrupts, I get exaclty one second. This is the routine I got to write. I have not tested yet in a PIC, because I run out of them after burning to of them because of wrong polarity . LOL. By the way, I am using 16F877A. This is the code.

/////////////////////////////////////////////////

INT:
@ BCF T1CON,0 'STOP TIMER1
@ MOVLW 0xC3 'LOAD WITH 65527 BECAUSE
@ MOVWF TMR1H '50000 (20MHz / 4 / 100) - 2 CYCLES
'TO ENTER INT
@ MOVLW 0x48 '- 6 CYCLES TO LOAD THE REGISTERS, AND
@ MOVLW TMR1L 'TURN IT ON AGAIN
@ BSF T1CON,0 'TURN TIMER1 ON AGAIN

X = X + 1 'INCREMENT REG
PIR1.0 = 0 'CLEAR INT FLAG
CONTEXT RESTORE 'RESTORE REGs AND RETFIE

/////////////////////////////////////////////////

Can you please tell me if its OK??? Thanks for your help, and sorry for my english. Manuel