How to set none parity 1 stop bit to Odd parity 2 stop bit Using uart?

Hi, I use nRF52840, with SDK 15.3.0

Using UART communication, I should change data type like None parity, 1 stop bit is default setting.

I use nrfx_uart.

So How can I use Odd parity bit or Even parity bit.

And How to use 2 stop bits?

There is no stop bit setting in nrf_uart_configure.

Thanks in advance!

Parents
  • Hi,

    The driver does not expose the stop bit configuration (this was introduced in nRFx v.2.x.x used by the nRF connect SDK). To work around this limitation you can change the stop bit configuration "manually" by writing directly to the UART CONFIG register:

        //Change stop bit configuration after initializing the nrfx UART driver 
        NRF_UART0->CONFIG |= (UART_CONFIG_STOP_Two << UART_CONFIG_STOP_Pos);

    Best regards,

    Vidar

Reply
  • Hi,

    The driver does not expose the stop bit configuration (this was introduced in nRFx v.2.x.x used by the nRF connect SDK). To work around this limitation you can change the stop bit configuration "manually" by writing directly to the UART CONFIG register:

        //Change stop bit configuration after initializing the nrfx UART driver 
        NRF_UART0->CONFIG |= (UART_CONFIG_STOP_Two << UART_CONFIG_STOP_Pos);

    Best regards,

    Vidar

Children
Related