• 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 » MSP430G2553 P2.1 Capture
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 >
  • MSP430G2553 P2.1 Capture

    MSP430G2553 P2.1 Capture

    This question is answered
    Thorsten Lauer
    Posted by Thorsten Lauer
    on May 23 2012 12:34 PM
    Prodigy50 points
    main.c

    Hi,

    I'm trying to use port P2.1 of the 2553 as capture input port for timer1. My problem is, that the interrupt dervice routine is never called. Any hint what I'm doing wrong here ?

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Jeff Tenney
      Posted by Jeff Tenney
      on May 23 2012 13:11 PM
      Guru10805 points

      Maybe it's being called just once, and then:

      TA1CCTL1 = ~CCIE;

      messes up the configuration of the capture by selecting Vcc instead of CCIxA.

      I think you meant

      TA1CCTL1 &= ~CCIE; // (and is it CCIFG that you meant?)

      Also you should watch out for over-using "|=" in your configuration of TA1CTL and TA1CCTL1.  Just use simple assignment statements "=" instead.

      Jeff

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Thorsten Lauer
      Posted by Thorsten Lauer
      on May 23 2012 13:54 PM
      Prodigy50 points

      Hi Jeff,

      first of all thx for your fast response:

       

      >>Maybe it's being called just once, and then:

      >>TA1CCTL1 = ~CCIE;

      >>messes up the configuration of the capture by selecting Vcc instead of CCIxA.

      >>I think you meant

      >>TA1CCTL1 &= ~CCIE; // (and is it CCIFG that you meant?)

      Yes - that's what I meant :-) But the problem is that the interrupt service routine is not called even once.

      I have a display connected to the msp430 and it never gets over the line:

      __bis_SR_register(CPUOFF + GIE);

      so that

        LCDSetPosition(1,8);

            itoa(temp,string,10);

            LCDPrintString(string);

      gets executed.

      >>Also you should watch out for over-using "|=" in your configuration of TA1CTL and TA1CCTL1.  Just use simple assignment statements "=" instead.

      Yep - you are right

      Any other idea's ??

       

      P.S. If anybody needs a Pac Man bitmap for their LCD display - it's included in the source I attached :-)

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jeff Tenney
      Posted by Jeff Tenney
      on May 23 2012 14:22 PM
      Guru10805 points

      Not sure how your serial device works, but there is a conflict between your comment "falling edge" and your code "CM_1".

      CM_1 is for capturing rising edges.

      Jeff

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Thorsten Lauer
      Posted by Thorsten Lauer
      on May 23 2012 14:40 PM
      Prodigy50 points

      Jeff Tenney

      Not sure how your serial device works, but there is a conflict between your comment "falling edge" and your code "CM_1".

      CM_1 is for capturing rising edges.

      Jeff

      This is only because the code is driving me nuts for more than 3 days now :-)

      Testing different settings ....

       

      I have a CMOS NE555 with 8Hz and 50% duty cycle connected to port 2.1

      So in theory it should reach the interrupt service routine no mather wheter I

      trigger on - the rising or falling edge ...

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jeff Tenney
      Posted by Jeff Tenney
      on May 23 2012 15:52 PM
      Guru10805 points

      Thorsten Lauer
      driving me nuts for more than 3 days now :-)

      No fun.  Sorry to hear that.

      Can you try something for me?

      Just for testing purposes, replace this:

      __bis_SR_register(CPUOFF + GIE);  // Enter LPM0, enable interrupts

      with this:

      while (P2IN & TACHO)
      {
         // do nothing.  Just wait.
      }
      
      while ( (P2IN & TACHO) == 0)
      {
         // do nothing.  Just wait.
      }
      

      Then see if it runs.  If it doesn't run, you should be able to see where it is getting stuck.

      Jeff

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jens-Michael Gross
      Posted by Jens-Michael Gross
      on May 24 2012 07:17 AM
      Verified Answer
      Verified by Thorsten Lauer
      Guru140650 points

      Thorsten Lauer
      Yes - that's what I meant

      I also guess you meant
      temp = TA1CCR1; (and not TA1CCTL1) to ge the captured timestamp (and not the config register whose only 'variable' part is the captured line level, which you already know as you captured on the edge)

      I don't see what else could be wrong. The only thing I can imagine is that the initialization of the LCD somehow undoes the configuration of your port pins (especially clearing the P2SEL that enables the capture input)

      _____________________________________
      Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.
      If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Thorsten Lauer
      Posted by Thorsten Lauer
      on May 24 2012 11:37 AM
      Prodigy50 points

      Jens-Michael Gross

      I don't see what else could be wrong. The only thing I can imagine is that the initialization of the LCD somehow undoes the configuration of your port pins (especially clearing the P2SEL that enables the capture input)

       
      How right you are. I checked LCD.h and after replacing

      P2SEL = 0;
      P2SEL2 = 0;

      with

      P2SEL &= ~(LCD_PIN_RS + LCD_PIN_EN);

      P2SEL2 &= ~(LCD_PIN_RS + LCD_PIN_EN);

      it's working now.

      Special thanks also to Jeff Tenney, who also tried to help.

      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