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

UART frame error detection

Hi Nordic,

Could you please help me ! This is an urgent matter!

Based on this discussion,  there is an error rate of actual baudrate comparing with the desired one.

So, when i use an internal 16Mhz clock source, is it possible to detect an error frame on uart while receiving data for long time (with baudrate 230400, hardware flow control enabled)? 

Is, it possible to calibrate the baudrate actual value ? 

 

Best Regards,

Mehdi.

  • Hello,

    As you can see here, the fault in the UART Baudrate is not due to inaccuracy in the 16M clock, but that the register that sets the baudrate does not use the 12 LSB. You will see the actual baudrates in the link.

    Usually, UART is quite forgiving on clock accuracy, but I assume you have some other device that does not work? Are you able to change the baudrate on that device?

     

    I am aware that the link above is for the nRF52832, but the values are the same. You can see in any of the examples, that e.g. 1M baudrate is 0x1000 0000 = (dec)268 435 456, which is the same as the defines in the sdk_config.h files for the nRF51 as well.

     

    What do you mean by detecting an error frame? On a message coming in to the nRF or going out?

     

    Best regards,

    Edvin

  • Hi Edvin,

    Thank you for your quick reply,

    By the way, nrf51 APP_UART_COMMUNICATION_ERROR is executed on a comming in message.

    I don't now the error source, but it's not possible of  overrun or parity occurence, because i use a hardware flowcontrol and the parity feature is disabled.

    But I have doubts whether it is FRAMING error.

    Best Regards,

    Mehdi

  • The error_communication field is briefly explained in the SDK and on infocenter, but what is the value of your 

    p_event->data.error_communication

    in

    uart_error_handle(app_uart_evt_t * p_event)?

    You probably have to turn of optimization (-O0) and debug in order to see it, or you can define DEBUG in your preprocessor defines, and check the error handler (breakpoint on line 76 in app_error.c. Still probably requires that you turn off the optimization).

     

    Best regards,
    Edvin

Related