Go Down

Topic: Arduino with onboard Ethernet adapter: Still under development? (Read 3700 times) previous topic - next topic

fungus


Sadly, the W5100 requires four byte on the SPI bus to transfer one data byte.  Here is a quote from the datasheet.


Oh, well, there's not much to be done about it.    :-(

75 kbytes/sec is the target speed then...!

I think I can get pretty close to that with a few more changes.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

fungus

75 kbytes/sec is the target speed then...!


With a bit more fiddling I got it up to about 50kbytes/sec ... that's about 2/3 of theoretical maximum speed.

Where's the rest? Well...50k bytes/sec is about 100 SD card sector reads. Each sector read takes a little over 3 ms so that's over 300 ms each second spent reading the SD card ... about 1/3 of the available time.

2/3 + 1/3 = 1

I guess I've hit the limit...  8)

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

fat16lib

I think the Enet library uses the default SPI clock of F_CPU/4 or 4 MHz with a 16 MHz CPU.  The W5100 should work with a faster SPI clock.

You might be able to go faster with an 8 MHz SPI clock.  You need to set the SP2X bit in SPSR.

If you are using the SD.h library, which is a wrapper for an old version of my SdFat library, it sets SPI clock to F_CPU/4 so don't set the SP2X bit until the SD library is initialized.

My new SdFat library sets the SPI speed each time it accesses the bus so you should initialize it at 8 MHz and the Enet will also run at 8 MHz.

fungus


You might be able to go faster with an 8 MHz SPI clock.  You need to set the SP2X bit in SPSR.


I just put "SPI.setClockDivider(SPI_CLOCK_DIV2);" in my setup() function and the speed went from 50kbytes/sec to 67 kbytes/sec - a pretty good gain.

What's the spec of the W5100? Is that speed within its tolerances? How about the SD card...?


No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

fungus

#19
Sep 11, 2011, 01:14 am Last Edit: Sep 11, 2011, 01:18 am by fungus Reason: 1
PS: If you want to try it out you can click here: http://87.221.151.193/index.html

That page is currently being served by the Arduino (it's a mirror of my site at www.artlum.com).

nb. The IP address is dynamic so it will probably change as soon as I post this...  :smiley-eek:

There's a big image of David Cuartielles on there, click on the little picture of him about a third of the way down the Gameduino page. See how long it takes to load ... on the local network it takes about 30 seconds.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

fat16lib

#20
Sep 11, 2011, 01:19 am Last Edit: Sep 11, 2011, 01:25 am by fat16lib Reason: 1
SD cards are 25 or 50 MHz depending on the card version.  

The W5100 specs rise and hold times that imply about 10 MHz max.

The Arduino is 8 MHz max.

Note that setClockDivider may not always work since libraries set the SPI speed to anything they want and do not restore it.

fungus

I was just sitting here and I saw some activity on the Arduino server...

I looked at the HTTP headers on the server log and it says:

Code: [Select]

GET /robots.txt HTTP/1.1
Host: 87.221.151.193
Connection: Keep-alive
Accept: text/plain,text/html
From: googlebot(at)googlebot.com
User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
Accept-Encoding: gzip,deflate

GET /index.html HTTP/1.1
Host: 87.221.151.193
Connection: Keep-alive
Accept: */*
From: googlebot(at)googlebot.com
User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
Accept-Encoding: gzip,deflate



Looks like my Arduino just got visited by the Google bot!


No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy