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

Baud rate for UART on nRF9160dk

Hello,

I am using UART_1 to receive GNSS data. For UART_1, baud rate is 115200bps. On terminal, I can see the correct data when baud rate is set to 115200bps. When the baudrate is changed, the data on the terminal is incorect (random characters).

Now I am using UART_2 to read accelerometer and gyroscope data from SAMG microcontroller. But it always shows some random characters. It never shows the correct data. I set UART_2 baud rate at 115200 and then at 921600. But still the data is always some random characters. So what is the maximum baud rate supported on nRF9160dk for UART? I am not understanding why the data is incorrect always.

  • Hi,

    The supported baudrates are  shown in the UARTE peripheral register BAUDRATE. It supports up to 1 Megabaud. How much data are you sending, and are you using HW flow control between the devices? Have you made sure that the UART of the "SAMG microcontroller" is set to the same that you configure on the nRF9160?

    Best regards,
    Jørgen

  • Yes UART of SAMG and nRF9160 are at the same baudrate. SAMG will send accelerometer and gyroscope data after every 5ms to nRF9160. I have not used HW flow control. I will try to use it. I think the problem is at the SAMG side. I will try to change the UART port also for SAMG. 

  • Hi

    I have set baudrate of SAMG UART to 921600 which will transmit the data. Then I set UART2 baudrate of nRF9160 to 921600 which will receive the data and I set UART0 also to 921600 which prints the data to terminal. But still on nRF9160, garbage value is received. I have checked the received data of nRF9160 on oscilloscope. It is correct. But still only the junk characters are received at nRF91 side. SAMG sends data after every 5ms.

    What can be the problem? What else I should check?

    Actually SAMG uses UART0 to send data to FTDI. But there are jumpers to connect to FTDI. If I remove these jumpers, I can use the UART pins on SAMG for use case. So I remove those jumpers and connect to nRF9160 UART pins. Same UART port can not be used to connect to two devices. So the jumpers are removed.

    Is it okay to use this UART port of SAMG? 

  • Maybe you can try to change the Baudrate slightly, i.e.

         

    Baud921600

    0x0F000000

    921600 baud (actual rate: 941176)

         

    Baud1M

    0x10000000

    1Mega baud

    If supported by the SAMG, try to change to 1M instead of 921600 to see if that helps. The actual rate is not far of, but might be that the SAMG doesn't like that.

Related