[Tinyos-host-mote-wg] Re: [Tinyos-2.0wg] mica2 timer / problems @ 32kHz

David Gay dgay42 at gmail.com
Mon Aug 22 16:22:06 PDT 2005


On 8/22/05, Joe Polastre <joe.polastre at gmail.com> wrote:
> Yeah, the problem was the external crystal.  I would ditch that thing
> if I were you, as all of the B-MAC code that both Jason and I wrote
> assumes that you're using the internal oscillator instead of the
> external crystal.

It's not a wakeup from sleep problem (we haven't put the power
management in yet ;-)). It appears to be (at least partly) tied to
this note found deep in the atmega128 manual:

During asynchronous operation, the synchronization of the interrupt
flags for the
asynchronous timer takes three processor cycles plus one timer cycle.
The timer is
therefore advanced by at least one before the processor can read the timer value
causing the setting of the interrupt flag. The output compare pin is
changed on the
timer clock and is not synchronized to the processor clock.

So when you read a timer value of 0, it's probably(certainly?) from
the "next" cycle, but the pending-overflow interrupt flag doesn't tell
you... Fun!

There's a whole other bunch of async timer footnotes we should stare
at when we enable power management...

David

_______________________________________________
Tinyos-2.0wg mailing list
Tinyos-2.0wg at Mail.Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-2.0wg


More information about the Tinyos-host-mote-wg mailing list