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.

Baudrate register value for 921600 baud @ 20MHz clock

Dear all,

 

What are the register settings for 921600 baud @ 20MHz clock?

I already tried (UCA0BR0/UCABR1/UCAMCTL) two possibilities from baudrate calculators:

0x15/0x00/0x5b

0x15/0x00/0xdd

With both I can receive and send some characters correctly ( e.g. w,W,u,U), others doesn't work

Any idea?

Lukas

 

  • Try not using UCOS16.  0x15 / 0x00 / 0x0C  (makes UCBRSx = 6, for 7 of 10 bits longer, because 20M / 921.6K = 21.7)

    Jeff

  • Hi Jeff,

     

    thanks for your response. Unfortunately, your suggested values do not help to solve my problem. Any other idea?

     

    Lukas

  • A couple of other thoughts:

    1. From your other post I'm guessing you have a 4MHz reference.  Your 20MHz clock is really the DCO, steered by the FLL.  When combining DCO modulation, FLL steering, and UART clock modulation, you might be pushing your luck too far when the DCO is only 21 times faster than the UART clock.  Have you tried using the 4MHz reference directly?  It has no modulation or FLL steering.  The settings would be 0x04 / 0x00 / 0x4 (UCBRSx = 2, for 3 long bits) with SMCLK at 4MHz and MCLK still at 20MHz.
    2. 921600 baud is extremely fast.  Have you tried 230400 just as a test?  The settings for 230400 are available in the User's Guide in the USCI - UART section.  If it works at 230400 buad, then as you increase baud rate (460800 and then 921600), if it fails you want to look at wave shaping (on an oscilloscope) and timing (again, a scope) and your code (for efficiency and speed to keep up with two or more incoming characters in a row).

    Jeff

  • Hi Jeff,

     

    thanks for your support. I switched to 4MHz SMCLK, but this does not help. Now I working with 4MHz.

    Then I tried to produce 230400 baud, which worked. Then I increased the baudrate to 460800. With an oscilloscope I checked the timing which was slightly not as expected. I have to check that on monday.

    Thank you and have a nice weekend

    Lukas

     

  • Hi Jeff,

     

    I checked the timing again with the oscilloscope. Today I also checked the timing directly on the Tx line of the microcontroller and there the timing is correct for 0x04/0x00/0x04. Therefore I guess that the line driver has a problem with the high baudrate and not the msp430 nor the software. Sorry!

    Tank you again for your support

    Lukas

**Attention** This is a public forum