• 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 » Stopping a continuous while loop on MSP430
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 >
  • Stopping a continuous while loop on MSP430

    Stopping a continuous while loop on MSP430

    This question is not answered
    Melbim Sanchez
    Posted by Melbim Sanchez
    on Feb 20 2012 20:03 PM
    Prodigy20 points

    In my microprocessing class our teacher has made us program a MSP430G2553 to do light up 8 led's in a certain sequence when a button is pressed.  The micro is attached to a Breadboard that is then connected to two buttons and the 8 led's.  When the power is connected none of the lights will be lit.  When one button is pressed a sequence will begin and continue until the person presses both buttons at the same time.  The same goes for the second button.  I have been able to achieve two of the three parts.  The only part I have trouble is getting out of the while loop/pressing the 2 buttons at the same time.  I have tried multiple methods but with no results.  I have attached the code so you could help me out with this. 

    p.s.  Teacher is horrible assumes everyone in class can already program / no book to read from.  Is there any websites/books that I could use to help me understand this material?

    3482.Code.txt

    microcontroller msp 430 MSP430g2553 Microprocessor
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • blb
      Posted by blb
      on Feb 21 2012 18:06 PM
      Expert2320 points

      Hi,

      In your code, I didn't see any attempts to detect when both buttons were pressed simultaneously.  What have you tried?

      Barry

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Andy Neil
      Posted by Andy Neil
      on Feb 21 2012 19:27 PM
      Guru31995 points

      Melbim Sanchez
      Teacher is horrible assumes everyone in class can already program

      Was that not stated as one of the course pre-requisites?

      If not, have you talked to the teacher about this? Or your personal tutor, or college staff, or whatever?

      Melbim Sanchez
      Is there any websites/books that I could use

      Of course - there are plenty!

      Some suggestions here: http://blog.antronics.co.uk/2011/08/08/

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jan
      Posted by Jan
      on Feb 22 2012 00:05 AM
      Expert1435 points

      Hi,

      first of all, there are many tutorials out there for learning C and also C for microcontrollers like the MSP430. A starting point could be the lauchpad wiki (a TI development tool for the value line MSP430s):

      http://processors.wiki.ti.com/index.php/LaunchPad_Redirect?DCMP=launchpad&HQS=Other+OT+launchpadwiki

      For your question: in your code you start the blinking sequence in this line:

      if(P2IN&BIT3) or if(P2IN&BIT4) 

      but there is no escape from one of the while loops. You are looking for

      if((P2IN&BIT3) && (P2IN&BIT4)) {
      break;
      }

      This checks both input bits and is only true when both are pressed, the break quit's the while loop.

      Hope that helps ;-)

      --
      Regards,
      Jan

      Oxfam Trailwalker 2012 - Runner

      Found any horribly english mistakes? - Drop me a note as private conversation via my profile if you like ;-)

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • janmay b c
      Posted by janmay b c
      on Feb 22 2012 12:07 PM
      Expert1235 points

      Hi Melbim,

      Melbim Sanchez
      Is there any websites/books

      1) MSP430 Microcontroller Basics by John Davies (the best)

      2)Embedded Systems Design using the TI MSP430 Series by Chris Nagy

      3) Analog and Digital Circuits for Electronic Control System Applications

      Using the TI MSP430 Microcontroller by Jerry Luecke

      Hope the above books help
      
      
      best wishes
      janmay
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Melbim Sanchez
      Posted by Melbim Sanchez
      on Feb 23 2012 12:42 PM
      Prodigy20 points

      I know how to program, sorry i didn't word it correctly.  I meant to say that he assumes we already know how to program the MSP430 already.  We are actually beginning where the class from the previous semester finished off

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • janmay b c
      Posted by janmay b c
      on Feb 23 2012 13:01 PM
      Expert1235 points

      Hi,

      Go through any one of the MSP430 books, and you will be just fine :-).

      READING as much as possible is the only way forward.

      best wishes

      janmay

      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