public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] RE : [ECOS] Understanding CYGNUM_HAL_RTC_PERIOD NUMERATOR DENOMINATOR
@ 2006-06-21  7:19 FALL
  2006-06-22 12:56 ` [ECOS] " David Fernandez
  0 siblings, 1 reply; 7+ messages in thread
From: FALL @ 2006-06-21  7:19 UTC (permalink / raw)
  To: ecos-discuss


Good Day, I have successfully compiled and ran ecos on an oki platform.
I am however not understanding how to setup the NUMERATOR DENOMINATOR
RTC_PERIOD per my platform specs. I have read the documentation but I am
still not clear on what values I should use.  Specifically, my processor
is runningat 33Mhz, when the hal_clock_initialize is called, what is the
relationship between that and the above mentioned values.

Moussa
hi Moussa try this config:
cdl_component CYGNUM_HAL_CPUCLOCK {
        display       "cpu clock"
        flavor        data
        calculated 33000000
	no_define
	define -file system.h CYGNUM_HAL_CPUCLOCK
        description   "Frequency of cpu clock in Hz."
    }
....
# Real-time clock/counter specifics
    cdl_component CYGNUM_HAL_RTC_CONSTANTS {
        display       "Real-time clock constants"
        flavor        none

        cdl_option CYGNUM_HAL_RTC_NUMERATOR {
            display       "Real-time clock numerator"
            flavor        data
            default_value 1000000000
        }
        cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
            display       "Real-time clock denominator"
            flavor        data
            default_value 100
        }
        cdl_option CYGNUM_HAL_RTC_PERIOD {
            display       "Real-time clock period"
            flavor        data
            default_value (CYGNUM_HAL_CPUCLOCK/CYGNUM_HAL_RTC_DENOMINATOR) -1
        }
    }
khéweul!

FALL Birahim
Elsys-Design
PACA





________________________________________________________________
Sent via the WebMail system at elsys-design.com






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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ECOS] Re: RE : [ECOS] Understanding CYGNUM_HAL_RTC_PERIOD NUMERATOR  DENOMINATOR
  2006-06-21  7:19 [ECOS] RE : [ECOS] Understanding CYGNUM_HAL_RTC_PERIOD NUMERATOR DENOMINATOR FALL
@ 2006-06-22 12:56 ` David Fernandez
  2006-06-22 13:05   ` David Fernandez
  0 siblings, 1 reply; 7+ messages in thread
From: David Fernandez @ 2006-06-22 12:56 UTC (permalink / raw)
  To: birahim.fall; +Cc: ecos-discuss

On Wed, 2006-06-21 at 09:19 +0200, FALL wrote:
> Good Day, I have successfully compiled and ran ecos on an oki platform.
> I am however not understanding how to setup the NUMERATOR DENOMINATOR
> RTC_PERIOD per my platform specs. I have read the documentation but I am
> still not clear on what values I should use.  Specifically, my processor
> is runningat 33Mhz, when the hal_clock_initialize is called, what is the
> relationship between that and the above mentioned values.
> 
> Moussa
> hi Moussa try this config:
> cdl_component CYGNUM_HAL_CPUCLOCK {
>         display       "cpu clock"
          display       "cpu clock (Mhz.)"
>         flavor        data
>         calculated 33000000
> 	no_define
> 	define -file system.h CYGNUM_HAL_CPUCLOCK
>         description   "Frequency of cpu clock in Hz."
>     }
> ....
> # Real-time clock/counter specifics
>     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
>         display       "Real-time clock constants"
>         flavor        none
> 
>         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
>             display       "Real-time clock numerator"
              display       "Real-time clock numerator (nanoseconds per second)"
>             flavor        data
>             default_value 1000000000
>         }
>         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
>             display       "Real-time clock denominator"
              display       "Real-time clock denominator (wraps per second)"
>             flavor        data
>             default_value 100
>         }
>         cdl_option CYGNUM_HAL_RTC_PERIOD {
>             display       "Real-time clock period"
              display       "Real-time clock period (ticks per wrap)"
>             flavor        data
>             default_value (CYGNUM_HAL_CPUCLOCK/CYGNUM_HAL_RTC_DENOMINATOR) -1
>         }
>     }

The way I see that in my intel platform is as modified above.

The DENOMINATOR allows you to calculate ticks and specifies the OS timer
"tick" (usually 10 milliseconds)

The NUMERATOR allows you to convert periods into frequencies and
viceversa (periods in nanoseconds to/from frequencies in Mhz.)

The only reason you want to change DENOMINATOR is to get a different
time granularity in the OS.

The only reason you want to change the NUMERATOR is if you need to use
different units of periods or frequencies becuase may be that the
calculi you need to do exceeds the numerical capacity of your scalar
types.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ECOS] Re: RE : [ECOS] Understanding CYGNUM_HAL_RTC_PERIOD NUMERATOR  DENOMINATOR
  2006-06-22 12:56 ` [ECOS] " David Fernandez
@ 2006-06-22 13:05   ` David Fernandez
  2006-06-22 13:17     ` Gary Thomas
  0 siblings, 1 reply; 7+ messages in thread
From: David Fernandez @ 2006-06-22 13:05 UTC (permalink / raw)
  To: birahim.fall; +Cc: ecos-discuss

On Thu, 2006-06-22 at 13:56 +0100, David Fernandez wrote:
> On Wed, 2006-06-21 at 09:19 +0200, FALL wrote:
> > Good Day, I have successfully compiled and ran ecos on an oki platform.
> > I am however not understanding how to setup the NUMERATOR DENOMINATOR
> > RTC_PERIOD per my platform specs. I have read the documentation but I am
> > still not clear on what values I should use.  Specifically, my processor
> > is runningat 33Mhz, when the hal_clock_initialize is called, what is the
> > relationship between that and the above mentioned values.
> > 
> > Moussa
> > hi Moussa try this config:
> > cdl_component CYGNUM_HAL_CPUCLOCK {
> >         display       "cpu clock"
>           display       "cpu clock (Mhz.)"
> >         flavor        data
> >         calculated 33000000
> > 	no_define
> > 	define -file system.h CYGNUM_HAL_CPUCLOCK
> >         description   "Frequency of cpu clock in Hz."
> >     }
> > ....
> > # Real-time clock/counter specifics
> >     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
> >         display       "Real-time clock constants"
> >         flavor        none
> > 
> >         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
> >             display       "Real-time clock numerator"
>               display       "Real-time clock numerator (nanoseconds per second)"
> >             flavor        data
> >             default_value 1000000000
> >         }
> >         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
> >             display       "Real-time clock denominator"
>               display       "Real-time clock denominator (wraps per second)"
> >             flavor        data
> >             default_value 100
> >         }
> >         cdl_option CYGNUM_HAL_RTC_PERIOD {
> >             display       "Real-time clock period"
>               display       "Real-time clock period (ticks per wrap)"
> >             flavor        data
> >             default_value (CYGNUM_HAL_CPUCLOCK/CYGNUM_HAL_RTC_DENOMINATOR) -1
> >         }
> >     }
> 
> The way I see that in my intel platform is as modified above.
> 
> The DENOMINATOR allows you to calculate ticks and specifies the OS timer
> "tick" (usually 10 milliseconds)
> 
> The NUMERATOR allows you to convert periods into frequencies and
> viceversa (periods in nanoseconds to/from frequencies in Mhz.)
> 
> The only reason you want to change DENOMINATOR is to get a different
> time granularity in the OS.
> 
> The only reason you want to change the NUMERATOR is if you need to use
> different units of periods or frequencies becuase may be that the
> calculi you need to do exceeds the numerical capacity of your scalar
> types.
> 
> David.

WARNING: The NUMERATOR value is used when programing some hardware
timer... but hardware could impose limitations on this value that should
be noted in the cdl legal_values..., lets say for example, that if your
CPU/Timer frequency is very high, and your hardware timer counter
register is small (16 bit for example), you can't get good values for
small PERIODs, because won't fit in 0-65535 range.


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ECOS] Re: RE : [ECOS] Understanding CYGNUM_HAL_RTC_PERIOD NUMERATOR   DENOMINATOR
  2006-06-22 13:05   ` David Fernandez
@ 2006-06-22 13:17     ` Gary Thomas
  2006-06-22 13:43       ` David Fernandez
  0 siblings, 1 reply; 7+ messages in thread
From: Gary Thomas @ 2006-06-22 13:17 UTC (permalink / raw)
  To: David Fernandez; +Cc: birahim.fall, ecos-discuss

David Fernandez wrote:
> On Thu, 2006-06-22 at 13:56 +0100, David Fernandez wrote:
>   
>> On Wed, 2006-06-21 at 09:19 +0200, FALL wrote:
>>     
>>> Good Day, I have successfully compiled and ran ecos on an oki platform.
>>> I am however not understanding how to setup the NUMERATOR DENOMINATOR
>>> RTC_PERIOD per my platform specs. I have read the documentation but I am
>>> still not clear on what values I should use.  Specifically, my processor
>>> is runningat 33Mhz, when the hal_clock_initialize is called, what is the
>>> relationship between that and the above mentioned values.
>>>
>>> Moussa
>>> hi Moussa try this config:
>>> cdl_component CYGNUM_HAL_CPUCLOCK {
>>>         display       "cpu clock"
>>>       
>>           display       "cpu clock (Mhz.)"
>>     
>>>         flavor        data
>>>         calculated 33000000
>>> 	no_define
>>> 	define -file system.h CYGNUM_HAL_CPUCLOCK
>>>         description   "Frequency of cpu clock in Hz."
>>>     }
>>> ....
>>> # Real-time clock/counter specifics
>>>     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
>>>         display       "Real-time clock constants"
>>>         flavor        none
>>>
>>>         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
>>>             display       "Real-time clock numerator"
>>>       
>>               display       "Real-time clock numerator (nanoseconds per second)"
>>     
>>>             flavor        data
>>>             default_value 1000000000
>>>         }
>>>         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
>>>             display       "Real-time clock denominator"
>>>       
>>               display       "Real-time clock denominator (wraps per second)"
>>     
>>>             flavor        data
>>>             default_value 100
>>>         }
>>>         cdl_option CYGNUM_HAL_RTC_PERIOD {
>>>             display       "Real-time clock period"
>>>       
>>               display       "Real-time clock period (ticks per wrap)"
>>     
>>>             flavor        data
>>>             default_value (CYGNUM_HAL_CPUCLOCK/CYGNUM_HAL_RTC_DENOMINATOR) -1
>>>         }
>>>     }
>>>       
>> The way I see that in my intel platform is as modified above.
>>
>> The DENOMINATOR allows you to calculate ticks and specifies the OS timer
>> "tick" (usually 10 milliseconds)
>>
>> The NUMERATOR allows you to convert periods into frequencies and
>> viceversa (periods in nanoseconds to/from frequencies in Mhz.)
>>
>> The only reason you want to change DENOMINATOR is to get a different
>> time granularity in the OS.
>>
>> The only reason you want to change the NUMERATOR is if you need to use
>> different units of periods or frequencies becuase may be that the
>> calculi you need to do exceeds the numerical capacity of your scalar
>> types.
>>
>> David.
>>     
>
> WARNING: The NUMERATOR value is used when programing some hardware
> timer... but hardware could impose limitations on this value that should
> be noted in the cdl legal_values..., lets say for example, that if your
> CPU/Timer frequency is very high, and your hardware timer counter
> register is small (16 bit for example), you can't get good values for
> small PERIODs, because won't fit in 0-65535 range.
>
>
>   
This isn't strictly correct.

CYGNUM_HAL_RTC_NUMERATOR describes the granularity of the timer values.  
The default specifies nano-seconds.

CYGNUM_HAL_RTC_DENOMINATOR is how many times the system clock interrupts 
per second.  This is simply
information to the kernel to know how to interpret time when it gets an 
RTC interrupt.

CYGNUM_HAL_RTC_PERIOD is the value which is programmed into your 
hardware "clock".  It needs to be adjusted
so that the clock will generate interrupts at 
CYGNUM_HAL_RTC_DENOMINATOR/second.

Typically, one only needs to adjust CYGNUM_HAL_RTC_PERIOD based on the 
hardware.  If you want the system 'tick'
to be faster than the default 10ms, then adjust 
CYGNUM_HAL_RTC_DENOMINATOR (and make sure that the value of
CYGNUM_HAL_RTC_PERIOD tracks)




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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ECOS] Re: RE : [ECOS] Understanding CYGNUM_HAL_RTC_PERIOD  NUMERATOR DENOMINATOR
  2006-06-22 13:17     ` Gary Thomas
@ 2006-06-22 13:43       ` David Fernandez
  2006-06-22 14:12         ` Moussa Ba
  0 siblings, 1 reply; 7+ messages in thread
From: David Fernandez @ 2006-06-22 13:43 UTC (permalink / raw)
  To: Gary Thomas; +Cc: birahim.fall, ecos-discuss

On Thu, 2006-06-22 at 07:17 -0600, Gary Thomas wrote:
> David Fernandez wrote:
> > On Thu, 2006-06-22 at 13:56 +0100, David Fernandez wrote:
> >   
> >> On Wed, 2006-06-21 at 09:19 +0200, FALL wrote:
> >>     
> >>> Good Day, I have successfully compiled and ran ecos on an oki platform.
> >>> I am however not understanding how to setup the NUMERATOR DENOMINATOR
> >>> RTC_PERIOD per my platform specs. I have read the documentation but I am
> >>> still not clear on what values I should use.  Specifically, my processor
> >>> is runningat 33Mhz, when the hal_clock_initialize is called, what is the
> >>> relationship between that and the above mentioned values.
> >>>
> >>> Moussa
> >>> hi Moussa try this config:
> >>> cdl_component CYGNUM_HAL_CPUCLOCK {
> >>>         display       "cpu clock"
> >>>       
> >>           display       "cpu clock (Mhz.)"
> >>     
> >>>         flavor        data
> >>>         calculated 33000000
> >>> 	no_define
> >>> 	define -file system.h CYGNUM_HAL_CPUCLOCK
> >>>         description   "Frequency of cpu clock in Hz."
> >>>     }
> >>> ....
> >>> # Real-time clock/counter specifics
> >>>     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
> >>>         display       "Real-time clock constants"
> >>>         flavor        none
> >>>
> >>>         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
> >>>             display       "Real-time clock numerator"
> >>>       
> >>               display       "Real-time clock numerator (nanoseconds per second)"
> >>     
> >>>             flavor        data
> >>>             default_value 1000000000
> >>>         }
> >>>         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
> >>>             display       "Real-time clock denominator"
> >>>       
> >>               display       "Real-time clock denominator (wraps per second)"
> >>     
> >>>             flavor        data
> >>>             default_value 100
> >>>         }
> >>>         cdl_option CYGNUM_HAL_RTC_PERIOD {
> >>>             display       "Real-time clock period"
> >>>       
> >>               display       "Real-time clock period (ticks per wrap)"
> >>     
> >>>             flavor        data
> >>>             default_value (CYGNUM_HAL_CPUCLOCK/CYGNUM_HAL_RTC_DENOMINATOR) -1
> >>>         }
> >>>     }
> >>>       
> >> The way I see that in my intel platform is as modified above.
> >>
> >> The DENOMINATOR allows you to calculate ticks and specifies the OS timer
> >> "tick" (usually 10 milliseconds)
> >>
> >> The NUMERATOR allows you to convert periods into frequencies and
> >> viceversa (periods in nanoseconds to/from frequencies in Mhz.)
> >>
> >> The only reason you want to change DENOMINATOR is to get a different
> >> time granularity in the OS.
> >>
> >> The only reason you want to change the NUMERATOR is if you need to use
> >> different units of periods or frequencies becuase may be that the
> >> calculi you need to do exceeds the numerical capacity of your scalar
> >> types.
> >>
> >> David.
> >>     
> >
> > WARNING: The NUMERATOR value is used when programing some hardware
> > timer... but hardware could impose limitations on this value that should
> > be noted in the cdl legal_values..., lets say for example, that if your
> > CPU/Timer frequency is very high, and your hardware timer counter
> > register is small (16 bit for example), you can't get good values for
> > small PERIODs, because won't fit in 0-65535 range.
> >
> >
> >   
> This isn't strictly correct.
> 
> CYGNUM_HAL_RTC_NUMERATOR describes the granularity of the timer values.  
> The default specifies nano-seconds.
OK, you mean the granularity or precision for hardware tick times,
right?
I agree with that definition, just seem good to me to give the practical
usage for that granularity description.
> 
> CYGNUM_HAL_RTC_DENOMINATOR is how many times the system clock interrupts 
> per second.  This is simply
> information to the kernel to know how to interpret time when it gets an 
> RTC interrupt.
I meant that when I said wraps per second... may be wrap wasn't the
right word...
> 
> CYGNUM_HAL_RTC_PERIOD is the value which is programmed into your 
> hardware "clock".  It needs to be adjusted
> so that the clock will generate interrupts at 
> CYGNUM_HAL_RTC_DENOMINATOR/second.
Agreed.
> 
> Typically, one only needs to adjust CYGNUM_HAL_RTC_PERIOD based on the 
> hardware.  If you want the system 'tick'
> to be faster than the default 10ms, then adjust 
> CYGNUM_HAL_RTC_DENOMINATOR (and make sure that the value of
> CYGNUM_HAL_RTC_PERIOD tracks)
> 
> 
> 
I meant that too, I just call that the granularity of OS "software"
timer...
And as mentioned in my last email, sometimes the hardware doesn't allow
any PERIOD value...
Don't you think could be good to put a platform specific legal_values
somewhere to avoid wrong combinations of NUMERATOR/DENOMINATOR?

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ECOS] Re: RE : [ECOS] Understanding CYGNUM_HAL_RTC_PERIOD  NUMERATOR  DENOMINATOR
  2006-06-22 13:43       ` David Fernandez
@ 2006-06-22 14:12         ` Moussa Ba
  2006-06-22 14:35           ` David Fernandez
  0 siblings, 1 reply; 7+ messages in thread
From: Moussa Ba @ 2006-06-22 14:12 UTC (permalink / raw)
  To: David Fernandez; +Cc: Gary Thomas, birahim.fall, ecos-discuss

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.

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

Moussa
David Fernandez wrote:
> On Thu, 2006-06-22 at 07:17 -0600, Gary Thomas wrote:
>   
>> David Fernandez wrote:
>>     
>>> On Thu, 2006-06-22 at 13:56 +0100, David Fernandez wrote:
>>>   
>>>       
>>>> On Wed, 2006-06-21 at 09:19 +0200, FALL wrote:
>>>>     
>>>>         
>>>>> Good Day, I have successfully compiled and ran ecos on an oki platform.
>>>>> I am however not understanding how to setup the NUMERATOR DENOMINATOR
>>>>> RTC_PERIOD per my platform specs. I have read the documentation but I am
>>>>> still not clear on what values I should use.  Specifically, my processor
>>>>> is runningat 33Mhz, when the hal_clock_initialize is called, what is the
>>>>> relationship between that and the above mentioned values.
>>>>>
>>>>> Moussa
>>>>> hi Moussa try this config:
>>>>> cdl_component CYGNUM_HAL_CPUCLOCK {
>>>>>         display       "cpu clock"
>>>>>       
>>>>>           
>>>>           display       "cpu clock (Mhz.)"
>>>>     
>>>>         
>>>>>         flavor        data
>>>>>         calculated 33000000
>>>>> 	no_define
>>>>> 	define -file system.h CYGNUM_HAL_CPUCLOCK
>>>>>         description   "Frequency of cpu clock in Hz."
>>>>>     }
>>>>> ....
>>>>> # Real-time clock/counter specifics
>>>>>     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
>>>>>         display       "Real-time clock constants"
>>>>>         flavor        none
>>>>>
>>>>>         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
>>>>>             display       "Real-time clock numerator"
>>>>>       
>>>>>           
>>>>               display       "Real-time clock numerator (nanoseconds per second)"
>>>>     
>>>>         
>>>>>             flavor        data
>>>>>             default_value 1000000000
>>>>>         }
>>>>>         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
>>>>>             display       "Real-time clock denominator"
>>>>>       
>>>>>           
>>>>               display       "Real-time clock denominator (wraps per second)"
>>>>     
>>>>         
>>>>>             flavor        data
>>>>>             default_value 100
>>>>>         }
>>>>>         cdl_option CYGNUM_HAL_RTC_PERIOD {
>>>>>             display       "Real-time clock period"
>>>>>       
>>>>>           
>>>>               display       "Real-time clock period (ticks per wrap)"
>>>>     
>>>>         
>>>>>             flavor        data
>>>>>             default_value (CYGNUM_HAL_CPUCLOCK/CYGNUM_HAL_RTC_DENOMINATOR) -1
>>>>>         }
>>>>>     }
>>>>>       
>>>>>           
>>>> The way I see that in my intel platform is as modified above.
>>>>
>>>> The DENOMINATOR allows you to calculate ticks and specifies the OS timer
>>>> "tick" (usually 10 milliseconds)
>>>>
>>>> The NUMERATOR allows you to convert periods into frequencies and
>>>> viceversa (periods in nanoseconds to/from frequencies in Mhz.)
>>>>
>>>> The only reason you want to change DENOMINATOR is to get a different
>>>> time granularity in the OS.
>>>>
>>>> The only reason you want to change the NUMERATOR is if you need to use
>>>> different units of periods or frequencies becuase may be that the
>>>> calculi you need to do exceeds the numerical capacity of your scalar
>>>> types.
>>>>
>>>> David.
>>>>     
>>>>         
>>> WARNING: The NUMERATOR value is used when programing some hardware
>>> timer... but hardware could impose limitations on this value that should
>>> be noted in the cdl legal_values..., lets say for example, that if your
>>> CPU/Timer frequency is very high, and your hardware timer counter
>>> register is small (16 bit for example), you can't get good values for
>>> small PERIODs, because won't fit in 0-65535 range.
>>>
>>>
>>>   
>>>       
>> This isn't strictly correct.
>>
>> CYGNUM_HAL_RTC_NUMERATOR describes the granularity of the timer values.  
>> The default specifies nano-seconds.
>>     
> OK, you mean the granularity or precision for hardware tick times,
> right?
> I agree with that definition, just seem good to me to give the practical
> usage for that granularity description.
>   
>> CYGNUM_HAL_RTC_DENOMINATOR is how many times the system clock interrupts 
>> per second.  This is simply
>> information to the kernel to know how to interpret time when it gets an 
>> RTC interrupt.
>>     
> I meant that when I said wraps per second... may be wrap wasn't the
> right word...
>   
>> CYGNUM_HAL_RTC_PERIOD is the value which is programmed into your 
>> hardware "clock".  It needs to be adjusted
>> so that the clock will generate interrupts at 
>> CYGNUM_HAL_RTC_DENOMINATOR/second.
>>     
> Agreed.
>   
>> Typically, one only needs to adjust CYGNUM_HAL_RTC_PERIOD based on the 
>> hardware.  If you want the system 'tick'
>> to be faster than the default 10ms, then adjust 
>> CYGNUM_HAL_RTC_DENOMINATOR (and make sure that the value of
>> CYGNUM_HAL_RTC_PERIOD tracks)
>>
>>
>>
>>     
> I meant that too, I just call that the granularity of OS "software"
> timer...
> And as mentioned in my last email, sometimes the hardware doesn't allow
> any PERIOD value...
> Don't you think could be good to put a platform specific legal_values
> somewhere to avoid wrong combinations of NUMERATOR/DENOMINATOR?
>
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [ECOS] Re: RE : [ECOS] Understanding CYGNUM_HAL_RTC_PERIOD  NUMERATOR DENOMINATOR
  2006-06-22 14:12         ` Moussa Ba
@ 2006-06-22 14:35           ` David Fernandez
  0 siblings, 0 replies; 7+ messages in thread
From: David Fernandez @ 2006-06-22 14:35 UTC (permalink / raw)
  To: Moussa Ba; +Cc: Gary Thomas, birahim.fall, ecos-discuss

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-06-22 14:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-21  7:19 [ECOS] RE : [ECOS] Understanding CYGNUM_HAL_RTC_PERIOD NUMERATOR DENOMINATOR FALL
2006-06-22 12:56 ` [ECOS] " David Fernandez
2006-06-22 13:05   ` David Fernandez
2006-06-22 13:17     ` Gary Thomas
2006-06-22 13:43       ` David Fernandez
2006-06-22 14:12         ` Moussa Ba
2006-06-22 14:35           ` David Fernandez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).