I have an MSP-EXP430G2ET launchboard which has msp430g2553 microcontroller. I bought it for my embedded systems course.
Lately we learned to use timers and the last lab work was using the watchdog timer in time interval mode. But while doing that I figured out my ACLK was not working properly. I check the datasheet and guide for the board and It has ACLK if I'm not mistaken. By the way when I touch the pins of the board LED blinks at different frequencies.
This is the code that I used for the watchdog timer to light a LED with a period.
#include <msp430.h>
int main(void)
{
WDTCTL = WDTPW | WDTCNTCL | WDTIS0 | WDTSSEL | WDTTMSEL;// config watchdog timer aclk 1ms
P1DIR |= BIT0 | BIT6; // P1.0 and P1.6 is configured as output
P1OUT = ~BIT0 | ~BIT6; // Led P1.0 and P1.6 are turned off
while (1){
if (IFG1&BIT0 != 0){
P1OUT ^= BIT0 | BIT6;
IFG1 &= ~WDTIFG;
}
}
}
This code does not work. LED does not light up.