Hi,
I was wondering if it could be possible to use the watchdog in interval timer mode, with a interval of 4 minutes? If possible, how would i program the interval time (I haven't found yet how to set this kind of value).
My goal in this minicode is to produce a 1ms pulse on an output pin, and then to wait 4 minutes before pulsing again etc... and obviously with the lowest consumption possible ;)
I used an example code to try in a first attempt, so pulse time value is not yet the right value. But I'm having trouble finding how to set 4minutes as the interval timer.
#include <msp430x20x3.h>
int i;
void main(void)
{
WDTCTL = WDT_MDLY_32; // Set Watchdog Timer interval to ~30ms
IE1 |= WDTIE; // Enable WDT interrupt
P1DIR |= 0x01; // Set P1.0 to output direction
_BIS_SR(LPM0_bits + GIE); // Enter LPM0 w/ interrupt
}
// Watchdog Timer interrupt service routine
#pragma vector=WDT_VECTOR
__interrupt void watchdog_timer(void)
{
P1OUT ^= 0x01;
for(i=0;i<20000;i++)
{}
P1OUT^=0x01; // Toggle P1.0 using exclusive-OR
}
The for loop is set here to let the output on during XX seconds
So thanks again to the community and TI employees for their support :)
Nicolas