[Tinyos-help] watchdog -- atmega128 vs 1281

Michael Schippling schip at santafe.edu
Tue Nov 4 09:36:05 PST 2008


Watchdogs usually just force a reboot of the controller
if they are not cancelled periodically. I would compare
the reboot techniques of the atmega's in question in their
respective manuals to see if there is some difference.

MS

Para Lee wrote:
> Hi All,
>   I need a watchdog in my app and I'm using IRIS platform (use 
> atmega1281 as MPU) . So i want to test the watchdog first. But something 
> strange is: when run with atmega1281, after the watchdog time-out, 
> software can't start-up again, which seems like the MPU haven't start. 
> but when the same app run with atmega128, all things are as expected -- 
> the software run, then watchdog time-out and reset the MPU, software 
> start again, and loop.
>   So i come here and ask for help -- what the problem may be?  Many Thanks.
>  
>   Here is my simple test app:
>  
>   module wdtC
> {
>   uses interface Boot;
>   uses interface Leds;
>   uses interface Timer<TMilli> as Timer;
> }
>  
> implementation
> {
>   uint8_t firstTime;
>   
>   uint8_t mcusr_mirror; 
>  
>   void get_mcusr(void) \
>   __attribute__((naked)) \
>   __attribute__((section(".init3"))); 
>   
>   void get_mcusr(void)
>   {
>    mcusr_mirror = MCUSR;
>    MCUSR = 0;
>    wdt_disable(); 
>   } 
>   
>   event void Boot.booted()
>   { 
>     
>     firstTime = 1;
>     call Leds.led0On();
>     call Leds.led1On();
>     call Timer.startPeriodic(3000);
>   }
>  
>   event void Timer.fired()
>   {
>     call Leds.led1Off();
>    
>     if (firstTime)
>    {
>        firstTime = 0;
>        wdt_enable(WDTO_1S); // the watchdog will time-out after 1s
>    }
> 
>  else
>  {
>      wdt_reset();
>  }
> 
>  call Leds.led2On();
> }
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

-- 
Platform: WinXP/Cygwin
TinyOS version: 1.x, Boomerang
Programmer: MIB510
Device(s): Mica2, MicaZ, Tmote
Sensor board: homebrew



More information about the Tinyos-help mailing list