This is the mail archive of the ecos-discuss@sources.redhat.com 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]

Re: How to calculate the Real-time clock period?



----- 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
>



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