[Tinyos-help] porting tinyos2.x to atmega128-based board(bigAVR6) /timer0 - issue

Harald Glanzer harald.glanzer at gmail.com
Fri Nov 12 09:13:42 PST 2010


at first, deactivate async - mode in

async command void TimerAsync.setTimer0Asynchronous()
   //ASSR |= 1 << AS0;
   ASSR &= 1 << AS0;

after that, it seems that switching to cpu-clk causes a problem with
the sleep-mode.
so i changed McuSleepC.nc(same directory) / getPowerState() so that it
always returns


i think thats it.

i also changed something in platforms/mica/MeasureClock.nc - but i'm
not sure if that's really necessary:
there are 2 lines

while (TCNT0 == now) ;

be aware that your counter should now be firing with a much greater
frequency than it would do with the external clock -
so if you are using a periodic timer for toggling a led for example,
it could *look* like there's no change...

good luck & keep me updated,

On Fri, Nov 12, 2010 at 5:47 PM, Jingyao <jingyaoooo at gmail.com> wrote:
> Can you specify what changes have you made to the source code?
> Thanks.
> -----Original Message----- From: Harald Glanzer
> Sent: November 11, 2010 3:07 PM
> To: tinyos-help at millennium.berkeley.edu
> Subject: [Tinyos-help] porting tinyos2.x to atmega128-based board(bigAVR6)
> /timer0 - issue
> hey folks,
> i'm trying to port tinyos 2.x to the bigAVR6 - platform. this is a
> developmentboard designed for avr-mcu.
> i'm using an atmega128 on this board. as skeleton is used the micaX -
> platform-files.
> timer0 at micaX gets it's clock from an external source, but i have to
> use the internal cpu-clk.
> i already get TimerX.fired() - events(Timer<TMilli>) after some minor
> modifications - but i can't change the period
> of this events.
> for Timer<TMilli> 8bit - timer0 is used in CTC - mode, but i can't
> figure out how the compare-value OCR0 is calculated
> and where it is set.
> could someone please give me an approximate overview about the
> atmega128 - timerstructure on mica-platforms
> and point me into the right direction?
> thx,
> harri
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

More information about the Tinyos-help mailing list