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

UARTE0 BAUDRATE setting method

OS in development environment :Windows7
HARD :(Taiyo Yuden)EBSHSN Series Evaluation Board : Central / Peripherals
CPU :(Nordic) nRF52832 / ARMR Cortex-M4F 32 bit processor 28-pin Land Grid Array / 15GPIOs / SWD
Soft Ver:nRF5_SDK_15.3.0_59ac345

The ble_app_uart program uses UARTE0. However, the correct value is not set in the UARTE0 BAUDRATE register.
(UART0 BAUDRATE value is set)
How can I set the UARTE0 BAUDRATE register correctly?

"Ble_app_uart_c" UARTE0 BAUDRATE register setting is also wrong

Parents
  • Hi

    As you can see in the main.c file of the ble_app_uart example, the application checks if you're using UART or UARTE, and sets the baud rate accordingly.

    #if defined (UART_PRESENT)
            .baud_rate    = NRF_UART_BAUDRATE_115200
    #else
            .baud_rate    = NRF_UARTE_BAUDRATE_115200
    #endif

    I'm afraid I don't understand what you mean in your last reply, but you can set it by using any of the baud rate values defined in nrf_drv_uart.h and replacing it with the baud rate you want to use in your application.

    Best regards,

    Simon

Reply
  • Hi

    As you can see in the main.c file of the ble_app_uart example, the application checks if you're using UART or UARTE, and sets the baud rate accordingly.

    #if defined (UART_PRESENT)
            .baud_rate    = NRF_UART_BAUDRATE_115200
    #else
            .baud_rate    = NRF_UARTE_BAUDRATE_115200
    #endif

    I'm afraid I don't understand what you mean in your last reply, but you can set it by using any of the baud rate values defined in nrf_drv_uart.h and replacing it with the baud rate you want to use in your application.

    Best regards,

    Simon

Children
  • The following program sets "NRF_UART_BAUDRATE_115200" when "UART_PRESENT" is valid, and sets "NRF_UARTE_BAUDRATE_115200" otherwise.
    However, if “UART_PRESENT” and “UARTE_PRESENT” are enabled, set “NRF_UART_BAUDRATE_115200”.
    For “nRF52832”, “UART_PRESENT” and “UARTE_PRESENT” are valid and “UARTE0” is used, but “NRF_UART_BAUDRATE_115200” is set.
    -------------------------------------------------- -------------------------------------------------- -
    #if defined (UART_PRESENT)
    .baud_rate = NRF_UART_BAUDRATE_115200
    #else
    .baud_rate = NRF_UARTE_BAUDRATE_115200
    #endif
    -------------------------------------------------- -------------------------------------------------- -
    Is ".baud_rate = NRF_UARTE_BAUDRATE_115200" good without using a judgment statement?
    “Ble_app_uart_c” is “.baud_rate = NRF_UART_BAUDRATE_115200” without a judgment sentence. Is it OK to change to “.baud_rate = NRF_UARTE_BAUDRATE_115200”?

Related