David Fernandez dfernandez@cct.co.uk
Thu Jun 22 14:35:00 GMT 2006

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
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) }.


Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list