Is there any way to stop a async serial transmition ?
I will assume you are meaning from the receiving end of the transmission. The typical ways to ‘gate’ serial communications is through handshaking. This can be either hardware or software based. Hardware is done through RTS/CTS signals, meaning Request to Send and Clear to Send. In this mode the transmitter asserts the RTS to tell the receiver it would like to send something. If the receiver is ready it asserts the CTS to signal it is OK. If at some point the receiver needs to stop the transmission, say a buffer is getting full, it removes the CTS signal and the transmitter should stop at the end of the current character being transmitted. When the receiver re-asserts the CTS signal, the transmitter resumes the transmission with the next character it had to send. Software handshaking requires certain codes to be recognized by the transmitter and needs full duplex communications to work. The hardware method is often easier to implement if you have some ports available to control it.