On Sat, May 21, 2011 at 7:37 PM, Xiaowei <[email protected]> wrote:
> Thank you for your information, Eric. > I can get microsecond timing now, by calling Counter.get(), using interface > Counter<TMicro, uint16_t>, which is provided by Msp430CounterMicroC. > It also wraps up after some time, and I handled it in Counter.overflow > event. > So now the precision is enough, the problem is I can't get the time when > packets are actually transmitted.(when first bit hits the wireless medium) > Ah. Now we are getting down to the heart of the matter. The best you will be able to do is record the time when you tell the h/w that it has a complete packet (assuming you hand complete packets to the h/w, which is how I think the driver is currently written). That isn't the same as when the h/w actually starts to transmit. Unless the h/w provides a mechanism for timestamping in some fashion you can't find out this information. This is because the radio h/w is smart and handles actually hitting the medium indirectly relative to the s/w driver which is where you have time visibility. I don't think you can do what you seem to be trying to do. > sean > > On Sat, May 21, 2011 at 9:05 PM, Eric Decker <[email protected]> wrote: > >> >> This isn't a direct answer to what you are asking below. >> >> I've found that the code path for much of the msp430 timer interfaces can >> be somewhat longish. So when I've done uS timing I actually grab >> timestamps directly from the h/w. Timer A on my motes is what is running >> uis jiffies. Note I've said uis which is a binary microsecond. (you may >> also see the notation, bus, for binary micro second). So I grab TAR >> directly and use its value. The only problem with that is when it wraps >> you don't really have a way of knowing what happened. So this technique is >> only useable for events that are less then 64K uis in length. >> >> eric >> >> On Sat, May 21, 2011 at 5:14 PM, Xiaowei <[email protected]> wrote: >> >>> Hi all, >>> >>> I'm doing some experiment to record the exact time when packets start >>> transmission at the sending mote and being received at the receiving mote >>> with telosb motes in TinyOS 2.1.0. >>> These are the components and interface I'm using: >>> components Msp430CounterMicroC; >>> App.Counter -> Msp430CounterMicroC >>> uses interface Counter<TMicro, uint16_t>; >>> >>> To get rid of random delay, I also disabled csma by setting: >>> the default value of "ccaOn = TRUE" to "ccaOn = FALSE" in >>> tinyos-2.1.0/tos/chips/cc2420/csma/CC2420CsmaP.nc >>> >>> At the sending mote, I called Counter.get() in sendDone event handler, >>> and at the receiving mote I called Counter.get() in receive event handler. >>> It seems that the time recorded is not the exact time when the packet is >>> sent over the air. >>> >>> So I tried to use interface PacketTimeStamp<TMicro, uint16_t>, but got >>> the "no match" error for the line App.PacketTimeStamp->ActiveMessageC when >>> compiling the code, couldn't figure out why. Tried "include message.h in >>> module file", didn't work. >>> >>> There's also another interface RadioTimeStamping that provides event >>> transmittedSFD and receivedSFD, which satisfies my requirement. But it's >>> said that RadioTimeStamping is not supported in TinyOS 2.1. I tried to use >>> it by wire 'App.RadioTimeStamping->CC2420TransmitC.TimeStamp', got >>> compile error "cannot find TimeStamp". >>> >>> I have been stuck in this problem for a while, anyone knows how to do >>> this (Basically, get the time when packets actually being transmitted to the >>> air and being received)? >>> >>> Any help is greatly appreciated. >>> >>> Sean >>> >>> >>> >>> _______________________________________________ >>> Tinyos-help mailing list >>> [email protected] >>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help >>> >> >> >> >> -- >> Eric B. Decker >> Senior (over 50 :-) Researcher >> >> >> > -- Eric B. Decker Senior (over 50 :-) Researcher
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
