What is the interval and duration of your input pulse on PORTB.0 from the GPS?
What is the interval and duration of your input pulse on PORTB.0 from the GPS?
Regards,
TABSoft
Hi, looks like I ignored you there..... We took it to email!
Hi Tabsoft (and others who might have some insight)
I have incorporated your 1ms timer (top of this thread) as a basis for my nixie clock. ( I had wanted to implement Darrells' instant interrupts so this was perfect)
I needed a 5 ms interrupt to update my nixie display and was able to modify your "elaptimer_interrupt.pbp" include file to give me the 5 ms interrupt by changing the include as shown below...
But I am finding that my clock gains about 2 minutes (give or take) in about 18 hours.Code:; Added 04/03/2015 "IntTime" IntTime = 200 ; 200 = 5ms ; Change IntTime in calc for interrupt time ; 1000=1ms, 100=10ms, 10 = 100ms, etc. ; Needs to be a multiple of 10.
I wonder if the problem might be in this part of your include...
when Ticks go from 0 to 200, wouldn't that be 201 steps.Code:if Ticks = 200 then ' Modified 04/03/2015 from 100 to 1000 ' change Ticks = x to right interrupt time ' 1000=1ms, 100=10ms, 10=100ms, etc. Ticks = 0
Shouldn't it be from 0-199 or 1-200 to get the 200 steps??
But in my case where the clock is running fast I should probably start increasing this count to slow the clock down?
somewhere in the thread or in the comments in the include there is alluded to that the code is somehow self calibrating?? or am I misreading that??
What is the best way to arrive at a more accurate time base?
I am just using the internal 8mhz osc in my 16F1828 so I know it won't be super accurate.
My clock does read NTP time every morning so I don't need long term accuracy.
I will probably change the code to read the NTP time twice a day if necessary but I would like to fine tune it a bit if possible.
thanks (in advance) for any guidance from the forum
Last edited by Heckler; - 9th March 2016 at 04:48.
Dwight
These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
Heckler,
I'll take a look when I get a few moments. See if I can set it up on some hardware and give it a test run for a while.
Regards,
TABSoft
Hi TabSoft,
Possibly I am expecting too much from the internal OSC. The documentation states "Factory Calibrated to within+/- 1%"
1% of 24 Hours is +/- 14.4 minutes so my complaint regarding 2-4 minutes in 24 hours is well within the 1%
I took a look at the elap_timer include file and can't quite tell how I might make fine adjustments to the timing routine other than adding or subtracting in "Ticks" in the following code segment...
Am I on the right track??Code:if Ticks = 200 then ' Modified 04/03/2015 from 100 to 1000 ' change Ticks = x to right interrupt time ' 1000=1ms, 100=10ms, 10=100ms, etc. Ticks = 0
Is it the case that this include file is somehow self calibrating??
If so how does that happen? and against what standard?
This is all somewhat low priority as it is just for a real time clock that only displays hours:minutes and I can opt to check NTP time (more than once a day) or go to an external crystal oscillator.
Thanks for any guidance or explanation you (or others) might be able to offer.
Dwight
These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
Bookmarks