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.

Connect MSP430FG439 UART via RS232 to USB HyperTerminal

Other Parts Discussed in Thread: MAX3232

Hi, 

I am having troubles in trying to send and receive the same data that I input from Hyper Terminal. I am using 9600baud rate at 300kHz.  I assume that HyperTerminal sends a signal through the RS232 to start the sequence for UART.

HyperTerminal Settings:

I have 3 pins connected to the RS232 which are TX and RX and GND. Is there one I am missing?

this is my code below:

void main(void) {

int i;
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
SCFI0 |= FN_2;
SCFI0 &= ~BIT6;
SCFI0 |= BIT7;

P1SEL |= (BIT1 + BIT4);
P1DIR |= (BIT1 + BIT4);
P1OUT |= (BIT1 + BIT4);

P2SEL |= (BIT4 + BIT5); // USART TX(2.4)pin55, RX (2.5) pin54
P2DIR |= BIT4; // Output for TX
UCTL0 |= (SWRST);
UCTL0 |= CHAR; // 8-bit character
UTCTL0 |= (SSEL1); // UCLK = SMCLK
ME1 |= UTXE0 + URXE0; // Enable USART0 TXD/RXD

U0BR0 = 0x31; // for 9600 baud rate at 300kHz
U0BR1 = 0x00;
UMCTL0 = 0x03; // modulation
UCTL0 &= ~SWRST; // start state machine for USART
IE1 |= URXIE0;// + UTXIE0; // Enable USART0 RX/TX interrupt
_BIS_SR(LPM0_bits + GIE); // Enter LPM0 w/ interrupt

}

#pragma vector=USART0RX_VECTOR
__interrupt void usart0_rx (void)
{
while (!(IFG1 & UTXIFG0)); // USART0 TX buffer ready?
TXBUF0 = RXBUF0; // RXBUF0 to TXBUF0
}

  • The connection of the 3 pins are correct ... Check your connection with the board

    TX (RS323) <---> RX (the board )

    TX (the board) <---> RX (RS323 )

    GND <--->  GND


    What board are you using by the way?

  • Hello,

    common problem: Are you really trying to driectly communicate RS232 to MSP430? Unless your controller is capable of doing the voltage shift this wont be possible. You will need a RS232 converter.

    RS232 is differential signal

    MSP430 is single ended

    There are a couple of ICs which will do the work for you, Maxim for example, TI could have some too.

    Hope that help.

  • Fri_coder said:

    The connection of the 3 pins are correct ... Check your connection with the board

    TX (RS323) <---> RX (the board )

    TX (the board) <---> RX (RS323 )

    GND <--->  GND


    What board are you using by the way?

    I am using TS430pn80 Board

  • seb said:

    Hello,

    common problem: Are you really trying to driectly communicate RS232 to MSP430? Unless your controller is capable of doing the voltage shift this wont be possible. You will need a RS232 converter.

    RS232 is differential signal

    MSP430 is single ended

    There are a couple of ICs which will do the work for you, Maxim for example, TI could have some too.

    Hope that help.

    Thanks for the info, I'll look into it. :)

  • Actually RS-485 is differential.  RS-232 uses positive and negative voltages as 1's and 0's while the MSP430 board uses TTL voltage levels.

    If anyone knows of a good RS-232 to TTL voltage translator please post, I am looking for one.  Thanks.

  • Mark Vojta1 said:
    If anyone knows of a good RS-232 to TTL voltage translator please post, I am looking for one.

    Well, for RS232 to TTL you can use a diode and an inverting CMOS gate :)

    But I guess you want to send too.

    The MAX3232 works with 3V (so it matches the MSP VCC) and uses a few ceramic capacitors to generate the required R232 voltages. There are several variants with a different nubmer of in and out lines. The basic model has two in each direction, so you can use RTS/CTS or DTR/DSR too.

  • Mark Vojta1 said:

    If anyone knows of a good RS-232 to TTL voltage translator please post, I am looking for one.

    This part also does RS-232 to TTL translation:

    http://www.ti.com/product/trs232

    Regards,

    Kelvin

**Attention** This is a public forum