cancel
Showing results for 
Search instead for 
Did you mean: 

UART Even Parity gives parity error

DDeba.1
Associate III

Hi,

I'm using STM8S for UART half duplex communication (single wire). I'm using the standard library to set the UART up in 9600 baud rate, 8 data bit, even parity and 1 stop bit. I recieve data using interrupts. On the third byte, I get a parity error. If I do not use parity check, everything works correctly. But when I enable parity, the third byte gives a parity error.

Attached is an image of the data I'm receiving (0x93 0x93 0x01 0xB1 .....). Any one has an idea why this may happen?

2 REPLIES 2

ST counts the parity bit as a data bit, for 8E1 you'd need to configure the UART in 9-bit mode.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
DDeba.1
Associate III

That solved my issue. Thanks!!!