Hi,
I'm trying get 5 min timer with C8051F120 timer 2. 24 MHz clock is used and is there any way that i can create 5 min timer?
thanks
Yes.
"I'm trying..."
What, exactly, have you tried?
Where are you stuck?
Think about how an ordinary, mechanical clock/timer works...
I'm just a beginner and trying to learn various function. I understand that the timer only able to count 65535 steps. With 24Mhz clock, there is no way that I can set the timer as long as 5 min. Just seek for a help if any have any idea to get 5 min delay timer with 24Mhz clock.
thanks,
"Just seek for a help if any have any idea to get 5 min delay timer with 24Mhz clock."
In the timer isr, keep track of the time passed since the last 5-min marker; Once the time reached 5 minutes, subtract the duration of the time passed and set a flag.
If the scope of your timer is only milliseconds you'll want to count off how many there are in 5 minutes.
ie a one millisecond tick timer will enter the interrupt 1000 times in one second, 60000 times in one minute, 300000 times in five minutes
View all questions in Keil forum