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.

MSP430F5529, How to set baudrate to 9600bps at 8MHz?



I successfully set baudrate to 9600bps at 1MHz (SMCLK) by either of the following configurations without knowing what they exactly mean, especially the MCTL register:

UCA0BR0 = 6;
UCA0BR1 = 0; 
UCA0MCTL = UCBRS_0 + UCBRF_13 + UCOS16;

// UCA0BR0 = 0x68;
// UCA0BR1 = 0x00;
// UCA0MCTL = 0x04; 

However, when I change SMCLK to 8MHz, I couldn't figure out what should be the settings. I tried a couple online calculator but the values won't work for me.

Any suggestions on the values, or better yet, an explanation of what they represent, would be very much appreciated.

Thanks.

  • Rui,


    look at the user's guide:

    On page 993 there is a table with commonly used baudrates. You do not even have to do the calculations yourself - TI has already done this for you. For a BRCLK of 8MHz and a transmission speed of 9600 baud you have to

    • Set UCOS16
    • Set UCBR to 52
    • Set UCBRF to 1
    • Set UCBRS to 0x49

    This will give you a maximum error of +0.14 % at receiving which isn't much at all.

    Dennis

  • Rui Zhu said:

    However, when I change SMCLK to 8MHz, I couldn't figure out what should be the settings. I tried a couple online calculator but the values won't work for me.


    You tried also this one?

    forum.43oh.com/.../2640-uart-configurator

**Attention** This is a public forum