Re: [Tinyos-help] Simple question on TimerTMilli

2007-04-20 Thread Cory Sharp
On 4/20/07, Steve McKown [EMAIL PROTECTED] wrote: Hi Phil, On Thursday 19 April 2007 10:24, Philip Levis wrote: On Apr 19, 2007, at 7:37 AM, Steve McKown wrote: H In case you're wondering why it's set up this way: converting between powers of 2 needs only fast bit shifts. Far more

Re: [Tinyos-help] Simple question on TimerTMilli

2007-04-20 Thread Philip Levis
On Apr 20, 2007, at 8:49 AM, Steve McKown wrote: This assumes a certain source clock frequency, right? In one project, we used a true 8MHz (8*10^6, not 8*2^20) crystal to get true microsecond granularity out of Timer A (SMCLK/8). The problem is if you want true ms: true ms = true

[Tinyos-help] Simple question on TimerTMilli

2007-04-19 Thread Muhammad Azhar
Hi all, I apologise if this is a rather basic question, but to set a timer to fire exactly 1s periodically (using TimerTMilli), do I input startPeriodic(1000) or startPeriodic(1024)? 'Coz all the while, I've always used the former, but I realised that it's never 1 sec, always faster than that. A

Re: [Tinyos-help] Simple question on TimerTMilli

2007-04-19 Thread Steve McKown
Hi, On Thursday 19 April 2007 05:53, Muhammad Azhar wrote: Hi all,    I apologise if this is a rather basic question, but to set a timer to fire exactly 1s periodically (using TimerTMilli), do I input startPeriodic(1000) or startPeriodic(1024)?  'Coz all the while, I've always used the

Re: [Tinyos-help] Simple question on TimerTMilli

2007-04-19 Thread Urs Hunkeler
Hi, Usually a clock on a microcontroller is implemented by using a clock crystal on an asynchronous counter. When the counter overflows (or reaches 0) it generates an interrupt, which is then used to update the clock. A typical frequency for such a crystal would be 32.768 kHz, which is 2^15. The

Re: [Tinyos-help] Simple question on TimerTMilli

2007-04-19 Thread Philip Levis
On Apr 19, 2007, at 7:37 AM, Steve McKown wrote: H In case you're wondering why it's set up this way: converting between powers of 2 needs only fast bit shifts. Far more efficient than, say, dividing by 1000. Actually, the reason has more to do with error and the effort/cost it