First off, using timers, you're not going to get very precise timing
measurements.  Timers inherently introduce jitter since they are run
in synchronous context and are the result of a task being posted.

Second, calling getNow on two separate motes doesn't necessarily
correlate on some global time scale.  If you really need to do this in
software because of some algorithm you are implementing, you will need
to first run some sort of global time synchronization protocol so that
all of your nodes have the same notion of time.

That said, if you just want to know how long it takes to transmit a
packet between motes, and this time isn't something that a protocol
you are developing relies on, I would just suggesting hooking up an
oscilloscope to the two motes and toggling a pin on each of them.  On
the first, once its SFD byte has been sent out over the radio (an
interrupt is generated into the radio driver), and on the second, once
it receives the SFD byte (also an interrupt here).

Kevin

On 10/11/07, sara k <[EMAIL PROTECTED]> wrote:
> Hi,
> I would like to measure the time it takes to receive a packet from one
> mote to the next one.
> so I done the following:
> - I read the time at the first mote by using pkt->stime = call
> Timer0.getNow(); and send the packet to the next mote.
> - in the second mote again I read the time pkt->rtime = call Timer0.getNow();
> and calculate the difference rtime-stime.
> Is that right? or i have fist to synchronise the motes before doing
> that !  what do you think?
> what is the difference between get() and getNow()?
>
> Best
>   Sara
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>


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

Reply via email to