This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Parity bit problem in USARt

Hello
here my usart settings that it works fine

        USAR.USART_BaudRate=9600;
        USAR.USART_StopBits=USART_StopBits_1;
        USAR.USART_WordLength=USART_WordLength_8b;
        USAR.USART_Parity=USART_Parity_No ;
        USAR.USART_HardwareFlowControl=USART_HardwareFlowControl_None;
        USAR.USART_Mode=USART_Mode_Rx | USART_Mode_Tx;

but when I want to decrease my error I want to use parity bit and I have changed settings as shown below

        USAR.USART_BaudRate=9600;
        USAR.USART_StopBits=USART_StopBits_1;
        USAR.USART_WordLength=USART_WordLength_8b;
        USAR.USART_Parity=USART_Parity_Even  ;
        USAR.USART_HardwareFlowControl=USART_HardwareFlowControl_None;
        USAR.USART_Mode=USART_Mode_Rx | USART_Mode_Tx;

but when I do the same settings in my pc to receive data ( for even parity bit) it doesn't receive anything.

Parents
  • Thank you Zack Havens
    I didn't pay attention to bit settings. it works fine

    USAR.USART_WordLength=USART_WordLength_9b;
    

    Thanks Andrew Neil for your explanation

    A parity bit does absolutely nothing to decrease errors!
    

    why do you say that?As I know parity bit was born to decrease fault receiving byte with a simple check.
    Yes we can't decrease Noise signal but we try to limit input fault data

Reply
  • Thank you Zack Havens
    I didn't pay attention to bit settings. it works fine

    USAR.USART_WordLength=USART_WordLength_9b;
    

    Thanks Andrew Neil for your explanation

    A parity bit does absolutely nothing to decrease errors!
    

    why do you say that?As I know parity bit was born to decrease fault receiving byte with a simple check.
    Yes we can't decrease Noise signal but we try to limit input fault data

Children
No data