I want to establish a communcation between my ATmega32A and PC but there's a line that I don't understand. The datasheet says that:"When data comes in,the RXC0 bit in UCSR0A will be set,and you can read the incoming data out of UDR0
The function to receive byte looks like this:
unsigned char USART_receive(void)
{
while(!(UCSRA & (1<<RXC)));
return UDR;
}
What I understand from this:We wait until all the bits are inside of the UDR register and when the RXC turns to 0 we gonna return UDR register. Can someone clarify me if I'm right or not?