Why am i getting an error

Discussion in 'Programmer's Corner' started by gusmas, Sep 12, 2010.

  1. gusmas

    Thread Starter Active Member

    Sep 27, 2008
    239
    0
    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: Sep 12, 2010
Loading...