Internal Clock Accuracy
#1
Posted 08 April 2011 - 10:02 AM
#2
Posted 08 April 2011 - 10:24 AM
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs
#3
Posted 08 April 2011 - 12:11 PM
12 secs on 24h is about 140ppm, and it could be the crystal imprecision, but it is very bad (typically should be under 100ppm).Is this inaccuracy only due to an inproper crystal?
I don't think so. Due to space problems there is no adjustable capacitor for the crystal.Can the internal clock be adjusted somehow?
You may create your own hi-precision timing source, but it cannot be used as an alias for the standard timing. That is you could feed an input port with a 1Hz clock, then manage an internal counter every edge.Can I use an exact running external oscillator to avoid this inaccuracy?
You will have jittering, but the average must adherent to the time-base.
Cheers
#4
Posted 08 April 2011 - 12:51 PM
#5
Posted 08 April 2011 - 01:27 PM
#6
Posted 08 April 2011 - 02:02 PM
That is a good question, but I can't answer at the moment.I thought of adjusting the internal clock (DateTime.Now) via software. But I fear it isn't possible (or is it?).
I would avoid to modify the board, also because the components are really tiny.
A workaround could be taking advantage by the pin 7 of the RTC, that is a 1Hz square wave, by feeding any of the input port. If you configure that port as "InterruptPort", you will obtain an event on any edge of the 1Hz wave.
Within the service routine, you could increment your own private DateTime field of just one second (using the TimeSpan structure).
Of sure it will not an elegant way, but it is even better than a finger in eye.
Tschuss.
#7
Posted 08 April 2011 - 04:19 PM
You can use Utility.SetLocalTime(...) to set the local time.I thought of adjusting the internal clock (DateTime.Now) via software. But I fear it isn't possible (or is it?).
#8
Posted 08 April 2011 - 05:59 PM
#9
Posted 08 April 2011 - 08:07 PM
I see. I am not aware of any function that could be used to adjust the accuracy of the internal clock (and there is no calibration mentioned in the microcontroller datasheet). Just out of curiosity, what does your program do? Does it call many managed methods that internally call native functions? Or responds frequently to interrupts? This may cause certain time deviation, because the framework uses so called 'slow clock' with resolution ~21 µs for time functions. If you create a trivial program that does nothing (e.g. Thread.Sleep(Timeout.Infinite)) and displays the current time in response to an external event, which may be precisely timed, you should be able to verify whether the time deviation is caused by the oscillator (you will get the discrepancy too) or by the CLR execution engine.sorry, I didn't mean "adjusting the internal clock", I meant "adjusting the accuracy of the internal clock". Is it possible?
Netduino uses crystal oscillator ABM7-18.432MHZ-10-D2Y, which according to the datasheet has frequency tolerance ±20 ppm and stability ±30 ppm. The microcontroller supports external clock source and also has Real-time Timer, both would require changes in the firmware.
#10
Posted 09 April 2011 - 01:33 AM
#11
Posted 09 April 2011 - 04:04 AM
That is another bad new I won't ever hear, but it seems so...Netduino uses crystal oscillator ABM7-18.432MHZ-10-D2Y, which according to the datasheet has frequency tolerance ±20 ppm and stability ±30 ppm. The microcontroller supports external clock source and also has Real-time Timer, both would require changes in the firmware.
It seems that the internal RTC is totally software based, without any sync with a MCU timer.
At this point, it is clear that has not any sense adjusting the circuitry around the crystal.
#12
Posted 26 April 2011 - 01:21 PM
Note to self: Using a Real-time Timer with Non-calibrated RC Oscillator as a Real-time Clock.I am not aware of any function that could be used to adjust the accuracy of the internal clock (and there is no calibration mentioned in the microcontroller datasheet).
The Application Note describes a method to improve the accuracy of a Realtime Timer when it is used as a Real-time Clock. A special hardware process, "Timing Interval Acquisition" (TIA), has been developed and is embedded in AT91SAM7S and AT91SAM7X products.
#13
Posted 24 May 2012 - 06:42 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users