• 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 » Interface » /etc... Interface » RS-232 Forum » Issue with RS-232 data transmission on MSP430FG4618/f2013 board
Share
/etc... Interface
  • Forums
Options
  • Subscribe via RSS

Check out
Analog Wire blog

  • $core_v2_blog.Current.Name

    RS-485 - Who says you can't teach an old dog new tricks?

    Posted 3 days ago
    by Neel Seshan
    Would you agree that RS-485 has turned out to be one of the most versatile communication standards when it comes to industrial...
  • $core_v2_blog.Current.Name

    Filter for thought

    Posted 4 days ago
    by Soufiane Bendaoud
    Have you ever wondered how engineers designed active filters before the birth of software? They were able to do it using nomographs...

Issue with RS-232 data transmission on MSP430FG4618/f2013 board

Issue with RS-232 data transmission on MSP430FG4618/f2013 board

This question is not answered
souvik metia
Posted by souvik metia
on Dec 05 2011 01:44 AM
Intellectual545 points

Hi friend's i have tested the RS-232 cable with DVM which pass  the continuity test of the RS-232 cable. And also i short the cable pin RX and TX and then type something which then echoed and displayed in the hyper terminal, that means the RS-232 cable is good. Now i short the pin5 and pin6 of H4 which is actually P2.4 and P2.5 pin of the MSP430FG4618, in the pin access of MSP430FG4618/F2013 experimenter's board which are UCA0TXD and UCA0RXD respectively and at the same time i do not run the program only power on the board and type something which again displayed in the hyper terminal of my PC, that means the isolated RS-232 Communication part is OK. But whenever i run the program of "echo" of TI code which actually short the pins(RX and TX) via software didn't work. It displays nothing. I am now confusing what i have to do, i did some short of testing what i know and also i explain details here. If there is some testing of hardware and software is missing please reply me and give me a good solution of this mess because i stuck it for some days.

here is the TI code of "echo"....

=======================================================

//******************************************************************************
//   MSP430xG46x Demo - USCI_A0, Ultra-Low Pwr UART 9600 Echo ISR, 32kHz ACLK
//
//   Description: Echo a received character, RX ISR used. Normal mode is LPM3,
//   USCI_A0 RX interrupt triggers TX Echo.
//   ACLK = BRCLK = LFXT1 = 32768, MCLK = SMCLK = DCO~1048k
//   Baud rate divider with 32768hz XTAL @9600 = 32768Hz/9600 = 3.41 (0003h 03h )
//   //* An external watch crystal is required on XIN XOUT for ACLK *//   
//
//
//                MSP430xG461x
//             -----------------
//         /|\|              XIN|-
//          | |                 | 32kHz
//          --|RST          XOUT|-
//            |                 |
//            |     P4.7/UCA0RXD|------------>
//            |                 | 9600 - 8N1
//            |     P4.6/UCA0TXD|<------------
//
//   K. Quiring/ M. Mitchell
//   Texas Instruments Inc.
//   October 2006
//   Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.41A
//******************************************************************************
#include  "msp430xG46x.h"

void main(void)
{
  volatile unsigned int i;

  WDTCTL = WDTPW+WDTHOLD;                   // Stop WDT
  FLL_CTL0 |= XCAP14PF;                     // Configure load caps

  do
  {
  IFG1 &= ~OFIFG;                           // Clear OSCFault flag
  for (i = 0x47FF; i > 0; i--);             // Time for flag to set
  }
  while ((IFG1 & OFIFG));                   // OSCFault flag still set?

 //P2SEL |=0x30;                              // P2.4,5 = USCI_A0 RXD/TXD
  P4SEL |= 0x0C0;                           // P4.7,6 = USCI_A0 RXD/TXD
  UCA0CTL1 |= UCSSEL_1;                     // CLK = ACLK
  UCA0BR0 = 0x03;                           // 32k/9600 - 3.41
  UCA0BR1 = 0x00;                           //
  UCA0MCTL = 0x06;                          // Modulation
  UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**
  IE2 |= UCA0RXIE;                          // Enable USCI_A0 RX interrupt

  _BIS_SR(LPM0_bits + GIE);                 // Enter LPM0, interrupts enabled
}

//  Echo back RXed character, confirm TX buffer is ready first
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCIA0RX_ISR (void)
{
  while(!(IFG2&UCA0TXIFG));
  UCA0TXBUF = UCA0RXBUF;                    // TX -> RXed character
}
=============================================================

And here is the schematic of the board. I circled two portion of the schematic with green line which are tested by me.

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • souvik metia
    Posted by souvik metia
    on Dec 05 2011 07:45 AM
    Intellectual545 points

    Hi friend's the problem is solved partially.In TI code they only give the P4SEL |= 0x0C0; but when it doesn't work,i see the pin diagram properly,and  i found that there are another two pins which are also used for RXD(P2.4) and TXD(P2.5). then i write it on that program. After add the P2SEL |= 0x030; in the TI code, then also i found it doesn't work. then i add it( P2SEL |= 0x030;) in my own program which work properly. I think there may be some mistakes in TI code.

    Here is the TI code below which is not work after i add the port2(in blue color)

    ============================================================ 

    //******************************************************************************
    //   MSP430xG46x Demo - USCI_A0, Ultra-Low Pwr UART 9600 Echo ISR, 32kHz ACLK
    //
    //   Description: Echo a received character, RX ISR used. Normal mode is LPM3,
    //   USCI_A0 RX interrupt triggers TX Echo.
    //   ACLK = BRCLK = LFXT1 = 32768, MCLK = SMCLK = DCO~1048k
    //   Baud rate divider with 32768hz XTAL @9600 = 32768Hz/9600 = 3.41 (0003h 03h )
    //   //* An external watch crystal is required on XIN XOUT for ACLK *//   
    //
    //
    //                MSP430xG461x
    //             -----------------
    //         /|\|              XIN|-
    //          | |                 | 32kHz
    //          --|RST          XOUT|-
    //            |                 |
    //            |     P4.7/UCA0RXD|------------>
    //            |                 | 9600 - 8N1
    //            |     P4.6/UCA0TXD|<------------
    //
    //   K. Quiring/ M. Mitchell
    //   Texas Instruments Inc.
    //   October 2006
    //   Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.41A
    //******************************************************************************
    #include  "msp430xG46x.h"

    void main(void)
    {
      volatile unsigned int i;

      WDTCTL = WDTPW+WDTHOLD;                   // Stop WDT
      FLL_CTL0 |= XCAP14PF;                     // Configure load caps

      do
      {
      IFG1 &= ~OFIFG;                           // Clear OSCFault flag
      for (i = 0x47FF; i > 0; i--);             // Time for flag to set
      }
      while ((IFG1 & OFIFG));                   // OSCFault flag still set?

      //P4SEL |= 0x0C0;                           // P4.7,6 = USCI_A0 RXD/TXD

      P2SEL |= 0x030;
      UCA0CTL1 |= UCSSEL_1;                     // CLK = ACLK
      UCA0BR0 = 0x03;                           // 32k/9600 - 3.41
      UCA0BR1 = 0x00;                           //
      UCA0MCTL = 0x06;                          // Modulation
      UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**
      IE2 |= UCA0RXIE;                          // Enable USCI_A0 RX interrupt

      _BIS_SR(LPM0_bits + GIE);                 // Enter LPM0, interrupts enabled
    }

    //  Echo back RXed character, confirm TX buffer is ready first
    #pragma vector=USCIAB0RX_VECTOR
    __interrupt void USCIA0RX_ISR (void)
    {
      while(!(IFG2&UCA0TXIFG));
      UCA0TXBUF = UCA0RXBUF;                    // TX -> RXed character
    }
    ===========================================================

    And here in below is my code based on that. Which works properly.

    ===========================================================

    #include  <msp430xG46x.h>

    void main(void)
    {
      //volatile unsigned int i;
      //volatile unsigned char temp[]="HELLO";
      WDTCTL = WDTPW+WDTHOLD;                   // Stop WDT
      FLL_CTL0 |= XCAP14PF;                     // Configure load caps

      do
      {
      IFG1 &= ~OFIFG;                           // Clear OSCFault flag
      //for (i = 0; i <=0x47FF; i++);             // Time for flag to set
      _delay_cycles(50000);
      }
      while ((IFG1 & OFIFG));                   // OSCFault flag still set?
        P2SEL |= 0x30;                         // P2.4,5 = USCI_A0   RXD/TXD
     
      //P4SEL |= 0x0C0;                         // P4.7,6 = USCI_A0 RXD/TXD
      UCA0CTL1 |= UCSSEL_1;                     // CLK = ACLK
      UCA0BR0 = 0x03;                           // 32k/9600 - 13.65
      UCA0BR1 = 0x00;                           //
      UCA0MCTL = 0x06;                          // Modulation
      UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**

     while(1)
     {
         //for(i = 0; i<=5; i++)
       // UCA0TXBUF = temp[i];
        _delay_cycles(1000);
         UCA0TXBUF = 0x41;
     }
     }
    ===========================================================

    I want to know that if i want to show a single character it gives me proper value but when i want to write a "HELLOWORD" in my above program it shows me garbage value though it take less than 13 bit.Please reply

    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