AnsweredAssumed Answered

Receive data from usart(Asynchronous) when parity bit is set

Question asked by Muzahir Hussain on Jan 23, 2018
Latest reply on Jan 23, 2018 by Clive One

I am using usart1 for asynchronous communication. Microcontroller is nucleo STM32F103RB.

 

Here's is how I am receiving data if parity bit is not set,

char USART1_Receive()
{
    if((USART1_SR & 0x00000020) == 0)    // no data available 
        return 0;
    return USART1_DR;
}

 

My question is, how should I receive data if parity error occurs? How should I handle parity error?

Outcomes