Achieving Ethernet top speed

Hi,

I would like to know what is the top speed achievable with the Ethernet Shield?

I have been trying to speed up my ethernet download speed, but i have been having problems with that.
I´m always trying to empty the W5100 buffer, but i don´t think that is the best way to make a download, because it might interfere with the filling of the buffer.

Does anyone has any ideas that can help.
Or code i can use as example, that allows for good download speeds? I have read that some people were able to achieve 14KB/s.

Regards

The limit is the SPI bus speed.

I´m always trying to empty the W5100 buffer, but i don´t think that is the best way to make a download, because it might interfere with the filling of the buffer.

That is the best way. Until the buffer is empty, you can't get another packet, so the faster you empty it, the sooner you start getting another packet.

So,

Calling:

void SPIClass::setClockDivider(uint8_t rate)
{
  SPCR = (SPCR & ~SPI_CLOCK_MASK) | (rate & SPI_CLOCK_MASK);
  SPSR = (SPSR & ~SPI_2XCLOCK_MASK) | ((rate >> 2) & SPI_2XCLOCK_MASK);
}

and using:

#define SPI_CLOCK_DIV2 0x04

should allow me to achieve the highest speed, correct?

I'm not sure about all that. The standard SPI library says this is the fastest:

SPI.setClockDivider(SPI_CLOCK_DIV2);

Yap,

It seems to work.

8 MHz, that's the fastest you can get with SPI.
Can you deal with the data coming in that fast? Can't do much with it, any processing will take away from clock cycles for emptying the buffer.

Yes,

You are correct, right now my bottleneck isn´t the ethernet speed.
It´s the time i take to put the data in the SDCard...

The SD card is also SPI, so the same limits apply there. Plus it takes a bit of time to buffer the SD for read/write. And you must share that bus with the w5100 and the SD card. What did you expect from a 16MHz computer?

For the same or even lower price than an Arduino UNO or Leonardo with an Ethernet Shield you can get a Teensy3 and connect it to a WIZ820oo Ethernet module and get vastly improved throughput.

With the Teensy3 based on a 32 bit Arm Cortex M4 processor running up to 96MHz you have plenty of processing power left.

Can look linke this teensy3 - WIZ820io adapter - And then some

SurferTim,

I wasn´t expecting nothing, i was only trying to achieve the highest speed i could and make my code as efficient as possible.

I´m now able to have a good enough speed for my application, i´m able to download a 130kB file and save it on the SDCard in aproximately 30/40 seconds.