I am using atmega32 while learning about communication protocols and i have a question about the parity flag in uart which is set if the received data has a problem with parity. Now i know from the datasheet that the atmega32 has a 2 register buffer to receive data in so if i didn't read the data 2 times and the buffer has 2 bytes of data now how do i know which byte had the error with the parity is there a solution for this case in atmega32 and also in other microcontrollers.
Should there be multiple flags for errors in each byte of the buffer?
According to the datasheet [1], there are a set of error flags for each frame in the receive buffer. So you can read the error flags before reading each frame of data.
[1] https://ww1.microchip.com/downloads/en/DeviceDoc/Atmega32A-DataSheet-Complete-DS40002072A.pdf