Skip to main content
Graduate II
September 17, 2020
Question

UART Even Parity gives parity error

  • September 17, 2020
  • 2 replies
  • 1355 views

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?

    This topic has been closed for replies.

    2 replies

    Graduate II
    September 17, 2020

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

    DDeba.1Author
    Graduate II
    September 18, 2020

    That solved my issue. Thanks!!!