Go Down

Topic: Achieving Ethernet top speed (Read 863 times) previous topic - next topic

LuisSoares

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

SurferTim

The limit is the SPI bus speed.
Quote
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.

LuisSoares

So,

Calling:

Code: [Select]
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:

Code: [Select]
#define SPI_CLOCK_DIV2 0x04

should allow me to achieve the highest speed, correct?

SurferTim

I'm not sure about all that. The standard SPI library says this is the fastest:
Code: [Select]
SPI.setClockDivider(SPI_CLOCK_DIV2);

LuisSoares


CrossRoads

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.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

LuisSoares

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...

SurferTim

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?

Headroom

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 http://forum.pjrc.com/threads/23904-teensy3-WIZ820io-adapter-And-then-some?highlight=Frankie
http://trippylighting.com

http://ledshield.wordpress.com/

LuisSoares

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.

Go Up