Serial.available() buffer reduced ??

i was using in arduino 022

while( Serial.available() < 127 );

but now the programm stalls at this point

but if i use

while( Serial.available() < 63 );

it continiues normanly

can we make it work again with 127???

thanks a lot

you can do that yourself:

goto - C:\Program Files (x86)\arduino-0022\hardware\arduino\cores\arduino -

edit HardwareSerial.cpp and search this code

#if (RAMEND < 1000)
#define RX_BUFFER_SIZE 32
#else
#define RX_BUFFER_SIZE 128
#endif

and change the 32 in 128 too …

thanks a lot it worked

while( Serial.available() < 127 );

Why are you not reading and storing the data as soon as it is available? What benefit is obtained by waiting until there is a truckload of data to process?

Or if you wanted to be portable, you could do

while( Serial.available() < RX_BUFFER_SIZE )

PaulS:

while( Serial.available() < 127 );

Why are you not reading and storing the data as soon as it is available? What benefit is obtained by waiting until there is a truckload of data to process?

because then i want to send them over I2C

and because I2C is faster than Uart its not working

because then i want to send them over I2C

Which uses a 32 byte buffer. Makes sense.

and because I2C is faster than Uart its not working

The UART IS working, even when you aren't reading the data that it is buffering.