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

UART Parity Control

Hello I found similar questions but no answer? In the manual is written that I can control the parity bit in manual mode with the TXPARITY register but I can not find how?

I need to explicitly control the 9th parity bit regardless of what the parity is of the data being sent.

from the nRf51822 datasheet

27.1.5 Parity configuration When parity is enabled, the parity bit can be generated automatically from the odd parity of TXD, or alternatively the parity bit can be specified explicitly in the TXPARITY register.

Kind Regards Alex

Parents
  • Hi For my problem I fixed it for EVEN Parity with this code

    params.baud_rate = UART_BAUDRATE_BAUDRATE_Baud19200;
    params.tx_pin_no = TX_PIN_NUMBER;
    params.rx_pin_no = RX_PIN_NUMBER;
    params.use_parity = true;
    params.flow_control = APP_UART_FLOW_CONTROL_DISABLED;
    
    err_code = app_uart_init(&params, &bufs, uart_evt_handler, APP_IRQ_PRIORITY_LOW,  
    

    In the function app_uart_init I changed

    if (p_comm_params->use_parity)
    {
    			NRF_UART0->CONFIG  = 0x0E; // Parity enable   RX TX Auto
    }
    
Reply
  • Hi For my problem I fixed it for EVEN Parity with this code

    params.baud_rate = UART_BAUDRATE_BAUDRATE_Baud19200;
    params.tx_pin_no = TX_PIN_NUMBER;
    params.rx_pin_no = RX_PIN_NUMBER;
    params.use_parity = true;
    params.flow_control = APP_UART_FLOW_CONTROL_DISABLED;
    
    err_code = app_uart_init(&params, &bufs, uart_evt_handler, APP_IRQ_PRIORITY_LOW,  
    

    In the function app_uart_init I changed

    if (p_comm_params->use_parity)
    {
    			NRF_UART0->CONFIG  = 0x0E; // Parity enable   RX TX Auto
    }
    
Children
No Data
Related