Issue with NRF52833 uart registers configuration to send data to ESP32

Greetings,

I'm currently working on establishing UART communication between a custom board equipped with an NRF52833 and an ESP32. Although the ESP32 successfully receives data, it doesn't align with my expectations. I suspect that the discrepancy lies in the UART configuration settings of the NRF52833, and I'm having difficulty pinpointing the error. Here is my current configuration:

void initUART(void){
    NRF_UARTE1->BAUDRATE = UARTE_BAUDRATE_BAUDRATE_Baud115200;
    NRF_UARTE1->PSEL.RXD = 24;
    NRF_UARTE1->PSEL.TXD = 22;
    NRF_UARTE1->CONFIG = 0x00;
    NRF_UARTE1->ENABLE = (UARTE_ENABLE_ENABLE_Enabled << UARTE_ENABLE_ENABLE_Pos);
    NRF_UARTE1->RXD.PTR = (uint32_t)((uint8_t *)rxBuffer);
    NRF_UARTE1->RXD.MAXCNT = BUFF_SIZE;
    NRF_UARTE1->EVENTS_RXDRDY = 0;
    NRF_UARTE1->INTENSET = UARTE_INTENSET_RXDRDY_Msk;
    NVIC_EnableIRQ(UARTE1_IRQn);
    }
    
//esp32 config struture

uart_config_t uart_config = {
      .baud_rate = 115200,
      .data_bits = UART_DATA_8_BITS,
      .parity = UART_PARITY_DISABLE,
      .stop_bits = UART_STOP_BITS_1,
      .flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
      .source_clk = UART_SCLK_DEFAULT,
  };

I would greatly appreciate any insights or guidance you can offer to help resolve this issue. Thank you in advance.

Parents
  • Hello,

    Although the ESP32 successfully receives data, it doesn't align with my expectations. I suspect that the discrepancy lies in the UART configuration settings of the NRF52833, and I'm having difficulty pinpointing the error.

    Could you elaborate further on what specifically it is that does not align with your expectations?
    What is the behavior of the device, and how is it different from what you would have expected?
    Could you show any of the loggers output from the device, or what you are seeing in the connected serial monitor?

    Please help me to better understand the issue you are facing so that I may better advise you on how to resolve it.

    Best regards,
    Karl

  • Hello

    I successfully tested UART communication between two ESP32 devices, achieving flawless string transmission using the previously provided configuration. However, challenges surfaced when attempting the same test between an NRF52833 and an ESP32. In this scenario, the received data consists of illegible characters.

    I suspect a configuration mismatch between the NRF52833 and ESP32 UART settings, causing the issue. I've thoroughly reviewed the configurations but haven't identified the root cause.

    Thank you for your assistance.

  • Thank you for the clarifications.

    This sounds like there could be an issue with the connection between the devices as well, could you detail how your hardware is set up?
    It would also be great if you could detail what configurations you were using on your ESP32 devices during the test with the nRF.

    Do you have access to a logic analyzer, so that you may take a closer look at what is happening on the pins?

    Best regards,
    Karl

  • I found out it was my UART configuration, the hardware connection works flawlessly. Thank you for your assistance

  • I am happy to read that the issue has been resolved, and that it is now working flawlessly, great! :) 

    Please do not hesitate to open another ticket if you should encounter any other issues or questions in the future.

    Good luck in your development!

    Best regards,
    Karl

Reply Children
No Data
Related