I am quite new to UART programming and trying to understand the concept of parity bit which is still not totally clear for me.
From what I understand so far :
Let's say I have 8 bits to transmit from UART deviceA to UART deviceB. Each time I want to send a byte to deviceB, then there is a start bit sent, then the 8 bits, then the parity bit and then the stop bit. OK, this is clear. Now, when deviceA is set to work with an odd parity, then the parity bit is set to 0 if the number of 1 in the byte is odd. And it's the opposite if the deviceA is set to even parity. OK, I understand that too.
Now, when deviceB receives the frame, it checks for the byte sent, that the parity bit is coherent with the number of 1 in the byte and there is a parity error if not. But this deviceB, has also a parity mode.
So my question is :
Should deviceA and deviceB be set to the same parity mode (even or odd) to make this control work as expected or am I wrong ?
Thanks for any help at clarifying this point.