Hi,

I'm working with telosb and I'm trying to find a solution to estimate the time taken by some operation accurately (micro second). I first tried the TimerMicro but as i found after in the mailing list (here http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2007-May/024953.html) I understood that it was not a good solution and followed the Cory's advice: trying with a Counter<TMicro,uint32_t> and then Counter<TMicro, uint16_t>. I made a very simple test program: an infinite loop in the Boot.booted event which calculate dt between 2 loops and generate a 0 or 1 on one of the pins of the mote if dt >= INTERVAL. Then i looked at the signal on an oscilloscope and measured the period of the "wave". I found that i can't have it < 16 us, ie with values of INTERVAL between 1 and 16-18 the period is the same. I wondered if it was normal since my program is only doing this. I have also another question, I got jitter in my signal and i would like to understand why, i thought that gpio.set, gpio.clr and counter.get were done in constant time.

here is my loop:

   event void Boot.booted()
   {
       uint16_t t;
       uint16_t t0 = call Counter0.get();
call outIO.makeOutput(); while(TRUE)
       {
           t = call Counter0.get();
           if(t-t0 >= INTERVAL)
           {
               if( up )
                   call outIO.set();
               else
                   call outIO.clr();

              up = !up;
t0 = t ;
           }
       }
   }

Maybe I made something wrong. Can anyone help me with it?
Thanks

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

Reply via email to