Naaa. Don't bother.
Try Melanie's Olympic timer instead (cheers Darrel, you keally know how to make friends - Melanie). It doesn't have the ASM stuff to worry about.
Or Paul's clock that doesn't even need interrupts.
DT
<br>
Naaa. Don't bother.
Try Melanie's Olympic timer instead (cheers Darrel, you keally know how to make friends - Melanie). It doesn't have the ASM stuff to worry about.
Or Paul's clock that doesn't even need interrupts.
DT
<br>
Just wanted to say thanks, works great on a 16F690.
I was going to modify your program a bit, I have an application which uses count down timers, but I thought I should check with you, I noticed a copyright on the code.
Thanks,
Mike
Hi Mike,
Glad it's working.
No problem with the copyright.
You're free to use it any way you want. Well, except posting it somewhere saying you wrote it![]()
DT
Hi Darrel,
I tried making a LCD clock with calender with the elapsed timer code, but the clock runs nearly 2 seconds slow per day.
I've made some modifications to the Elapsed_INT.bas.txt file so attached that also with my code ...
I dont know how to fix this error...
What should i do?... try tweeking the TimerConst or something???
Hi shahidali55,
"tweeking the TimerConst" won't help. 1 count either direction will change the timing by more than you are off. @ 4mhz, 1 count will change the time by about 4 seconds per day.
At 2 seconds per day, it works out to around 23 PPM (parts per million), which is within the normal 50 PPM tolerance of the crystal. Not to mention the +/- 100 PPM variance due to temperature.
To get closer than that, you'll need to calibrate the crystal frequency. You may be able to use a small Trimmer Capacitor in place of one of the capacitors on the crystal. The size needed depends on your crystal, but 0-20pf will probably work.
Other than that, you could simply add 1 second every 12 hours. But if you build more units, that could be problamatic since they won't all be the same.
Here's a couple links to some more crystal info:
http://www.circuitcellar.com/library...ujanos91/3.htm
http://ww1.microchip.com/downloads/e...tes/00588b.pdf
http://ww1.microchip.com/downloads/e...tes/00949a.pdf
DT
I dont think the problem is with the oscillator.
I noticed that the time loss takes place every time the hours increase...
Could it be some flaw in the code execution?
If its losing time on every change of the hour, and the total loss is 2 seconds per day, then each change of the hour would lose 1/12th or 0.083 seconds.
@ 4mhz, that's 83,000 instruction cycles. No, I don't think it's accidently losing that many instructions to increment an hour. And, looking at the ClockCount interrupt routine, if that were the case, it would also happen on every second, minute, and day as well. Which it doesn't.
Why don't you think it's the crystal?
Have you measured the frequency?
DT
Hi Guys.
I'm writing a program to control a drag racing xmas tree and time the 1/4 mile but I need .0000 (ie thousandths) second accuracy.
Looking a the ASM routine I'm wondering if I can just change the 100Hz freq to 1KHz by triggering the interupt more often.
Will this work?
Thanks and Regards
Thirsty
That should work.
But .0000 would be Ten Thousandths of a sec. That'll be harder.
<br>
DT
Using a 12F675 I am getting wsave position request beyond ram_end errors how do I fix this?
Sorry for posting that same message again...
I was getting an error message...
The attachment wasn't uploading correctly...
Bookmarks