How does the Arduino handle serial buffer overflow? Does it throw away the newest incoming data or the oldest? How many bytes can the buffer hold?
migrated from stackoverflow.com May 27 '14 at 15:25This question came from our site for professional and enthusiast programmers. |
|||
|
For hardware serial ports you can see in HardwareSerial.cpp that the buffer size varies depending on the amount of RAM available on the particular AVR:
For a software serial port in SoftwareSerial.h the receiver buffer size Ideally it would be best to ensure the buffer always gets emptied in a prompt manner to avoid the buffer filling. Maybe take a look at timers and implementing a simple state machine if your problem is related to other code blocking the main loop. |
|||
|