Communication protocol for microcontroller to PC host
it turns out the PC sends data too fast for the MCU to react, and a lot of data is lost

There are four standard solutions for this:

turn down the baud rate

hardware flow control: the RTS/CTS lines (not always supported on the PC end!)

software flow control: &quot;XON/XOFF&quot;. Doesn't work terribly well since data may be in flight by the time the microcontroller is sending the &quot;stop, I'm overloaded&quot; character.

increase the receive buffer. Almost all microcontrollers can keep up with 115k baud if all the interrupt handler is doing is adding characters to a buffer.