Dear all, I have been working on a time sync protocol between the pc and the motes. I think I have solved most of the problems on the java side and I would like to improve things on the motes.
My test for the time-sync consists of running the sync protocol every i.e. 60 seconds and sending messages to 2 motes every 2 seconds which say: "at time X, change the DAC". I use a digital oscilloscope to monitor the outputs and see how good the response is (difference between both responses). As for now, I have noticed that for each resync the delay in the changes of the DAC outputs remains constant, but there are great differences between two resyncs: one might give a difference of 1ms and the next a difference of 20ms. I am trying to reduce this variability as much as possible As Janos suggested, I have looked for a way to do the timestamping with the SFD interrupt. Looking through CC2420RadioM, I have noticed async event result_t SFD.captured(uint16_t time). Looks like there is a timestamping going on already, and I have read somewhere that it is recorded on rxbufptr->time, so I've been trying to extract it on message reception (In ReceiveMsg.receive) like this: event TOS_MsgPtr ReceiveMsg.receive( TOS_MsgPtr msg ) { struct TOS_Msg* r_time; r_time = (struct TOS_Msg *)msg->data; t2 = (r_time->time)/0.032; } But it doesn't seem to be working. I get three or four fixed values every time a synchronisation is run (0 and 10013) come to mind... I have tried vu's timestamping as well but on a call to get timestamp t2 is always 0. Does anyone know a simple way to get a timestamping with the SFD interrupt handler? Or a suggestion as to to why a resynchronisation has such a big variability while the delays are so constant (which would suggest that the problem is not on the timers, but on the send/receive interfaces) and how to improve it? Any comments are appreciated. Thank you, - Jose. _______________________________________________ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help