I am working on a project which has an Arduino Uno board, an Ethernet Shield, and an SD Card which is mounted on the Shield.
It’s a basic SD card web server. When I type it’s IP address in the browser, then the Arduino fetches the HTML page (.htm) from the SD card and writes it to the browser. It works fine, but here is a problem.
The htm webpage on the SD card is about 64kb in size, and it takes about 16 seconds to load it on the browser. It means that the Arduino writes the page at a rate of 4kbps. This is too slow if it is to load a 64kb page.
And I can literally see the Ethernet Shield struggling as the webpage loads.
I tried it with both SD library and SDfat library. (SDfat was said to be faster than SD) but both gave the same result.
What I think now, is that the Ethernet Shield and SD both use the SPi bus. How it works is that Arduino reads one char at a time from the htm file and write()s it on the Ethernet client. So I think, that this is too complicated and switching the Ethernet and SD on the SPI bus just for one char is very time consuming.
I think that the alternation of the Ethernet and SD on the bus is causing time.
Please can anyone tell if this is actually the problem, or its anything else? And please tell if I can use the SD and Ethernet on two separate SPI buses.