Why am i getting an error

Thread Starter

gusmas

Joined Sep 27, 2008
239
Using Code Compiler
this is my code, but its not working, even if TAIFG is 0x0, the if statement checking when its 0, is not recognising it:

#include "msp430g2211.h"

void main (void)
{
WDTCTL = WDTPW|WDTHOLD; //STOP Watchdog
P1DIR = 0x40; //Configure P1.6 To be output
TACTL = MC_2|ID_3|TASSEL_2|TACLR; // Configuring:Continous up| Divider:3(8) |Clock Source: SMCLK| CLR TMR
for(;;) // Infitite Loop
{
if ( TAIFG == 0) // IF Timer A flag is not raised
{
P1OUT= 0;
}
if(TAIFG == 1) // IF timer A flag is raised
{
P1OUT = 0x40;
TACTL &= ~TAIFG
}
}
}
 
Last edited:
Top