This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Accurate or custom baudrate on nrf9160

Hi

On a nrf9160, I need to send data via UART(E) at 921600 baud. According to the UARTE BAUDRATE register documentation the register value 0xF000000 (Baud921600) leads to an actual rate of 941176 Hz. This is also what I measure on the oscilloscope. Setting the BAUDRATE register to an interpolated value 0xEBEDFA4 seems to result still in approx. 940000. What is the recommended way to achieve more accurate baudrate 921600?

Follow-up question: Is it possible to use custom baud rates, or are only the baudrates listed in the UARTE BAUDRATE register documentation supported?

Thanks,
Matthias

  • Custom baud rate can be used, provided both the devices has the same buad rate. Even small change in the clock will result in error.  So you shall us cristal clock to have effective communication

  • When I mean accurate baud rate, I mean close to the "Standard Baud Rates". E.g. when I set BAUDRATE register to Baud921600 (0x0F000000) the nrf91 uses actual rate 941176 (which it produces quite accurate as I use HFXO and GPIO High Drive

    I don't see from your answer how to use any other (custom) baud rate then those listed in the BAUDRATE table. I need to communicate with 921600 baud, because my counterpart MCU (maxim 32651) does not accept baudrate 941176 (and we cannot modify that counterpart system)

  • I actually figured out, that in some situations linear interpolation between the actual values given in the BAUDRATE table lead to the expected (linear interpolated) signals. E.g. register value 0x6000000 leads to approx 380kbaud.

    However, according to linear interpolation, I'd expect then that register value 0xEAFC293 would lead to 921.6kbaud but it results in a signal with 939kbaud.

    Is there any value I can set in the BAUDRATE regiser which results in a signal with baudrate 921600?

  • Here are some measurement results on a nrf9160dk. I assume the non-linearity at high baudrates is due to timer multiplications?

    REGISTER       Measurement
    0x06000000 --> 380000 baud
    0x0F000000 --> 940000 baud
    0x0EAFC293 --> 939000 baud
    0x0E679E98 --> 939000 baud
    0x0A000000 --> 638500 baud
    0x0D000000 --> 849600 baud
    0x0E100000 --> 893000 baud (double checked. This is higher than for 0x0E200000 !!)
    0x0E200000 --> 878000 baud
    0x0E300000 --> 878000 baud
    0x0E400000 --> 939800 baud
  • I couldn't find that in the product specification, but most probably the UARTE frequencies are limited to the HFCLK frequency and possible divisors. As HFCLK is 16 MHz fractions of 16MHz is supported. I.e. closest frequencies to 921600 Hz are either 941176.5 (16MHz/17) or 888888.9 (16MHz/18).

Related