This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: AT91SAM7S RTC speed (clocktruth test result)
Hello!
>>>>> "Andrew" == Andrew Lunn <andrew@lunn.ch> writes:
Andrew> Please can you use the standard eCos test,
Andrew> clocktruth. Also, are you using the PIT or a TC for the
Andrew> clock? What is the value of CYGBLD_HAL_ARM_AT91_TIMER_TC
Andrew> and CYGBLD_HAL_ARM_AT91_TIMER_PIT. It could be a problem
Andrew> with PIT vs TC?
I've run the clocktruth test today as you suggested and tried to use
PIT instead of TC. Here are the results.
At first I tried to configure Ecos using PIT for system clock:
# Use Timer Counter for eCos Clock
# Use a Timer Counter Channel to generate the eCos Clock.
#
cdl_option CYGBLD_HAL_ARM_AT91_TIMER_TC {
# Flavor: bool
user_value 0
# value_source user
# Default value: 1
# Requires: !CYGBLD_HAL_ARM_AT91_TIMER_PIT
# CYGBLD_HAL_ARM_AT91_TIMER_PIT == 1
# --> 0
# The following properties are affected by this value
# option CYGBLD_HAL_ARM_AT91_TIMER_PIT
# DefaultValue: !CYGBLD_HAL_ARM_AT91_TIMER_TC
# option CYGBLD_HAL_ARM_AT91_TIMER_PIT
# Requires: !CYGBLD_HAL_ARM_AT91_TIMER_TC
};
# Use Periodic Interval Timer for eCos Clock
# Use Periodic Interval Timer to generate the eCos Clock.
#
cdl_option CYGBLD_HAL_ARM_AT91_TIMER_PIT {
# ActiveIf constraint: CYGINT_HAL_ARM_AT91_PIT_HW
# CYGINT_HAL_ARM_AT91_PIT_HW == 1
# --> 1
# Flavor: bool
# No user value, uncomment the following line to provide one.
# user_value 1
# value_source default
# Default value: !CYGBLD_HAL_ARM_AT91_TIMER_TC
# CYGBLD_HAL_ARM_AT91_TIMER_TC == 0
# --> 1
# Requires: !CYGBLD_HAL_ARM_AT91_TIMER_TC
# CYGBLD_HAL_ARM_AT91_TIMER_TC == 0
# --> 1
# The following properties are affected by this value
# option CYGBLD_HAL_ARM_AT91_TIMER_TC
# Requires: !CYGBLD_HAL_ARM_AT91_TIMER_PIT
};
My simple test that I've described earlier showed normal result when
linked with pure system library and twice shorter time with patched
variant.
The clocktruth test results are as follows:
Linked with pure Ecos with PIT as system clock
-------------------------------------------------------
INFO<time now 1>
INFO<time now 2>
INFO<time now 3>
...
INFO<time now 98>
INFO<time now 99>
INFO<time now 100>
INFO<per-second times are: 100>
INFO<per-second time 0 is 201>
INFO<per-second time 1 is 301>
INFO<per-second time 2 is 401>
INFO<per-second time 3 is 501>
...
INFO<per-second time 17 is 1901>
INFO<per-second time 18 is 2001>
INFO<per-second time 19 is 2101>
INFO<alarm time 0 is 2201>
INFO<alarm time 1 is 2301>
INFO<alarm time 2 is 2401>
INFO<alarm time 3 is 2501>
...
INFO<alarm time 17 is 3901>
INFO<alarm time 18 is 4001>
INFO<alarm time 19 is 4101>
PASS:<Clock truth OK>
EXIT:<done>
Lines "per-second" and "alarm" are printed one line per second.
Patched Ecos using PIT as system clock
---------------------------------------------------
INFO<time now 1>
INFO<time now 3>
INFO<time now 5>
...
INFO<time now 195>
INFO<time now 197>
INFO<time now 199>
INFO<per-second times are: 200>
INFO<per-second time 0 is 302>
INFO<per-second time 1 is 403>
INFO<per-second time 2 is 504>
INFO<per-second time 3 is 605>
...
INFO<per-second time 17 is 2019>
INFO<per-second time 18 is 2120>
INFO<per-second time 19 is 2221>
INFO<alarm time 0 is 2322>
INFO<alarm time 1 is 2422>
INFO<alarm time 2 is 2522>
INFO<alarm time 3 is 2622>
...
INFO<alarm time 17 is 4022>
INFO<alarm time 18 is 4122>
INFO<alarm time 19 is 4222>
PASS:<Clock truth OK>
EXIT:<done>
Lines "per-second" and "alarm" are printed two line per second.
Pure Ecos using TC as system clock
------------------------------------------------------
INFO<time now 1>
INFO<time now 2>
INFO<time now 3>
...
INFO<time now 97>
INFO<time now 98>
INFO<time now 99>
INFO<time now 100>
INFO<per-second times are: 100>
INFO<per-second time 0 is 200>
INFO<per-second time 1 is 300>
INFO<per-second time 2 is 400>
INFO<per-second time 3 is 500>
...
INFO<per-second time 17 is 1900>
INFO<per-second time 18 is 2000>
INFO<per-second time 19 is 2100>
INFO<alarm time 0 is 2200>
INFO<alarm time 1 is 2300>
INFO<alarm time 2 is 2400>
INFO<alarm time 3 is 2500>
...
INFO<alarm time 17 is 3900>
INFO<alarm time 18 is 4000>
INFO<alarm time 19 is 4100>
PASS:<Clock truth OK>
EXIT:<done>
Lines "per-second" and "alarm" are printed one line per two seconds.
Patched Ecos using TC as system clock
--------------------------------------------------
INFO<time now 1>
INFO<time now 2>
INFO<time now 3>
...
INFO<time now 97>
INFO<time now 98>
INFO<time now 99>
INFO<time now 100>
INFO<per-second times are: 100>
INFO<per-second time 0 is 201>
INFO<per-second time 1 is 301>
INFO<per-second time 2 is 401>
INFO<per-second time 3 is 501>
...
INFO<per-second time 17 is 1901>
INFO<per-second time 18 is 2001>
INFO<per-second time 19 is 2101>
INFO<alarm time 0 is 2201>
INFO<alarm time 1 is 2301>
INFO<alarm time 2 is 2401>
INFO<alarm time 3 is 2501>
...
INFO<alarm time 17 is 3901>
INFO<alarm time 18 is 4001>
INFO<alarm time 19 is 4101>
PASS:<Clock truth OK>
EXIT:<done>
Lines "per-second" and "alarm" are printed one line per second.
So, it seems, the RTC period should be calculated separately for TC
and for PIT.
Best regards,
Igor.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss