This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Serial port help needed



hey m using an Express card as my laptop does not has a serial port. When i use in device manager i see two COM port, one is of the express card & other is of MSP430, i select the one for express card & try to connect to hyperterminal. I am able to establish a connection but after that in the hyperterminal text area i cannot type any data to be transmitted & if i do type the data is not echoed back. Can you please help me where am i going wrong.

the code is:

#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
  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

}

 I guess the interrupt ia not handled.

Thanx.

 

Sid

  • For debugging such UART scenarios, it can be helpful to break the system apart to better isolate where the issue is. For example, in this case I would recommend disconnecting the serial signal lines from the MSP430 (P4.6/P4.7), and directly shorting them together to force a loop-back. This way, the whole setup "PC + Serial Port + Level Shifter HW" can be tested. If this works, then the focus should be on the MSP430 HW and SW side. Are the right pins used? Is GND connected as well? Is the MSP430 code really running (in HW, not in the simulator!)? Is the baud rate configured properly, etc.

    Regards,
    Andreas

**Attention** This is a public forum