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/MSP430F5232: CCS/MSP430F5232

Part Number: MSP430F5232
Other Parts Discussed in Thread: MSP430G2553, GRACE

Tool/software: Code Composer Studio

I am attemptingto compile the example

msp430f524x_adc10_11.c

from "dev.ti.com/tirex/#/?link=Software%2FMSP430Ware%2FDevices%2FMSP430F5XX_6XX%2FMSP430F5232%2FPeripheral%20Examples%2FRegister%20Level%2Fmsp430f524x_adc10_11.c"

using a MSP430F5232 selected as a code composer project and the code from msp430f524x_adc10_11.c

Description Resource Path Location Type
gmake: Target 'all' not remade because of errors. msp430f524x_adc10_11 C/C++ Problem
gmake: *** [main.obj] Error 1 msp430f524x_adc10_11 C/C++ Problem
#20 identifier "ADC10SREF_1" is undefined main.c /msp430f524x_adc10_11 line 99 C/C++ Problem
#20 identifier "ADC10SHS_1" is undefined main.c /msp430f524x_adc10_11 line 97 C/C++ Problem
#20 identifier "ADC10RES" is undefined main.c /msp430f524x_adc10_11 line 98 C/C++ Problem
#20 identifier "ADC10ON" is undefined main.c /msp430f524x_adc10_11 line 96 C/C++ Problem
#20 identifier "ADC10MSC" is undefined main.c /msp430f524x_adc10_11 line 96 C/C++ Problem
#20 identifier "ADC10MEM0" is undefined main.c /msp430f524x_adc10_11 line 142 C/C++ Problem
#20 identifier "ADC10MCTL0" is undefined main.c /msp430f524x_adc10_11 line 99 C/C++ Problem
#20 identifier "ADC10IV" is undefined main.c /msp430f524x_adc10_11 line 134 C/C++ Problem
#20 identifier "ADC10INCH_0" is undefined main.c /msp430f524x_adc10_11 line 99 C/C++ Problem
#20 identifier "ADC10IE0" is undefined main.c /msp430f524x_adc10_11 line 113 C/C++ Problem
#20 identifier "ADC10IE" is undefined main.c /msp430f524x_adc10_11 line 113 C/C++ Problem
#20 identifier "ADC10ENC" is undefined main.c /msp430f524x_adc10_11 line 112 C/C++ Problem
#20 identifier "ADC10CTL2" is undefined main.c /msp430f524x_adc10_11 line 98 C/C++ Problem
#20 identifier "ADC10CTL1" is undefined main.c /msp430f524x_adc10_11 line 97 C/C++ Problem
#20 identifier "ADC10CTL0" is undefined main.c /msp430f524x_adc10_11 line 96 C/C++ Problem
#20 identifier "ADC10CONSEQ_2" is undefined main.c /msp430f524x_adc10_11 line 97 C/C++ Problem
#2580-D pragma vector= accepts numeric arguments or "unused_interrupts" but not ADC10_VECTOR main.c /msp430f524x_adc10_11 line 126 C/C++ Problem

these identifiers appear to be correct according to SLAU208Q–June 2008–Revised March 2018 I have atttemped on a machine with code composer 6 and code composer 8 with the same errors

http://dev.ti.com/tirex/#/?link=Software%2FMSP430Ware%2FDevices%2FMSP430F5XX_6XX%2FMSP430F5232%2FPeripheral%20Examples%2FRegister%20Level%2Fmsp430f524x_adc10_11.c

  • Hello Peter,

    MSP430F523x devides do not contain ADC10.
    Please refer to this document: www.ti.com/.../msp430f5232.pdf
    and Figures 1-1 to 1-4.
    It is pitty that the newest MSP430Ware provides these misleading ADC10 examples for MSP430F523x.
  • Part Number: MSP430F5232

    Tool/software: Code Composer Studio

    I am migrating a project from msp430g2553 and have not been able to find the right registry settings to set up the ADC I have selected a new project using a msp430F5232 as the processor and pasted the example msp430f524x_adc10_12.c  that came as part of MSP430F523x_MSP430F524x_Code_Examples I am using as the source slau208q.pdf and these values appear to be defined 

    Description Resource Path Location Type
    #20 identifier "ADC10IE0" is undefined main.c /msp430f524x_adc10_11 line 113 C/C++ Problem
    #20 identifier "ADC10INCH_0" is undefined main.c /msp430f524x_adc10_11 line 99 C/C++ Problem
    #20 identifier "ADC10IV" is undefined main.c /msp430f524x_adc10_11 line 134 C/C++ Problem
    #20 identifier "ADC10MCTL0" is undefined main.c /msp430f524x_adc10_11 line 99 C/C++ Problem
    #20 identifier "ADC10MEM0" is undefined main.c /msp430f524x_adc10_11 line 142 C/C++ Problem
    #20 identifier "ADC10MSC" is undefined main.c /msp430f524x_adc10_11 line 96 C/C++ Problem
    #20 identifier "ADC10ON" is undefined main.c /msp430f524x_adc10_11 line 96 C/C++ Problem
    #20 identifier "ADC10RES" is undefined main.c /msp430f524x_adc10_11 line 98 C/C++ Problem
    #20 identifier "ADC10SHS_1" is undefined main.c /msp430f524x_adc10_11 line 97 C/C++ Problem
    #20 identifier "ADC10SREF_1" is undefined main.c /msp430f524x_adc10_11 line 99 C/C++ Problem
    gmake: *** [main.obj] Error 1 msp430f524x_adc10_11 C/C++ Problem
    gmake: Target 'all' not remade because of errors. msp430f524x_adc10_11 C/C++ Problem
    #2580-D pragma vector= accepts numeric arguments or "unused_interrupts" but not ADC10_VECTOR main.c /msp430f524x_adc10_11 line 126 C/C++ Problem

    /* --COPYRIGHT--,BSD_EX
    * Copyright (c) 2013, Texas Instruments Incorporated
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    * * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    *
    *******************************************************************************
    *
    * MSP430 CODE EXAMPLE DISCLAIMER
    *
    * MSP430 code examples are self-contained low-level programs that typically
    * demonstrate a single peripheral function or device feature in a highly
    * concise manner. For this the code may rely on the device's power-on default
    * register values and settings such as the clock configuration and care must
    * be taken when combining code from several examples to avoid potential side
    * effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware
    * for an API functional library-approach to peripheral configuration.
    *
    * --/COPYRIGHT--*/
    //******************************************************************************
    // MSP430F524x Demo - ADC10, Sample A0, 1.5V Ref, TA0.1 Trig, Set P1.0 if A0>0.5V
    //
    // Description: A0 is sampled 16/second (ACLK/1024) with reference to 1.5V.
    // Timer_A is run in upmode and TA0.1 is used to automatically trigger
    // ADC10 conversion. Internal oscillator times sample (16x) and conversion
    // (13x).Inside ADC10_ISR if A0 > 0.5V, P1.0 is set, else reset. Normal mode
    // is LPM3.
    // //* An external watch crystal on XIN XOUT is required for ACLK *//
    //
    // MSP430F524x
    // -----------------
    // /|\| XIN|-
    // | | | 32kHz
    // --|RST XOUT|-
    // | |
    // >---|P6.0/A0 P1.0 |--> LED
    // | P1.2|--> TA0.1 (ADC trigger signal)
    //
    // E. Chen
    // Texas Instruments Inc.
    // August 2013
    // Built with IAR Embedded Workbench v5.52 & Code Composer Studio v5.5
    //******************************************************************************
    #include "msp430.h"

    void main(void)
    {
    WDTCTL = WDTPW+WDTHOLD; // Stop WDT
    P1DIR |= BIT0; // Set P1.0 to output direction
    P1OUT &= ~BIT0; // Clear P1.0

    P1DIR |= BIT2; // P1.2/TA0.1 output
    P1SEL |= BIT2; // TA0.1 function select

    // Configure Xt1
    P5SEL |= BIT4+BIT5; // Port select XT1
    UCSCTL6 &= ~(XT1OFF); // XT1 On
    UCSCTL6 |= XCAP_3; // Internal load cap
    UCSCTL3 = 0; // FLL Reference Clock = XT1
    // Loop until XT1,XT2 & DCO stabilizes - In this case loop until XT1 and DCo settle
    do
    {
    UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG);
    // Clear XT2,XT1,DCO fault flags
    SFRIFG1 &= ~OFIFG; // Clear fault flags
    }while (SFRIFG1&OFIFG); // Test oscillator fault flag
    UCSCTL6 &= ~(XT1DRIVE_3); // Xtal is now stable, reduce drive strength
    UCSCTL4 |= SELA_0; // ACLK = LFTX1 (by default)

    // Configure ADC10
    ADC10CTL0 |= ADC10ON + ADC10MSC; // ADC10ON
    ADC10CTL1 |= ADC10SHS_1 + ADC10CONSEQ_2; // rpt single ch; TA0.1 trig sample start
    ADC10CTL2 |= ADC10RES; // 10-bit conversion results
    ADC10MCTL0 |= ADC10INCH_0 + ADC10SREF_1; // A0 ADC input select; Vref=1.5V

    // By default, REFMSTR=1 => REFCTL is used to configure the internal reference
    while(REFCTL0 & REFGENBUSY); // If ref generator busy, WAIT
    REFCTL0 |= REFVSEL_0+REFON; // Select internal ref = 1.5V
    // Internal Reference ON
    // Reference settling time ~ 75us
    TA0CCR0 = 80; // Delay to allow Ref to settle
    TA0CCTL0 |= CCIE; // Compare-mode interrupt
    TA0CTL = TASSEL_2 + MC_1; // TACLK = SMCLK, Up mode
    __bis_SR_register(CPUOFF + GIE); // LPM0, TA0_ISR will force exit
    TA0CCTL0 &= ~CCIE; // Disable timer Interrupt

    ADC10CTL0 |= ADC10ENC; // ADC10 Enable
    ADC10IE |= ADC10IE0; // Enable ADC conv complete interrupt

    // ADC conversion trigger signal - TimerA0.0 (32ms ON-period)
    TA0CCR0 = 1024-1; // PWM Period
    TA0CCR1 = 512-1; // TA0.1 ADC trigger
    TA0CCTL1 = OUTMOD_4; // TA0CCR0 toggle
    TA0CTL = TASSEL_1 + MC_1 + TACLR; // ACLK, up mode

    __bis_SR_register(LPM3_bits + GIE); // Enter LPM3 w/ interrupts
    }

    // ADC10 interrupt service routine
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector=ADC10_VECTOR
    __interrupt void ADC10_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(ADC10_VECTOR))) ADC10_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
    switch(__even_in_range(ADC10IV,12))
    {
    case 0: break; // No interrupt
    case 2: break; // conversion result overflow
    case 4: break; // conversion time overflow
    case 6: break; // ADC10HI
    case 8: break; // ADC10LO
    case 10: break; // ADC10IN
    case 12: if (ADC10MEM0 < 0x155) // ADC10MEM = A0 < 0.5V?
    P1OUT &= ~BIT0; // Clear P1.0 LED off
    else
    P1OUT |= BIT0; // Set P1.0 LED on
    break; // Clear CPUOFF bit from 0(SR)
    default: break;
    }
    }

    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector=TIMER0_A0_VECTOR
    __interrupt void TA0_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(TIMER0_A0_VECTOR))) TA0_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
    // Internal Reference settling time delay elapsed
    TA0CTL = 0; // Clear Timer_A control registers
    __bic_SR_register_on_exit(CPUOFF); // Clear CPUOFF bit from 0(SR)
    }

  • Hello Peter,
    Tomasz is correct. We're sorry for that inconvenience. We'll file a bug on this. The project files are correctly labeled with F524x, which is derivative containing the 10bit ADC, but unfortunately listed under F523x projects.

    Best regards
    Peter
  • Hello Peter Goodricke,

    I went ahead and merged the second thread you created about this issue with this thread since they seem to be addressing the same problem you were facing. Thank you for bringing this to our attention and it looks like Peter Spevak will be filing a bug to fix what examples are available for certain devices.

    Best regards,

    Matt