MPC5200 RTEMS Tick

Joel Sherrill joel.sherrill at oarcorp.com
Thu Jan 25 18:08:47 UTC 2007


Simon Yuen wrote:
>
> I am a newbie to RTEMS and the MPC5200.   My project requires a timely 
> periodic task to run every 1ms but I am not sure how to approach 
> this.  Here are a few questions I hope someone can shed some light on.
>
>  
>
> 1)       If I set CONFIGURE_MICROSECONDS_PER_TICK to give me a 1ms 
> tick, how much overhead would this cause to program execution running 
> two tasks?  I like to use the rate monotonic manager to run a task 
> every 1ms.
>
>  
>
> 2)       On the other hand, if RTEMS is servicing ticks at 10ms and I 
> use an available timer to give me interrupts every 1ms to run an ISR.  
> How does this periodic interrupt affect task execution since RTEMS 
> needs to manage this interrupt?
>
>  
>
> 3)       Which is the better approach?
>
Approach 1 will probably work fine on a reasonably fast CPU.  With 
either approach, you have to account for the CPU time
used by getting an interrupt every millisecond, context switching to 
that task, and doing whatever it is you want to do.

Be careful because processing something at this rate can easily be a 
large percentage of the CPU load.

With approach one you get 10 ISRs per 10 milliseconds.  With approach 
two, you get 11.  So that is a factor in your decision.

You might be able to process each ISR in a "light" manner and every few 
ISRs do more processing.  It depends on the application.
For example, you might just sample something in the 1 millisecond ISR 
and every 10 milliseconds process them.

It all depends on what you are trying to do every millisecond.  If it 
takes you 250 microseconds to process it, then 25% of
your CPU is dedicated to that.  BIG MULTIPLIER on CPU load so design is 
critical.
>
>  
>
>  
>
>  
>
> Thank you
>
>  
>
>  
>
> Simon
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   




More information about the users mailing list