Accelerating Arduino Ethernet Speed

I would like to use TurboSPI (see GitHub - anydream/TurboSPI: This is another Arduino SPI library separated from SdFat library, it uses SPI registers and DMA (Arduino Due only) to accelerate SPI communication) to upgrade Ethernet communication speed through ARDUINO Ethernet Shield. TurboSPI is a fast version of the SPI. Did anybody look at this library and have an idea of how to integrate it with ARDUINO Ethernet library in order to improve Ethernet Transfer speed?

Mike

You should state which processor you intend to use since DMA is where all the speed gains are. Unfortunately, the majority of Arduinos don't support it. The Due does, maybe one of the newer, non-atMega boards does as well, don't know.

DMA is where all the speed gains are.

Nah. The existing SPI library really wants to be bi-directional, all the time, and loses a lot of performance because of that. It could be a lot faster even even without DMA. (But not without implementing new APIs. There was a significant discussion on the Developer's list relatively recently: Redirecting to Google Groups

I could use the DUE which supports DMA. Where can I find a setup of the DUE for DMA Transfers and some examples of corresponding Sketches?

This thread may interest you, reply 36:
https://forum.arduino.cc/index.php?topic=437243.30

And a few examples here:

Plus of course Sam3x datasheet, sections 22 AHB DMA and 41 EMAC.

BTW the Taijuino compatible Arduino DUE board has ethernet pins broken out
http://www.emartee.com/product/42271/Taijiuino%20Due%20Pro%20R3%20%20Arduino%20Due%20Compatible

I conducted some Ethernet UDP tests and I got some strange results:
The setup is:

  • ARDUINO UNO connected to ARDUINO MEGA through Ethernet
  • With Ethernet shield on each one (including W5100), SPI 4 Mbits or 8 Mbits
  • Using Ethernet Library,
  • UNO transmitting continuously UDP packets of 128 bytes
  • MEGA receiving the packets and printing out a message every time a particular byte within the packet is different from the transmitted value.
    Results: An error message within an average of every 50 packets.

What is more interesting is that:

  • The error rate for a particular byte in the message increases with the position of this byte in the message. For example, if for byte #40 the error rate is 1 every 50 messages, for byte #100 the error rate is 1 out of only 20 messages.
  • The reading of these error values occurs at the same messages. For example if we order the transmitted messages from start with 0, 1, .....the errors would occur always at messages 8, 120, 180, ...

I would appreciate any comments about these results, including any idea for decreasing those error rates.

Errors on a properly installed Ethernet network should be quite rare, whereas yours are fairly common.

The 'predicatability' of the errors you are seeing sound like a problem with your software, bit errors across Ethernet would tend to ocurr at random through a packet.

Edit:
On reflection, a Ethernet working in a collision domain could produce those errors, but I have not seen a collision based Ethernet in use for years, in twisted pair media that is.

The connection between the 2 ARDUINOs (with Ethernet shields on each one) was a direct point to point Ethernet cable. That makes those results really strange.
I am trying some more changes in Software, before I post the sketches.