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 UART on 115200

I want to echo a letter from PC at 115200 baud rate. I have check this http://e2e.ti.com/support/microcontrollers/msp430/f/166/t/290186.aspx . and other alike questions on forum. But  I still cannot find a solution. My launchpad runs msp430g2xx3_uscia0_uart_01_9600.c correctly, but when I change to msp430g2xx3_uscia0_uart_01_115k, there is no response. Then I add a Timer(show as below) to my code and see the output, but then I see nothing but spase outputting.

#pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer_A (void)
{
	while(!(IFG2&UCA0TXIFG));
	UCA0TXBUF  =  '*';
}

  • Hi,

    for operating the UART in 115200 baud, I would suggest to set the SMCLK to 16 MHz. 

    Please refer here also:

    http://processors.wiki.ti.com/index.php/USCI_UART_Baud_Rate_Gen_Mode_Selection

  • Thank you for your instruction, but according to your given file, I can still implement 115200 baud rate at Low Frequency Baud-Rate Mode, which I just need to configure the register like 

    UCA0BR0 = 8;                              // 1MHz 115200
      UCA0BR1 = 0;                              // 1MHz 115200
      UCA0MCTL = UCBRS2 + UCBRS0;               // Modulation UCBRSx = 5

    where SMCLK = 1MHz. I want to know the reason why I fail to make it. Does msp430 2553 launchpad not support 115k baud rate, or there is something wrong with my configuration?

    Thank you.

     

  • One last simple question, does the original uart-usb module on my launchpad support the maximum baud rate at 9600? If I need to configure to 115200, is it necessary to add external converter?

  • There is no need for repeating same question on more than one topic.

  • Crist,

    if you use the "USCI UART Calculator" in the wiki page mentioned above, you can see that by using 1 MHz clock input and expecting 115200 baud output is not feasible:


    S-Modulation UCBRSx = 6
    UCxBR0UART = 8
    UCxBR1UART = 0
    UCxBRS = 6
    UCxBRF = 0
    Max. TX bit error: -7.840000000000004(-7.840000000000004, 6.4000000000000865)
    Max. RX bit error (sync.: -0.5 BRCLK): -9.680000000000001(-9.680000000000001,4.560000000000085)
    Max. RX bit error (sync.: +/-0 BRCLK): 10.320000000000068(-3.920000000000002,10.320000000000068)
    Max. RX bit error (sync.: +0.5 BRCLK): 16.08000000000005(0,16.08000000000005)
    Max. RX bit error (over: -0.5,0,+0.5): 16.08000000000005(-9.680000000000001,16.08000000000005)
    ... not feasible!

    I would suggest then to use either > 8 MHz clock input.

  • Leo, you’re right that the bit error is quite large and might be a problem. However, the real problem lies somewhere else:

     The calculation assumes a steady, jitter-free (ideal) frequency of 1MHz. Which you won’t have on a G2553 DCO.
    The DCO produces an average clock frequency of ~1MHz (when using the calibration values) that is as close as possible to 1MHz. Which means the average DCO frequency may (and will on most devices) have some additional error. Especially if temperature and supply voltage do not exactly match the conditions at calibration time.
    In addition, one bit is generated over a period of 8 or 9 DCO clock cycles. However, the DCO modulation sequence is 32 clock cycles long. So chances are, that during some bits, the 8 clock cycles are significantly above or below 1MHz.

    Using 4MHz DCO clock speed means that at least one complete modulation sequence is used per bit.

    I dare to say that with a 1MHz crystal (which the G2553 does not support) or an external 1MHz clock signal (which the 2553 does not support officially too, but which has been proven to work by OCYs experiments), 115200Bd shouldn’t be a problem in most cases despite of the calculated bit error -  unless the other side has an unlucky drift to the wrong side of the allowed error window.
    But not with a free-running DCO.

**Attention** This is a public forum