I think it's due to the controller clock xtal not being an even
multiple of 10, probably so baud-rates come out right. I doubt
that anyone is gonna fix it because it would never come out
just right anyway. But you could do the float multiply in your
code to try to compensate.

MS

Mala wrote:
I was writing a simple program to send a periodic message and ran them on
tmotes.  That time, I noticed that the messages were appearing at an
interval of 5.85 seconds instead of the 6 seconds that I had programmed.  On
further debugging I noticed that the following code in Timer library command result_t Timer.start[uint8_t num]( char type, uint32_t milli )
  {
    switch( type )
    {
      case TIMER_REPEAT:
        return setTimer( num, milli*32, TRUE );

      case TIMER_ONE_SHOT:
        return setTimer( num, milli*32, FALSE );
    }

    return FAIL;
  }

Here per millisecond is considered to be 32 ticks, while it actually is
32.768 ticks.  This error led to the difference that I noticed in the timing
of my messages.

Why is this done?  Is there any particular reason for doing an integer
operation where we should be doing a floating point operation?  Is there any
plan to fix the same?


Regards,
Mala



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

Reply via email to