This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP430F413: Timer Delay

Part Number: MSP430F413


Tool/software: Code Composer Studio

error #20: identifier "BCSCTL2" is undefined
"../blink.c", line 28: error #20: identifier "CALBC1_16MHZ" is undefined
"../blink.c", line 29: error #20: identifier "DCOCTL2" is undefined

my controller is msp430f413 I am facing this error 

  • Hi,

    It means in your path, you didn't define a value for CALBC1_16MHZ" and "DCOCTL2".

    Where you get this code? can you post it?

    Eason

  • #include <msp430.h>

    int i,k,m;


    void timer_init() {

    TA0CTL = TASSEL_2+ID_3 + MC_0; // SMCLK + /8 + disabled 125 kHz MC_0 stop
    TA0CCTL0 = CCIE; // Enable counter interrupts, bit 4=1
    _BIS_SR(LPM0+GIE);

    }

    void delay_time_ms(volatile unsigned int TIME) {


    TA0CCR0 = TIME*125; // how many ms
    TA0CTL = TASSEL_2+ID_3 + MC_1; // SMCLK + /8 + up mode 125 kHz
    }


    int main(void) {
      volatile int i;


      //MCLK=SMCLK=1Mhz
     // BCSCTL1 = CALBC1_1MHZ;
     // DCOCTL = CALDCO_1MHZ;
      timer_init();


      // stop watchdog timer
      WDTCTL = WDTPW | WDTHOLD;


     // FLL_CTL0 |= XCAP14PF;                     // Configure load caps
    //    LCDCTL = LCDP2 + LCD2MUX + LCDON;         // STK LCD 4-Mux, segments S0-S27
    //    BTCTL = BTFRFQ1;                          // STK LCD freq = ACLK/128
        LCDCTL = LCDSG0_1+ LCDSON + LCDON;  //LCD2MUX+ LCDSG0_1++LCDON
        BTCTL = BT_fLCD_DIV64;
    //
        P3SEL = 0XF0;
        P4SEL = 0XFF;
        P5SEL = 0XA4;


      P3DIR = 0xF0;
      P4DIR = 0XFF;
      P5DIR = 0XA8;

      // intialize bit 0 of P1 to 0
    //  P6OUT = 0x00;
    // // P5SEL = 0x04;
    //
    //  P3SEL =0xF0;

      // loop forever
      for (;;) {
        // toggle bit 0 of P1
          //for(k=0;k<10;k++)
          {
              for(m=1;m<16;m++)
              {
                 // P5OUT = 0x00;
          LCDCTL ^=LCDON;   //LCDSG0_1+ LCD2MUX+
          P3OUT = 0X01<<m;
          P5OUT = 0X01<<m;
          P4OUT = 0X01<<m;


    //      LCDMEM[0] = 0X0;//= 0x10<<k;
         // P6OUT ^= 0x01;
            // delay(1);
              }
          }

        // delay for a while

      }
    }

  • Hi guy,

    where is "ALBC1_16MHZ" and "DCOCTL2"? I can't find it.

    Eason

**Attention** This is a public forum