Hi Mohamad,

On Friday 17 October 2008 07:34:34 am Mohamad Moubarak wrote:
> from your reply on tinyos-help i noticed that you could help me with
> the following. I wan to use the msp430 watchdog timer in interval
> mode. I know how to start the timer, but i dont know how to write a
> low level interrupt handler in tinyos to generate the corresponding
> fired event for higher components for that specific timer. According
> to msp430-toolcahin/msp430/include/msp430/common.h the command to
> start the watchdog timer in interval mode is WDT_ADLY_1000. Your help
> will be much appreciated since im not getting help from anyone else.

You can grab some simple example code from http://www.ti.com/msp430.  Click on 
the "Code Examples" tab, then select the downlaod for C (IAR/CCE) for 
the "MSP430x13x, MSP430F14x, MSP430F15x, MSP430F16x" devices.  Take a look at 
the samples named fet140_wdt_*.c.  The first one, fet140_wdt_01.c, shows a 
simple configuration of the WDT used as an interval timer.

Now, you need to integrate that knowledge into a low level TinyOS component 
that signals an event on each interrupt.  Here you can get what you need from 
the code for managing the timers.  In 
$TOSDIR/chips/msp430/timer/Msp430TimerCommonP.nc, you will see an example of 
using the TOSH_SIGNAL() macro to implement code for an ISR vector that then 
signals an event.  The timer code is far more complex that you'll need, since 
it supports features like timer capture, but just ignore this stuff and go 
for the essence.  You can visualize the component connections by navigating 
the documentation for the Blink app, which uses TimerB.  Copy 
$TOSROOT/apps/Blink somewhere and build the docs (make tmote docs), then view 
the result with a web browser.

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

Reply via email to