i'm using 8E1 serial conversation on UART0 of my Atmega328p (Arduino Nano). Everything works so far.
But now i wonder how to detect framing oder parity errors on the line?
I know that hardware UART has registers for this kind of errors, but can't find any hint if and how to use it in Arduino's "Serial" instance. Furthermore it has it's own ringbuffer for incomming data. So if i query the errorflags from the UART directly, i don't know which byte was wrong.
mikrotron:
But now i wonder how to detect framing oder parity errors on the line?
If your programming knowledge is limited maybe it is worth considering another way to deal with data errors.
Your sending code could add a check sum into the data and your Arduino program could verify that the received data matches the included check sum. If it does not, then just discard the data and request another copy from the sender.