This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Drift in Real Time Clock


"M Arshad Khan" <marshadkhan@gmail.com> writes:

> yes the problem was with the initialization value i varry this value
> and got delay of 1.5ms in 100 s using initialization value of 11934
> (very strange...). now i want to reduce the time of one tick from 10ms
> to 1ms... so that i can generate interrupt of 1ms i tried it by
> changing the values of clock resolution numerator and clock resolution
> denominator but same 10ms. any suggestion in this regard?...
>

You need to change the period value too, it is not changed
automatically if you just change the resolution parameters. However,
going to a 1KHz tick rate will make the drift worse. For better
accuracy it might make sense to choose a frequency that is more
directly related to the PC clock frequency. 

Also, the crystal that drives the clock will have limited accuracy,
which will vary with things like temperature. So there is only a
limited amount you can do to eliminate drift; unless you regularly
query an external clock and calibrate it in the way that fully
functional NTP clients do.

-- 
Nick Garnett                                     eCos Kernel Architect
eCosCentric Limited     http://www.eCosCentric.com/   The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.    Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]