View previous topic :: View next topic |
Author |
Message |
hadeelqasaimeh
Joined: 05 Jan 2006 Posts: 105
|
real time |
Posted: Sat Mar 10, 2007 11:01 am |
|
|
hi all
i wonder if i can use timers to count one day or one month?
thank you |
|
|
Ttelmah Guest
|
|
Posted: Sat Mar 10, 2007 1:53 pm |
|
|
Without extra software, no. However it is totally simple, to have a hardware timer that counts in (say), seconds, and just have an interrupt routine that itself decrements a larger counter.
Best Wishes |
|
|
mskala
Joined: 06 Mar 2007 Posts: 100 Location: Massachusetts, USA
|
|
Posted: Sat Mar 10, 2007 3:01 pm |
|
|
Having an interrupt routine connected to any timer overflow works fine.
Using even a decent oscillator that's rated for 50ppm, though, you could be off by 2 minutes per month, plus any rounding errors if your overflow is does not evenly go into 1 second, or whatever count time.
Of course rounding errors can be corrected easily by software, too. |
|
|
|