Hi Elena,

The RFA1 has a symbol counter timer which runs at 62.5 KHz. It also
has the RTC timer which is sourced from the 32768 external crystal. If
I remember correctly, then the RTC clock can only be used with the
8-bit Timer0 which has lots of bugs. So instead the TMilli is sourced
from the symbol counter clock. So the error you are seeing is the
deviation between the 62500 vs 65536, their quotient is 1.048576 which
gives you 0.5 sec error in 10 seconds.

Now the big question is how to configure it right. You should read the
README and especially the TimerConfig.h from here

https://github.com/tinyos/tinyos-main/tree/master/tos/chips/atm128rfa1/timer

It might be enough to change/redefine the RTC_TIMER_HZ value, but I am
not sure, you need to experiment and read the code.

Best,
Miklos


On Thu, Jul 6, 2017 at 10:18 AM, Elena Chervakova
<elena.chervak...@imms.de> wrote:
> Hi all.
> We work on some experiments with TinyOS timers on RFA1 and RFR2 platforms. In
> both cases, there is a significant time deviation from the set timer interval
> and the actual time.
>
> To analyze the behaviour, we set a timer to 5 seconds using the TimerMilliC
> component by calling:
>
> call Timer.startPeriodic( 5120 );
>
> for this we have a constant error of 0.25 seconds per timer event. This 
> results
> in a deviation of 0.5 seconds per 10 seconds which is too much for our 
> application.
>
> The deviation was measured by toggling a GPIO pin at each timer.fired event:
>
> event void Timer0.fired() {
>     call Leds.led0Toggle();
> }
>
> and measuring the resulting signal via a scope. The behaviour happens with the
> default TinyOS implementation of atm128rfa1 (tos/chips/atm128rfa1/timer) on
> multiple platforms among them the ucmini. All show the same offset. In 
> contrast
> the same test with atmega1281-module result error <0.01s per 10s.
>
> Do you have any idea what might cause this behaviour?
>
> Best regards,
> Elena
>
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to