I'm planning to use the RTC of my PIC18F452 to tic every seconds at 20MHz clock.
I put instructions into my code as stated below:
Code:
#int_timer0
timer0_isr() {
seconds++; // This interrupt occurs every second
ticxf = 1; // set timer flag
set_timer0(26473); // 26473.5 offset for 1.0s time in DIV_128
}
My question is... I am correct with my setup in using timer0 that tic every seconds.
Anybody in the community who can provide me with a basic math calculation if in case I change the clock from 20MHz to 6Mhz.
A generic model would help... thank u
Guest
Re: #int_tmr0 Help
Posted: Fri Dec 19, 2003 8:18 am
ritchie wrote:
Hello,
I'm planning to use the RTC of my PIC18F452 to tic every seconds at 20MHz clock.
I put instructions into my code as stated below:
Code:
#int_timer0
timer0_isr() {
seconds++; // This interrupt occurs every second
ticxf = 1; // set timer flag
set_timer0(26473); // 26473.5 offset for 1.0s time in DIV_128
}
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum