[En-Nut-Discussion] Real time clock on 1.3G not accurate anymore.
Lars Andersson
lars at larsandersson.com
Sat Feb 18 14:49:27 CET 2006
Hi group,
when moving from version 3.3.0.1 to 4.0.1.0 in an application
running on 1.3F boards I found my homemade RTC using a 1 second
timer callback was very inaccurate; about 1/60 to slow. I then switched to
using the
built-in RTC using stime() and time().
I find the built-in RTC is also very inaccurate in the same way as the timer
callback was,
about one second too slow per minute.
I use ethernut 1.3F NUT 4.0.1.0 and winavr 3.4.1
NutGetCpuClock() returns 14.7438 MHz
NutGetTickClock()returns 1024 Hz
I tried to follow what happens with platform definitions
from the configurator and onvards in code generation thinking that
NUT_TICK_FREQ
might be wrong. Unfortunately, I got lost in this (for me) very large
forest.
It certainly had been easier if the error had been greater like double freq
or so.
Any help is appreciated.
HW manual enhwm16 says:
- An additional 32.768 kHz crystal (Q2) drives an on-chip asynchronous
timer,
- which is typically used for a software realtime clock.
ostimer.c says:
Since version 3.9.8, the default frequency had been changed
from 16 Hz to 1024 Hz, when the timer is running with an
external 32 kHz clock crystal.
Best regards,
Lars H. Andersson
More information about the En-Nut-Discussion
mailing list