Suppose we have two microcontrollers , UART module was initialized to work as a Transmitter and Receiver ( full doublex communication ) for both of them.
Before the super loope one of them send a certain byte , and in the super loop some times the first micro and the second one received and some times the second one sends and the first one received and so on .
So, how can to code something like that ? The void uart_sendByte(uint8 data) and uint8 uart_receiveByte() are working using pollong technique .
How can I control the communication so receive right data at the right time and send the right data at the right time ?
Header File For UART Driver for AVR Atmega16 Microcontroller
UART Driver Code