With "user level" code you have interrupts to deal with so the loop time
would only stochastically approach 1ms. That's what the Timer blocks of
the controller are for, but even then there may be some in-determinate
latency.

Real time, for whom?
MS


Heo Heo wrote:
I was curious if there is a way to write a task that runs exactly in 1ms, given that underlying hardware platform can be pre-determined (like Micaz, Mica2). In my mind, I was thinking of writing a for loop like:
  for (count=0; ;count++)
      x++;
I will start the For loop & set a timer that fires in 1ms, and measure the Count variable when the timer fires. Say, if this value is Count1ms, my task can be written as: for (i=0; i<Count1ms; i++) x++; I am not sure if this is the best way to do it. Can we do it by counting instructions, etc ? Thanks for your help.
------------------------------------------------------------------------
Food fight? <http://answers.yahoo.com/dir/index;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx?link=ask&sid=396545367> Enjoy some healthy debate in the Yahoo! Answers Food & Drink Q&A. <http://answers.yahoo.com/dir/index;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx?link=ask&sid=396545367>


------------------------------------------------------------------------

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to