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.

MSP430G2553 Hardware UART Problems

Other Parts Discussed in Thread: TUSB3410, MAX3232

Hello Everyone!

After playing with 2553 for about 5 months now, I finally decided to quit using software UART and using Hardware UART in my codes. For the most part, the TI MSP430x2xx Family User's Guide was helpful for understanding how UART hardware worked, but only for the most part. I am trying to achieve a 2 way, full duplex 38400 baudrate, 1 Stop Bit, No parity RS232 connection, but unfortunately I have not been able to send healthy data yet. Here is my code:

#include <msp430g2553.h>

int main(void)
{
//UCA0CTL1 |= UCSWRST;

WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer

BCSCTL1 = CALBC1_8MHZ; // Set range
DCOCTL = CALDCO_8MHZ; // Set DCO step + modulation


P1SEL = BIT1 + BIT2; //select RXD and TXD for UART
P1SEL2 = BIT1 + BIT2; //select RXD and TXD for UART

UCA0CTL0 = 0;
UCA0CTL1 |= UCSSEL_3;

UCA0MCTL = UCBRF_0 + UCBRS_3;

UCA0BR0 = 208;
UCA0BR1 = 0x00;

UCA0CTL1 &= ~UCSWRST; //toggle swreset off

while (1)
{
UCA0TXBUF = 0x61;
//while (!(IFG2 & UCA0TXIFG));
_delay_cycles(8000000);
}
}


All I am trying to do is to send hex 61 about once every second but I do not see 61 on my computers terminal :/

UCA0MCTL = UCBRF_0 + UCBRS_3; // Comes from family Guide :S ????

I adjusted the UCA0MCTL and the UCA0BRx registers according to the User Family Guide to achieve 38400 Baud:

Could someone tell me what I am doing wrong?

PS: The jumpers are crossed so thats not the problem.

Thanks

-Anil

  • Hi Anil,

    The Launchpad "Applications UART" can only support baud rate up to 9600, since it's not a true UART per se but more like a timer emulated UART (as the TUSB3410's real UART is already busy communicating with the debug emulator).

    Tony

  • Hey Tony, I really appreciate your quick reply. I thought that 2553 was one of the few value line chips that actually had hardware UART. Are you saying there is no way for me to achieve more than 9600 baud on the launchpad? Once my project is done, my 2553 will be talking to my bluetooth module with UART so maybe it can achieve higher speeds without worrying about debugger stuff? Is that possible? Thanks Again! Anil
  • Anil Ozyalcin said:
    I thought that 2553 was one of the few value line chips that actually had hardware UART

    Oh, yes, it is. However, the MSP may support 115.2kBd easily, but the 'backchannel UART' in teh TUSB serial/USB bridge of the LaunchPad doesn't (as said, the highspeed serial lien of the USB bridge is used for the FET communication, or else debugging would take ages).
    If you attach your own MAX3232 chip and USB/serial converter to the MSP, you can go as high as 1MBd. Just not with the plain LaunchPad board.

  • What Jens-Michael said (I feel like I should add that to my signature...)

    Anyway, as an alternative to a MAX3232, you could also use the TUSB3410 from TI for a TTL UART if you prefer a purely USB solution and rather not deal with the plus-minus 5V level shifting.

    Other alternatives include the USB-to-UART chips from FTDI, the MCP2200 from Microchip, among others.

**Attention** This is a public forum