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: Re: RE : Understanding CYGNUM_HAL_RTC_PERIOD NUMERATOR DENOMINATOR


On Thu, 2006-06-22 at 10:11 -0400, Moussa Ba wrote:
> Thank you for the replies, the way I have used RTC_PERIOD is that my 
> CPU_CLOCK is at 32MHz, while I prescale the timer by a factor of 8 hence 
> yielding at timer clock of 4Mhz, therefore my RTC_PERIOD is 
> 4,000,000/DENOMINATOR or 40,000.  I use this value to preload my 16 bit 
> timer with 65536 - 40000 with automatic reloading of this value, this 
> essentially gives me the 10ms tick.
> 
You could define a RTC_FREQUENCY with that value of 4000000 (in Hz) in
the cdl, then you especify the PERIOD as calculated
{ ...FREQUENCY / ...DENOMINATOR }.
That way you get some differentiation between the CPU frequency and the
hw. timer frequency. You can put a default_value { ...CPU_CLOCK / 8 }...

> I think David makes a valid point that it would help to put platform 
> specific values, however, these are also dependent on the hardware timer 
> setup.  Though, this can be made specific to timer clocks (prescaler 
> values that is).
> 
No problem, if there are more than one way to set your timer, you can
put a PRESCALER option in a platform-variant cdl or in a configuration
template, or just in a configuration file that you import... Or you can
just put the RTC_FREQUENCY option in there.

Anyway, the thing of the timer that defines the OS sw. timers can be
considered a essential parameter for the platform, so when doing the
platform cdl and the code you choose the best/more flexible method yo
have available, and define parameters and constrains to avoid wrong
values. For example you can put a legal_values in DENOMINATOR as {1 to
(...RTC_FREQUENCY / 65535) }.

David.



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