The 15.4 MAC specification says that you need a 62500hz timer with max
40ppm precision to be standards compliant. I'm afraid that you can't
make it with a 32kHz crystal that has 50ppm error.

Anyway, if you don't care about precision, you have the following two
options, none of them are particularly good solutions.

1. Disable MCU sleep. You can do it by implementing
McuPowerOverride.lowestState(), which returns ATM128_POWER_IDLE when
the radio stack is on. The MCU will draw around 20mA as a result.
2. Set up timer0 to 32kHz. Since HilTimerMilliC must have TMilli
precision, you need to create a new HilTimerMilliC that downconverts
the 32khz Atm128AlarmAsyncC to 1024Hz. You don't need to edit the
"core" TinyOS, just drop in your implementation of HilTimerMilliC to
the search path _preceding_ the one in platforms/mica. Notice that you
won't have a big improvement in terms of power consumption, because
timer0 is only 8-bits, and the MCU will wake up on overflow/compare.
Also, it takes a long time for the ATMega128 to wake up (around 2ms,
if I remember correctly), so that time is basically wasted as well. My
guess is that the MCU wouln't be sleeping in more that 50% of the time
this way, either.

Janos


2009/3/30 Daniel F. Piñeiro Santos <[email protected]>:
> Hi,
> I am trying to use the TKN154 implementation of IEEE 812.15.4 in Micaz. But
> one of the problems I am finding is that it relies on 62500hz timers.
> In telosb it is achieved with the 32khz default timer, but in MicaZ there's
> the problem T32khz timers stop counting when the mote enters in any
> power-save mode.
> This makes impossible to have "real time" measures for any synchronization
> protocol.
> Is there any easy way to change the use of timer0 or should I edit the
> "core" of TinyOS?
>
> Thanks in advance,
> Daniel FPS
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>

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

Reply via email to