public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] clock resolution
@ 2001-04-23  5:40 Micha&lstrok
  2001-04-23  5:50 ` Gary Thomas
  2001-04-23 11:10 ` Jonathan Larmour
  0 siblings, 2 replies; 3+ messages in thread
From: Micha&lstrok @ 2001-04-23  5:40 UTC (permalink / raw)
  To: ecos-discuss

Hi,
I am beginner in eCos programming and I have some problems:

I want to set real time clock resolution to 1000 ticks/sec (or higher). Is
it available to set it from software using cyg_clock_set_resolution() ?
Setting dividend and divisor in cyg_resolution_t structure gives no effect
(cyg_clock_get_resolution() gives the same before-setting resolution value
=100).
I changed it in eCos ConfigTool, and after calling
cyg_clock_get_resolution() I got my setted resolution resolution, but some
function like cyg_thread_delay() or alarm functions work the same as with
default resolution value.

How to get 1000 or more ticks for a second ????

Greetings
--
Michał Oleńczuk
mailto: olenczuk@rts.com.pl
tel. 0604091867

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

* RE: [ECOS] clock resolution
  2001-04-23  5:40 [ECOS] clock resolution Micha&lstrok
@ 2001-04-23  5:50 ` Gary Thomas
  2001-04-23 11:10 ` Jonathan Larmour
  1 sibling, 0 replies; 3+ messages in thread
From: Gary Thomas @ 2001-04-23  5:50 UTC (permalink / raw)
  To: Michał +Cc: ecos-discuss

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 973 bytes --]

On 23-Apr-2001 Micha³ Oleñczuk wrote:
> Hi,
> I am beginner in eCos programming and I have some problems:
> 
> I want to set real time clock resolution to 1000 ticks/sec (or higher). Is
> it available to set it from software using cyg_clock_set_resolution() ?
> Setting dividend and divisor in cyg_resolution_t structure gives no effect
> (cyg_clock_get_resolution() gives the same before-setting resolution value
> =100).
> I changed it in eCos ConfigTool, and after calling
> cyg_clock_get_resolution() I got my setted resolution resolution, but some
> function like cyg_thread_delay() or alarm functions work the same as with
> default resolution value.

How do you mean "worked the same"?  cyg_thread_delay() takes a number of 'ticks'
as it's argument, so the only way to see if the value changes is by using some
outside observation (measure against a wall clock, for example).

> 
> How to get 1000 or more ticks for a second ????

What platform are you using?

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

* Re: [ECOS] clock resolution
  2001-04-23  5:40 [ECOS] clock resolution Micha&lstrok
  2001-04-23  5:50 ` Gary Thomas
@ 2001-04-23 11:10 ` Jonathan Larmour
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Larmour @ 2001-04-23 11:10 UTC (permalink / raw)
  To: Micha³ Oleñczuk
  Cc: ecos-discuss

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]

Micha³ Oleñczuk wrote:
> 
> Hi,
> I am beginner in eCos programming and I have some problems:
> 
> I want to set real time clock resolution to 1000 ticks/sec (or higher). Is
> it available to set it from software using cyg_clock_set_resolution() ?
> Setting dividend and divisor in cyg_resolution_t structure gives no effect
> (cyg_clock_get_resolution() gives the same before-setting resolution value
> =100).
> I changed it in eCos ConfigTool, and after calling
> cyg_clock_get_resolution() I got my setted resolution resolution, but some
> function like cyg_thread_delay() or alarm functions work the same as with
> default resolution value.
> 
> How to get 1000 or more ticks for a second ????

Setting the resolution like that will just change the resolution that the
system *thinks* it is using, but it won't actually use it!

What you probably want to do is change the CYGNUM_HAL_RTC_PERIOD option in
the CDL of the HAL for your target. This value is used to program the timer
on your board (or the on-chip timer if appropriate), and therefore you'll
have to choose the correct value according to the documentation of your
processor/board.

You then change one or both of CYGNUM_HAL_RTC_NUMERATOR and
CYGNUM_HAL_RTC_DENOMINATOR to _reflect_ the change you just made.

For example to increase the frequency by a factor of ten, you may have to
(for example) reduce the ..._PERIOD option by a factor of 10, and then
increase the ..._DENOMINATOR option by a factor of 10.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

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

end of thread, other threads:[~2001-04-23 11:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-23  5:40 [ECOS] clock resolution Micha&lstrok
2001-04-23  5:50 ` Gary Thomas
2001-04-23 11:10 ` Jonathan Larmour

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