How to increase the UART buffer?

Hi, everybody!
I faced a problem not grasps of the size of the UART buffer. Whether it is possible to increase the buffer size?

You can either edit the source, or you could poll more frequently.

search for hardware serial.cpp

AWOL:
You can either edit the source, or you could poll more frequently.

Check of arrival of data in UART to be made each 2 seconds. I can't check more often!

robtillaart:
search for hardware serial.cpp

You can tell that it is necessary to change?

I can't check more often!

I'd fix that.
At any common line speed, you could fill the memory of most Arduinos in that time..

I can't check more often!

Sure you can. You have our permission.

robtillaart:
search for hardware serial.cpp

Thank you very much! I increased the buffer to 128 bytes.

AWOL:
At any common line speed, you could fill the memory of most Arduinos in that time..

Tell me about it. In one embedded device I develop for at work, the device has a 4KB SRAM buffer for receive, and a 2KB buffer for transmit. That's 3x the total SRAM availability of the ATmega328P, just for the serial ring buffers, necessitated by the high speed RS485 packet protocol used. I don't think I'll be implementing that comms protocol for Arduino any time soon... :slight_smile: