[Tinyos-help] Time counting

Michael Newman mnewman at dragonnorth.com
Wed Jan 3 14:42:43 PST 2007


I actually discovered this problem when I started to implement a time
synchronization protocol. I am trying to log the time a sample was actually
taken on the mote and when that mote comes back in radio range report the
list of samples and times they were taken.
 
The problem is that my logs of when the samples were taken bear only causal
relation to wall clock time.
 
The hardware is capable of much more than this. I think there is a watch
crystal on the Mica2 and Mica2Dot motes and time could be accurately counted
and reported.

  _____  

From: cory.sharp at gmail.com [mailto:cory.sharp at gmail.com] On Behalf Of Cory
Sharp
Sent: Wednesday, January 03, 2007 5:27 PM
To: Michael Newman
Cc: tinyos-help at millennium.berkeley.edu
Subject: Re: [Tinyos-help] Time counting


The timer system in TinyOS does not guarantee any particular accuracy, only
that "accuracy MUST remain reasonable", probably something like +/-10% of
the declared units.  This is for various reasons including but not limited
to temperature, voltage, and manufacturing variations that affect hardware
clocks, particular features or lack thereof offered by a microcontroller or
its hardware platform, and timer computation choices within TinyOS. 

Probably the time units are actually 1024 ticks per second not 1000.  Even
so, as listed above, there are many reasons why it may not be for your
particular platform in general or given its current environmental and
electrical conditions. 

If you need more accuracy, it is best that you incorporate a time
synchronization protocol into your application.

Best,
Cory


On 1/3/07, Michael Newman <mnewman at dragonnorth.com> wrote: 

I have a complex application with a half dozen timers. One of the timers is
used to count a clock once per second. The timer is set up with a call that
looks like this:
 
        call TimerClock.start(TIMER_REPEAT,1000);
 
The timer is never stopped or changed. 
 
I count a variable in the TimerClock.fired event. I expect this variable to
reflect the number of seconds since the node has booted. What I observe is
that the counter counts faster than the actual number of elapsed seconds.
 
Given other activities and the possibility of interrupts being off for some
periods I do not expect the timer to fire at an exact interval, what I do
expect is that the frequency of the timer will be exact with some jitter to
the individual firing events. I also expect the timer to never fire early.
 
Has anyone verified that timers actually fire on an exact interval and that
time is neither lost nor gained?
 

 

  _____  


Michael Newman

Dragonnorth Group


319 Dean Rd.
Brookline, MA 02445

Cell: 617 821-4608
Home: 617 566-7975
Fax: 617 566-7975


www.dragonnorth.com <http://www.dragonnorth.com/> 

mnewman at dragonnorth.com

 

_______________________________________________
Tinyos-help mailing list
Tinyos-help at Millennium.Berkeley.EDU
<mailto:Tinyos-help at Millennium.Berkeley.EDU> 
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
<https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help> 




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20070103/aa8224dd/attachment.html


More information about the Tinyos-help mailing list