I am using the USART in synchronous mode to communicate from the host computer to firmware(resides in ATMega 1284P). My maximum buffer size in the firmware side is 20, If I send the data continuously from the host to the firmware and some replies from firmware to host computer, somehow the communication locks up. I doubt that the UDR register which is common for both Transmit Data Buffer(TXB) and Receive Data Buffer(RXB) to send/receive the data in/out of the firmware is locked which results in ceasing of communication. Any Suggestion for this issue?
PS: For transmisson from firmware to host, the codition is: UCSRA & (1 << UDRE) should be TRUE
For reception from host to firmware, the condition is: UCSRA & (1 << RXC) should be TRUE
I am using hardware interrupt M_USARTx_RX_vect for checking the availability of the serial characters from host.
Update: Firmware - Initial Source : MarlinSerial.cpp : USART Definitions, Marlin_main.cpp : Program Flow