Jose,

If you check TimerM.nc, you will notice that the fired event is actually
signaled from a task, not directly from the clock interrupt. This means
that if there are multiple tasks pending in the scheduler's FIFO, the
fired event will be delayed. In addition, this delay will be pretty
nondeterministic. 

You want to avoid this if you have time-critical operations to perform.
You should use the clock interrupt directly (e.g. Clock.fired -- you
need to find a clock that is not used).

The same applies to the message timestamping. It has to be done in the
SFD interrupt handler, not in ReceiveMsg.receive, which is called from a
task.

Janos

-----Original Message-----
From: Jose L. Ponce [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 03, 2006 12:33 PM
To: Janos Sallai
Cc: [email protected]
Subject: RE: [Tinyos-help] Problems with Time Sync

Janos,

thanks for your quick answer. I noticed, as you said, that a lot of my
problems might be related to the PC/motes interaction. However, I fail
to understand what you mean with tasks/interruptions. Are you suggesting
I should create interruptions (async command or event) which would be
called from ReceiveMsg.receive/Timer.fired in which to perform the
operations I want to make sure they happen with no delay?

Thanks,

- Jose

> Try to avoid doing anything that is time critical in task context.
E.g.
> timestamping a message in ReceiveMsg.receive is inadequate, because
it's
> called from a task. Similarly, Timer.fired is also signaled from a
task,
> which has a non-negligible jitter if you want to use it for timesync.
> 
> Doing as much as possible from within the interrupt handlers would
solve
> much of your issues. However, syncing with the PC is still kind of
> problematic, since the time difference between sending out a message
> from your java app and receiving it on the mote has a pretty bad
> variance...
> 
> Janos
> 



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

Reply via email to