public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] RE: Re: How to set clock related options?
@ 2003-09-25 12:48 Savin Zlobec
  2003-09-25 13:33 ` Savin Zlobec
  0 siblings, 1 reply; 3+ messages in thread
From: Savin Zlobec @ 2003-09-25 12:48 UTC (permalink / raw)
  To: caocangmou; +Cc: ecos-discuss

caocangmou wrote:

>But, I got a configuration from template(Akizuki H8/3068) :
>           Real-time clock numerator : 1000000000
>           Real-time clock denominator : 100
>           Real-time clock base prescale : 8192 
>           Real-time clock period :10
>           OSC/Clock Frequency :20000000
>It seems not the case .What does period really mean?
>
CYGNUM_KERNEL_COUNTERS_RTC_PERIOD which defaults to  
CYGNUM_HAL_RTC_PERIOD is
used to initialize you system clock hardware. Ecos tick is usually 
implemented with a  hw timer which gives
periodic interrupts. The  CYGNUM_HAL_RTC_PERIOD is calculated so that 
you get an interrupt every
10ms (the default) and it depends on your timer hardware. Changing the 
tick requires setting the
CYGNUM_HAL_RTC_NUMERATOR, CYGNUM_HAL_RTC_DENOMINATOR and
CYGNUM_HAL_RTC_PERIOD (if it is not automatically calculated from the 
previous two - look how it is
calculated in cdl - it can only depend on your frequency - in that case 
it is probably set to 10ms).

savin


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

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

* [ECOS] RE: Re: How to set clock related options?
  2003-09-25 12:48 [ECOS] RE: Re: How to set clock related options? Savin Zlobec
@ 2003-09-25 13:33 ` Savin Zlobec
  2003-09-25 17:28   ` Nick Garnett
  0 siblings, 1 reply; 3+ messages in thread
From: Savin Zlobec @ 2003-09-25 13:33 UTC (permalink / raw)
  To: caocangmou; +Cc: ecos-discuss

Savin Zlobec wrote:

> caocangmou wrote:
>
>> But, I got a configuration from template(Akizuki H8/3068) :
>>           Real-time clock numerator : 1000000000
>>           Real-time clock denominator : 100
>>           Real-time clock base prescale : 8192           Real-time 
>> clock period :10
>>           OSC/Clock Frequency :20000000
>> It seems not the case .What does period really mean?
>>
> CYGNUM_KERNEL_COUNTERS_RTC_PERIOD which defaults to  
> CYGNUM_HAL_RTC_PERIOD is
> used to initialize you system clock hardware. Ecos tick is usually 
> implemented with a  hw timer which gives
> periodic interrupts. The  CYGNUM_HAL_RTC_PERIOD is calculated so that 
> you get an interrupt every
> 10ms (the default) and it depends on your timer hardware. Changing the 
> tick requires setting the
> CYGNUM_HAL_RTC_NUMERATOR, CYGNUM_HAL_RTC_DENOMINATOR and
> CYGNUM_HAL_RTC_PERIOD (if it is not automatically calculated from the 
> previous two - look how it is
> calculated in cdl - it can only depend on your frequency - in that 
> case it is probably set to 10ms). 

I just realized that what I said about the hw timer it is not entirely 
correct. The timer should only be able to generate
an interrupt after a desired amount of time. The kernel takes care of 
the periodic aspect by resetting the timer with
HAL_CLOCK_RESET in ISR.

savin



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

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

* Re: [ECOS] RE: Re: How to set clock related options?
  2003-09-25 13:33 ` Savin Zlobec
@ 2003-09-25 17:28   ` Nick Garnett
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Garnett @ 2003-09-25 17:28 UTC (permalink / raw)
  To: Savin Zlobec; +Cc: caocangmou, ecos-discuss

Savin Zlobec <savin@elatec.si> writes:

> Savin Zlobec wrote:
> 
> > caocangmou wrote:
> >
> >> But, I got a configuration from template(Akizuki H8/3068) :
> >>           Real-time clock numerator : 1000000000
> >>           Real-time clock denominator : 100
> >>           Real-time clock base prescale : 8192           Real-time
> >> clock period :10
> >>           OSC/Clock Frequency :20000000
> >> It seems not the case .What does period really mean?
> >>
> > CYGNUM_KERNEL_COUNTERS_RTC_PERIOD which defaults to
> > CYGNUM_HAL_RTC_PERIOD is
> > used to initialize you system clock hardware. Ecos tick is usually
> > implemented with a  hw timer which gives
> > periodic interrupts. The  CYGNUM_HAL_RTC_PERIOD is calculated so
> > that you get an interrupt every
> > 10ms (the default) and it depends on your timer hardware. Changing
> > the tick requires setting the
> > CYGNUM_HAL_RTC_NUMERATOR, CYGNUM_HAL_RTC_DENOMINATOR and
> > CYGNUM_HAL_RTC_PERIOD (if it is not automatically calculated from
> > the previous two - look how it is
> > calculated in cdl - it can only depend on your frequency - in that
> > case it is probably set to 10ms).
> 
> I just realized that what I said about the hw timer it is not entirely
> correct. The timer should only be able to generate
> an interrupt after a desired amount of time. The kernel takes care of
> the periodic aspect by resetting the timer with
> HAL_CLOCK_RESET in ISR.

Well, if the timer can be configured to generate periodic interrupts
then that is what should be done -- you can then leave the
HAL_CLOCK_RESET() macro empty. It is much better to let the hardware
keep time than try to do it in software. Unless you are very careful,
reloading the timer in HAL_CLOCK_RESET() can lead to clock drift.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


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

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

end of thread, other threads:[~2003-09-25 17:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-25 12:48 [ECOS] RE: Re: How to set clock related options? Savin Zlobec
2003-09-25 13:33 ` Savin Zlobec
2003-09-25 17:28   ` Nick Garnett

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