Hi All,
I am working with Xbee and the max size of the serial buffer on it is 100 bytes. So I would like to change the Due from 64 bytes to 100 bytes.
The Arduino Due is so large that I would like to try and make the buffer size for the serial port to be larger.
I am using all of the Serial ports on the Due but would like to make only Serial1 larger.
I have seen stuff out there for changing the Arduino Uno buffer size but that doesn't work with the SAM processor.
Also I have tried to use the serialEvent1() but that still doesn't read the data fast enough to clear the buffer.
Any help would be great.
Also I have tried to use the serialEvent1() but that still doesn't read the data fast enough to clear the buffer
Isn't the trick simply to not spend too long in "loop()", and grab as much as you can during SerialEvent?
system
May 23, 2014, 12:16am
3
Well I found out how to change it, just went through all of the files and found which file to change it in.
arduino-1.5.5\hardware\arduino\sam\cores\arduino\RingBuffer.h
Change the value of "#define SERIAL_BUFFER_SIZE 64", I ended up changing it to 256 as I am not using a log of space on the Due at the moment.
Hope this can help others if they have this problem.
do not change RingBuffer.h : Put this at the first line of your project/sketch
#define SERIAL_BUFFER_SIZE 256
check it in your sketch with:
Serial.print(SERIAL_BUFFER_SIZE);
AdderD
February 16, 2015, 5:54pm
5
Steffen, I could be wrong but I doubt that'll do any good. C/C++ is compiled on a per-file basis and setting the serial buffer size in your sketch will only set the define for that file. The arduino core is compiled separately and so those files will use the define already existing in RingBuffer.h I don't really see any easy way to fix this.
MorganS
February 17, 2015, 11:45am
6
Collin is right. Steffen's suggestion doesn't change the value that the UART class sees. I just created a test sketch and ran it on a Due to check.
If you want more details about this, you are welcome to look at this post