Go Down

Topic: Increasing Serial buffer size. (Read 175 times) previous topic - next topic

Prithiviraj_pandian

hi,
   I want to increase my rx buffer size for software UART. because i have four Software uart slaves from each i want take minimum i00KB of data and process it. meanwhile other slaves also will be sending the Data to my controller. in that time. how i can increase the RX buffer size to make no loss in data from all the nodes.

J-M-L

#1
Oct 17, 2016, 12:22 pm Last Edit: Oct 17, 2016, 12:23 pm by J-M-L
Needing this is usually a consequence of poor code design and not being able to read the buffer fast enough but in case this is really needed the Arduino/hardware/arduino/avr/libraries/SoftwareSerial/src/SoftwareSerial.h file starts with this:

#ifndef _SS_MAX_RX_BUFF
#define _SS_MAX_RX_BUFF 64 // RX buffer size
#endif


also remember that Software Serial -- If using multiple software serial ports -- only one can receive data at a time...

you might be better off with a Mega and multiple hardware Serial
Please do not PM me for help,  others will benefit as well if you post your question publicly on the forums

PaulS

Quote
how i can increase the RX buffer size to make no loss in data from all the nodes.
Only one instance of SoftwareSerial can listen at a time. Increasing the size of the buffer will NOT help.

Changing hardware will.

Robin2

#3
Oct 17, 2016, 07:05 pm Last Edit: Oct 17, 2016, 07:06 pm by Robin2
I want to increase my rx buffer size for software UART. because i have four Software uart slaves from each i want take minimum i00KB of data and process it. meanwhile other slaves also will be sending the Data to my controller. in that time. how i can increase the RX buffer size to make no loss in data from all the nodes.
I don't know of any Arduino that has the capacity to receive 100KB of data.

No matter how many instances of SoftwareSerial you create only one of them can listen at any one time. If you need to listen to several messages at the same time you need a HardwareSerial port for each. A Mega has 4 HardwareSerial ports.

If you use code like the examples in Serial Input Basics the size of the SerialInput buffer is not a limitation.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

CrossRoads

How fast does that i00K of data come in?
Do you need to process it in realtime, or store it & then process it later?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Prithiviraj_pandian

Thanks for the responses,

I have to send those information through harware serial port to computer USB for further processing..

Let me know the possibilities for that. is there any software uart RX buffer? if that is there we can try for increase the size of those buffer right??

If it will happen in that cases what modification i should for changing the buffer size??

CrossRoads

How fast does that i00K of data come in?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

julyjim

Thanks for the responses,

I have to send those information through harware serial port to computer USB for further processing..

Let me know the possibilities for that. is there any software uart RX buffer? if that is there we can try for increase the size of those buffer right??

If it will happen in that cases what modification i should for changing the buffer size??
Many small LCD boards come with SDK memory hardware plug-ins. .
Need 100Kb ? How about few GB?
As far as processing multiple x baud rate  connections - they are still the slowest kids on the block.
Nothing to worry.
Jim

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy