#define CONFIGURE_MICROSECONDS_PER_TICK

Joel Sherrill joel.sherrill at OARcorp.com
Thu May 17 12:43:53 UTC 2012


On 05/17/2012 05:54 AM, Cláudio Silva wrote:
> 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.
> (http://git.rtems.org/rtems/tree/c/src/lib/libbsp/sparc/leon2/clock/ckinit.c)
FWIW 10000 microseconds is 10 milliseconds. That is the default
clock tick quantum.

http://www.rtems.org/onlinedocs/releases/rtemsdocs-4.10.2/share/rtems/html/c_user/c_user00426.html

#define CONFIGURE_MICROSECONDS_PER_TICK 1000

before confdefs.h is included will change it to 1 millisecond. :)

--joel
> Regards,
> Cláudio
>
> On Thu, May 17, 2012 at 11:10 AM, Luca Cinquepalmi
> <cinquepalmi at planetek.it>  wrote:
>> 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
>> rtems-users at rtems.org
>> http://www.rtems.org/mailman/listinfo/rtems-users
>>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users


-- 
Joel Sherrill, Ph.D.             Director of Research&   Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
     Support Available             (256) 722-9985


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20120517/2e6ebadb/attachment.html>


More information about the users mailing list