I try to send a Serial stream from Serial3 (MEGA) direct to the Ethernet BreakOut in a while loop. It turns out, the serial3.read() is much more faster (serial.begin(115200)); than the SPI attached client.wirte() function. The 63 Byte buffer on Serial3 is full after 3 while cycles. Does anyone know how fast the client.print(c); function shifts data out over SPI to the ethernet chip?I used to have a client.write(HEADERSTRING) with the F() function. But this takes me directly to a full rx buffer.

@PaulS: whole array: hmm.. may by my architecture is wrong: I do a external eeprom dump from a attached nano over serial to the MEGA. this will take me up to 1KB of data. buffing this amount of data is hard with MEGA. right?

@Nick: client.write() will write over SPI, no? I was not looking into #include <SPI.h> #include <Ethernet.h>. But one may find out, the SPI will go this way.

Does anyone know how fast the SPI port communication speed. I was once (a long time ago) reading 10Mhz.

@PaulS: whole array: hmm.. may by my architecture is wrong: I do a external eeprom dump from a attached nano over serial to the MEGA. this will take me up to 1KB of data. buffing this amount of data is hard with MEGA. right?

Yes, and no. Yes, a 1K buffer is a real challenge.

But, why not establish handshaking with the remote device? Send it a request for data, say 64 bytes. Collect those 64 bytes. Send them to the client. Ask the remote device for 64 more bytes. Collect them, send them, lather, rinse, repeat.

There is no reason that the remote device has to tell its whole life store without pausing to breathe.

@PaulS: you're right. When my direct streaming design cannot handly timing issues, I do need to switch to this 64byte-sample approach. However, I will need to redisign my protocol. That's to say, it's only sending full information today.

Knowing the speed of ethernet SPI, I could go down one step with my serial speed. Does anyone knows about the speeds?

Update: default for SPI is 4 Mhz see http://arduino.cc/en/Reference/SPI. I wonder why my code accumulate the rx buffer. Maybe the serial3.available() takes as much time as serial3.read(). Any ideas?

Why do you mention SPI at all? I don't see any SPI I/O happening here.

You're reading characters from a hardware serial port Serial3. For every received character, you print several characters on a different serial port Serial1.

Since you HAVEN'T SHOWN US ALL YOUR CODE we can't see how those serial ports were configured but I will guess they're running at the same speed. So naturally you will find that the output stream is the limiting factor and prevents your sketch from processing the input stream at its full speed.

This could be made to work if you change your sketch to only print one output character per input character, although it wouldn't be very resilient. For a more robust solution you would ensure that the output stream was at less than 100% capacity when the inputs were at 100% capacity. The best way to do that would be to run the output port at a higher speed.

I only provide help via the forum - please do not contact me for private consultancy.

Yes, the ethernet shield. as in http://arduino.cc/en/Main/ArduinoEthernetShield.I still have no clue how fast the SPI is in respect to the Serial.read() when setting up the serial.begin(115200). Any ideas.

For a more robust solution you would ensure that the output stream was at less than 100% capacity when the inputs were at 100% capacity. The best way to do that would be to run the output port at a higher speed.

That's exactly what I'm asking for. What's the speed of client.write() in respect to serial3.read() setting up by 115200bps.

!! UPDATE in code on the top of this post with some general settings to clearify my request.

@SurferTim: Just for be clear: You're saying the function call to 'client.print' is takeing more cpu runtime than it would be with serial3.read(). In my case: jumping during the while-loop every time to client.print will take more time (@16Mhz ATmega2560) than the serial3 will shift into rx buffer?