• 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 » Using UART to Communicate between the Computer and the MSP430 Launchpad (SLAA307A)
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 >
  • Forums

    Using UART to Communicate between the Computer and the MSP430 Launchpad (SLAA307A)

    This question is answered
    Vinay Dandekar
    Posted by Vinay Dandekar
    on Apr 13 2012 16:02 PM
    Prodigy30 points

    I am currently trying to make the MSP430 talk to the COM port to get a 1 or 0 when the button is pressed. The future goal would be to use a sensor and take the data from that and get a 0 or 1 for presence detection, hence why we would like to get the communication of a boolean 0/1. Using SLAA307A: Using the Timer_A UART Library, I tried to implement the basic C program, but it refuses to compile in CCSv5.

    #include <ta_uart.h>
    int callBack(unsigned char c);
    void main(void)
    {
    WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer

    TI_initTimer(callBack, _32Khz_ACLK_04800_Bitime, TASSEL_1);
    _EINT();
    LPM3;
    }

    int callBack( unsigned char c ) {
    TI_TA_UART_StatusFlags &= ~TI_TA_RX_RECEIVED; // allows for RX during TX
    TI_TX_Byte( c ); // echo byte
    return TA_UART_STAY_LPM; // return to LPM3
    }
    I do know that there are some assembly files that are needed for the program to work, but I'm not sure how to link them in CCS. 
    Also, ideally, if this works, how does one monitor the COM port to send and receive data to the MSP?
    Thanks in advance!
    UART communication MSP430 LaunchPad SLAA307A
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Andy Neil
      Posted by Andy Neil
      on Apr 13 2012 16:52 PM
      Guru31975 points

      Vinay Dandekar
      it refuses to compile

      What, exactly, do you mean by that?

      I presume you mean that you get lots of error and/or warning messages? Have you looked carfully at those messages, and attempted to resolve them?

      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 Apr 14 2012 03:32 AM
      Expert1425 points

      Hi Vinay,

      when you say it refuses to compile - please provide the errors and warnings.

      A pure "C" version is available here: https://gist.github.com/532047

      You can use almost any good(tm) terminal program to show the data. Hyperterminal or TinyTerm are two simple ones.

      --
      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.
    • Vinay Dandekar
      Posted by Vinay Dandekar
      on Oct 16 2012 16:40 PM
      Verified Answer
      Verified by Vinay Dandekar
      Prodigy30 points

      Sorry for the long wait, but I finally got the answer I was looking for through some of the sample code sitting in SLAC485A.zip for the MSP430G2xx3 examples. The msp430g2xx3_uscia0_uart_01_9600.c was a great start for our simple project of sending just one byte to the COM port.

      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