Thank you members for your posts. As stated in my previous thread, the timer source comprises 8Mhz Crystal with two 22pf ceramic capacitors connected to pins 13 & 14 of the PIC18F4550. I need an accuracy better than 1sec. in 10 days. For member timwhite, here is my setup timer code again:
//set_timer2(0);
//setup_timer_2(T2_DIV_BY_4,100,10);
//enable_interrupts(INT_TIMER2 );
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_32); //1.0 s overflow
enable_interrupts(INT_TIMER0);
enable_interrupts(INT_RB );
enable_interrupts(global);
My initial setup was with timer2. This made my system to loose 10minutes daily. Then my trial with timer0 was worse with a loss of 60minutes daily. I would therefore prefer timer2 setup with an appropriate code.
Thank you.
folorunsoa
//set_timer2(0);
//setup_timer_2(T2_DIV_BY_4,100,10);
//enable_interrupts(INT_TIMER2 );
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_32); //1.0 s overflow
enable_interrupts(INT_TIMER0);
enable_interrupts(INT_RB );
enable_interrupts(global);
My initial setup was with timer2. This made my system to loose 10minutes daily. Then my trial with timer0 was worse with a loss of 60minutes daily. I would therefore prefer timer2 setup with an appropriate code.
Thank you.
folorunsoa