neuralc
Full Member level 4

Hi all,
I need to build a clock using 16F870, and I'm using HTPICC. The only interrupt that I use is Timer1, and in the interrupt function in C I set the content of TMR1L and TMR1H.
The problems is, if I put a breakpoint at the end of the interrupt function, and I simulate it in MPLAB I get different values of time from interrupt to interrupt... and I think that is because at 0x0004 HTPICC put some interrupt recovery info, and that code depends on the place where interrupt occurs, so in each interrupt it can execute different number of instructions and give different times in the interrupt function.
I think the solution is to put the set of TMR1L and TMR1H on position 0x0004 of the program, but how can I do this?
ThX
NeuralC
I need to build a clock using 16F870, and I'm using HTPICC. The only interrupt that I use is Timer1, and in the interrupt function in C I set the content of TMR1L and TMR1H.
The problems is, if I put a breakpoint at the end of the interrupt function, and I simulate it in MPLAB I get different values of time from interrupt to interrupt... and I think that is because at 0x0004 HTPICC put some interrupt recovery info, and that code depends on the place where interrupt occurs, so in each interrupt it can execute different number of instructions and give different times in the interrupt function.
I think the solution is to put the set of TMR1L and TMR1H on position 0x0004 of the program, but how can I do this?
ThX
NeuralC