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
us/1000, which is a far more expensive operation than pseudo ms =
pseudo us
10. This is why I assume (and there's my problem of course...)
that the
original design decided to use 2^10Hz for "milliseconds" and 2^20Hz
for "microseconds" and then selected the clock sources accordingly.
It does. It turns out the operation is only expensive because the
msp430-gcc doesn't do multiply well, so it is disabled in
compilation. Specifically, it can produce incorrect output (doesn't
multiply right) and can generate output that the assembler rejects.
If you look at the Boomerang code, there are a couple places where
multiplication is commonly but narrowly used (e.g., the random number
generator) that they use assembly (well, directly address registers).
Are we talking from different sides of the same point, or am I
still missing
it (the point)?
Nope, you're right on.
The one thing is that as soon as you have a 16MHz clock you can do
1024Hz perfectly (15625 ticks).
Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help