public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] Change system tick during runtime
@ 2003-10-01 13:16 Daniel Lidsten
  2003-10-01 13:31 ` Gary Thomas
  2003-10-01 17:06 ` Nick Garnett
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Lidsten @ 2003-10-01 13:16 UTC (permalink / raw)
  To: Gary Thomas; +Cc: eCos Discussion

> > Is there any way of changing the system tick during runtime? I have 
> > made a quick test by letting an application provided 
> variable be used 
> > when setting the decrementer in the HAL_CLOCK_*-functions. 
> This will 
> > make the system generate tick more or less often depending on the 
> > value set. However, the drawback is that the system expects that we 
> > have a heartbeat of 100Hz and that will differ when changing the 
> > decrementer. Is there any way to get around this? Is there 
> any way to 
> > change the CYGNUM_HAL_RTC_DENOMINATOR during runtime so that the 
> > change will affect every file that use it? I want to be 
> able to have 
> > 10000 ticks per second but then i also need to let the system know 
> > that we have 10000 ticks per seconds so that not all timeouts and 
> > stuff gets all confused.
> > 
> 
> Are you sure that you want the system clock to run at this 
> high of a frequency?  That means that every 100us you are 
> going to execute the clock handler, which oft times ends up 
> running the scheduler, etc. Unless you're on a blazingly fast 
> platform, this seems like too much overhead.
> 
> If you just want higher granularity timers or interrupts, how about 
> using a second timer for this purpose?
> 
> As for changing the clock frequency on the fly, I don't think eCos 
> is set up for this, nor (IMO) is it a good idea.
> 
> Maybe if you explain a little more the *why*, we can give you 
> some ideas on the *how*.

In my system i want to run a thread at regular intervals since it is a
control thread. It can be every 1ms but also every 50ms. Since i have to
run the thread faster then i can setup an alarm in the default
configuration where 10ms is the tick rate then i thought that perhaps i
could let the system generate ticks more often. This is why i altered
the tick generator.

In your probosed solution then i should setup a HW timer to generate an
interrupt every time i want to run the thread and then let the interrupt
DSR post a semaphore or some other trigger mechanism. Did i understand
it right? Is this the best way to accomplish the thread trigger?

Regards, Daniel Lidsten

--
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] 6+ messages in thread
* [ECOS] Change system tick during runtime
@ 2003-10-01 12:55 Daniel Lidsten
  2003-10-01 12:59 ` Slawek
  2003-10-01 13:03 ` Gary Thomas
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Lidsten @ 2003-10-01 12:55 UTC (permalink / raw)
  To: eCos Discussion

Hi,

Is there any way of changing the system tick during runtime? I have made
a quick test by letting an application provided variable be used when
setting the decrementer in the HAL_CLOCK_*-functions. This will make the
system generate tick more or less often depending on the value set.
However, the drawback is that the system expects that we have a
heartbeat of 100Hz and that will differ when changing the decrementer.
Is there any way to get around this? Is there any way to change the
CYGNUM_HAL_RTC_DENOMINATOR during runtime so that the change will affect
every file that use it? I want to be able to have 10000 ticks per second
but then i also need to let the system know that we have 10000 ticks per
seconds so that not all timeouts and stuff gets all confused.

Regards, Daniel Lidsten

--
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] 6+ messages in thread

end of thread, other threads:[~2003-10-01 17:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-01 13:16 [ECOS] Change system tick during runtime Daniel Lidsten
2003-10-01 13:31 ` Gary Thomas
2003-10-01 17:06 ` Nick Garnett
  -- strict thread matches above, loose matches on Subject: below --
2003-10-01 12:55 Daniel Lidsten
2003-10-01 12:59 ` Slawek
2003-10-01 13:03 ` Gary Thomas

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