• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » MSP430™ Microcontrollers » MSP430 Ultra-Low Power 16-bit Microcontroller Forum » DTC and ADC10 questions.
Share
MSP430™ Microcontrollers
  • Forum
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
MSP430 Resources
  • MSP430 Product Folder
  • MSP-EXP430G2 - MSP430 LaunchPad Value Line Development kit
  • MSP430 Getting Started Guide
  • MSP430 Microcontroller Projects
  • More Resources >
  • DTC and ADC10 questions.

    DTC and ADC10 questions.

    This question is answered
    Pedro Inazawa
    Posted by Pedro Inazawa
    on Aug 01 2012 21:58 PM
    Prodigy120 points

    Hello Everyone!

    I´m trying to sample 5 sensors thought MSP430 EZ430-RF2500 (MSP430F2274) and send the info via serial port to the PC (Windows 7). This time, instead of "manually" changing  INCH, I took a shot at DTC. But it really doesn´t seem to work... Could someone Help me?

    The major problem seems to be the stop at that main loop, where it is supposed to be sampling.  In the code above, it will go until P1OUT = 0x03, but won´t go back to the beginning of the FOR LOOP.

    Another two questions are:

    1)The way the program is written, are my results already in the “saida1” vector at the end of a loop (Right after the P1OUT = 0x03;) ?

    2)I saw some programs that use a pointer in ADC10SA and retrieve the vector info in the ADC10 ISR, but I assumed that, at this point,  the ADC´s still working. Is this correct?

    Here is my code and its description.

    Thanks a lot for your attention, and Please Help!    =)

     

    void start(void){

    /*ADC10 variables*/

    ADC10CTL1 = INCH_4 + CONSEQ_3; // A4, A3, A2, A1, A0

    ADC10AE0 = BIT0+BIT1+BIT2+BIT3+BIT4; //OUTPUT selection

    ADC10CTL0 = ADC10ON + REFON + REF2_5V + MSC + ADC10SHT_3;

    ADC10DTC1 = 0x05;

     

    TACCR0 = 30; // Delay to allow Ref to settle

    TACCTL0 |= CCIE; // Compare-mode interrupt

    TACTL = TASSEL_2 + MC_1; // TACLK = SMCLK, Up mode

    __bis_SR_register(CPUOFF + GIE);

    TACCTL0 &= ~CCIE; // Disable timer Interrupt

     

     

    /*END ADC10 variables*/

    }

     

     

     

    void main(void){

    int saida1[5];

    float saida2[5];

    int i=0;

     

    WDTCTL = WDTPW|WDTHOLD;

    start(); //start the variables

     

    ADC10SA = (int) saida1;

     

    ADC10DTC1 = 0x05;

    P1DIR = 0x03;

     

    for(;;)

    {

    ADC10CTL0 &= ~ENC;

    while (ADC10CTL1 & BUSY);

    ADC10SA = (int) saida1;

    ADC10CTL0 |= ENC + ADC10SC; //Begin sampling and convervison

    __bis_SR_register(CPUOFF + GIE); // LPM0 com interrupt disponível.

    P1OUT = 0x03;

    }

    }

    //ISR routines

    #pragma vector=ADC10_VECTOR

    __interrupt void ADC10_ISR(void)

    {

      __bic_SR_register_on_exit(CPUOFF);       // Clear CPUOFF bit from 0(SR)

    }

    //////////////////////////////

    //////////////////////////////

    #pragma vector=TIMERA0_VECTOR

    __interrupt void TA0_ISR(void)

    {

      TACTL = 0;                               

                                              // Clear Timer_A control registers

      __bic_SR_register_on_exit(CPUOFF);       

                                              // Clear CPUOFF bit from 0(SR)

    }

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Bruce McKenney
      Posted by Bruce McKenney
      on Aug 02 2012 09:23 AM
      Verified Answer
      Verified by Pedro Inazawa
      Intellectual280 points

      As near as I can tell, there are no interrupts enabled when you go into LPM, so it will wait forever.

      Try setting ADC10IE.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Pedro Inazawa
      Posted by Pedro Inazawa
      on Aug 02 2012 17:05 PM
      Prodigy120 points

      Bruce McKenney

      Try setting ADC10IE.

      Thanks a Lot! Now its working!

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use