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

mturon at xbow.com mturon at xbow.com
Sun Aug 21 22:19:35 PDT 2005


Hi David,

Yes, the original Timer32khz timer was divided by 32 in the hardware, and
passed-through unmodified to TimerMilli.  Question 3 would be returning to
this original design (modeled after tinyos-1.x implementation.)

Now the 32khz timer is undivided in hardware.  TimerMilli is generated with
TransformCounterC and TransformAlarmC.  If there is a bug in the radio now,
it may be because the timer transform is not being used properly, or there
is a bug in it.

I do not recall reading about different overflow behavior for undivided
timers in the atmega128 datasheet.

Martin 
__________________________________________________
Martin Turon  |  Crossbow Technology, Inc.

-----Original Message-----
From: tinyos-2.0wg-bounces at Mail.Millennium.Berkeley.EDU
[mailto:tinyos-2.0wg-bounces at Mail.Millennium.Berkeley.EDU] On Behalf Of
David Gay
Sent: Friday, August 19, 2005 5:22 PM
To: tinyos2 group
Subject: [Tinyos-2.0wg] mica2 timer / problems @ 32kHz

While testing the prerelease, I found that the radio no longer
appeared to work with any reliability... Further investigation
suggested the problem was with timers, and much further investigation
suggests that the atmega128 loses timer0 overflow interrupts when the
timer0 compare register is 254 or 255 (at least when it's running w/o
a divider).

Question 1: has anyone else seen effects like this with the atmega128
timer0? Or is some other mysterious bug causing the problem? (note
that just avoiding 254 or 255 doesn't seem to quite make problems go
away, though I could at least get a regular 1Hz blink when the radio
was enabled...)

Question 2: the problem can be (apparently, at least) alleviated by
using a 4kHz basic clock rate (i.e., divide by 8). Is this a practical
solution? (i.e., will it work for micaz?)

Question 3: the easiest fix for the prerelease would seem to be to
remove the 32kHz timer, and just run timer0 at 1kHz. Comments?

I'll try and create a more isolated test case Monday.

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
_______________________________________________
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