<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    On 05/17/2012 05:54 AM, Cláudio Silva wrote:
    <blockquote
cite="mid:CAE4js0QCMwbc_7O=5av6yFTr6=n=9aBQL9Zw1NZW+uDRzbYSjw@mail.gmail.com"
      type="cite">
      <pre wrap="">Hello Luca,

The timer unit has two different stages:
The prescaler is clocked by the system clock and decremented on each
clock cycle. When the prescaler underflows, it is reloaded from the
prescaler reload register and a timer tick is generated for the two
timers and watchdog
This prescaler tick will decrement the timer count. The clock tick to
the processor will only be generated when the timer count underflows.

The value MICROSECONDS_PER_TICK will be used to program the timer
count; therefore your real clock tick interrupt will occur with a
MICROSECONDS_PER_TICK period.
(<a class="moz-txt-link-freetext" href="http://git.rtems.org/rtems/tree/c/src/lib/libbsp/sparc/leon2/clock/ckinit.c">http://git.rtems.org/rtems/tree/c/src/lib/libbsp/sparc/leon2/clock/ckinit.c</a>)
</pre>
    </blockquote>
    FWIW 10000 microseconds is 10 milliseconds. That is the default<br>
    clock tick quantum. <br>
    <br>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <a
href="http://www.rtems.org/onlinedocs/releases/rtemsdocs-4.10.2/share/rtems/html/c_user/c_user00426.html">http://www.rtems.org/onlinedocs/releases/rtemsdocs-4.10.2/share/rtems/html/c_user/c_user00426.html</a><br>
    <br>
    #define CONFIGURE_MICROSECONDS_PER_TICK 1000<br>
    <br>
    before confdefs.h is included will change it to 1 millisecond. :)<br>
    <br>
    --joel<br>
    <blockquote
cite="mid:CAE4js0QCMwbc_7O=5av6yFTr6=n=9aBQL9Zw1NZW+uDRzbYSjw@mail.gmail.com"
      type="cite">
      <pre wrap="">
Regards,
Cláudio

On Thu, May 17, 2012 at 11:10 AM, Luca Cinquepalmi
<a class="moz-txt-link-rfc2396E" href="mailto:cinquepalmi@planetek.it"><cinquepalmi@planetek.it></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hi all,
I'm working with a leon2 processor board having:

cpu clock = 16MHz
prescaler value = 1023 (every 1024 cpu clock a tick is generated)

In theory MICROSECONDS_PER_TICK should be

((cpu clock)^(-1))*1024 = 64

bu it's a strange value (usually it's around 10000). Can you give me some
explenation?
Thank you

    Luca


_______________________________________________
rtems-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a>
<a class="moz-txt-link-freetext" href="http://www.rtems.org/mailman/listinfo/rtems-users">http://www.rtems.org/mailman/listinfo/rtems-users</a>

</pre>
      </blockquote>
      <pre wrap="">
_______________________________________________
rtems-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a>
<a class="moz-txt-link-freetext" href="http://www.rtems.org/mailman/listinfo/rtems-users">http://www.rtems.org/mailman/listinfo/rtems-users</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Joel Sherrill, Ph.D.             Director of Research&  Development
<a class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com">joel.sherrill@OARcorp.com</a>        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985

</pre>
  </body>
</html>