This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: How to calculate the Real-time clock period?
- To: "Chris C." <hksbtx at 2bzd dot com>
- Subject: Re: [ECOS] How to calculate the Real-time clock period?
- From: "Jaiprakash" <jaiprakash at inablers dot net>
- Date: Thu, 13 Sep 2001 19:05:52 +0530
- Cc: <ecos-discuss at sources dot redhat dot com>
- References: <48272001909161552109@2bsure.com>
----- Original Message -----
From: "Chris C." <hksbtx@2bzd.com>
To: <ecos-discuss@sourceware.cygnus.com>
Sent: Sunday, September 09, 2001 9:45 PM
Subject: [ECOS] How to calculate the Real-time clock period?
> Hi
>
> In hal_arm_xxx.cdl, I don't know how to calculate the
> CYGNUM_HAL_RTC_PERIOD. If the cpu clock speed is 24MHz, how to find it
u have to use this speed to calculate the basic tick or period of ur
clock.
suppose u have a timer data register TDATA, a timer prescaler register
TPRE then to calculate the period u have to do this
1/24 mhz * TDATA * TPRE = PERIOD
u decide the PERIOD say 10 msec and the prescaler say 0xff, then using
this load the timer with TDATA.
> value? Why at91 use ((CYGNUM_HAL_ARM_AT91_CLOCK_SPEED/32) /
> CYGNUM_HAL_RTC_DENOMINATOR) to calculate the rtc period?
>
> What is the function of CYGNUM_HAL_RTC_NUMERATOR and
> CYGNUM_HAL_RTC_DENOMINATOR?
these values are useful for calculating the resolution of the clock
suppose ur clock tick is 18msec then ur CYGNUM_HAL_RTC_NUMERATOR should be
1800000000 and CYGNUM_HAL_RTC_DENOMINATOR should be 100 so that u get a
nanosec value 18000000 nanosec and this is 18msec (refer ecos.ecc) for
details
hope this helps
> ----------------------------------------------------
> Chris
>
> _________________________________________________________________________
> Sure, you can have free email. But free Email, Voicemail and Faxmail?
> Check it out at http://www.2bzd.com
>