RE: HanRun HR911105A W5100 Ethernet Shield (SKU# CE05307)
Further to discussions with Core Electronics staff, regarding efforts to get the SD Card slot working on this shield.
As mentioned I have tried 2 separate identical Ethernet Shields with 2 different Arduino UNO R3 boards. One UNO R3 was SKU# A000066, and the other was SKU# CE05629.
I have tried two SD Cards, being:
- Generic 4GB microSDHC Class 4, formatted FAT32;
- SanDisk Ultra PLUS 32GB microSDHC, formatted FAT32.
Several Sketches have been tried all with the same result, “Fail”.
The sketches used and modified as appropriate, trying several combinations for ChipSelect.
Some of the Examples used:
// pinMode(4, OUTPUT);
if(SD.begin(4) == 0)
I was hoping to use this shield for a server main loop retrieving html code segments from files on the SDCard, utilising timer interrupts and ISR’s to gather data from sensors. As well as logging to the SDCard.
But, so far no working code for SDCard, :-/ Ethernet appears to be working fine on the basic server test examples.
Hope you can advise what is the ‘secret’ with this shield.
I can’t replicate your case exactly, because my Ethernet board is different, although I would guess the circuit is identical… But using the original Arduino library (“SD” by Limor Fried and Tom Igoe) it runs the examples just fine. I would suggest deleting all the current SD Card libraries, restarting, downloading the original library, restarting again, and running the cardinfo example changing the chipSelect setting to 4. It works just fine here with several generic SD cards up to 32Gb FAT32 and several hundred files.
That will prove the settings you need for it to work. If you need the functionality of SDFAT then the task becomes one of transporting those settings into the new library, which at first glance appears to be somewhat daunting.
Do you have any other device that you can test with SPI?
We’ve pulled one of these off the shelf for troubleshooting, and confirmed this: The SDFat library spits out errors, the official SD library (included with the Arduino IDE) doesn’t.
I bumbled around with schematics and microscopes to work out what was happening with chip select pins as well. From what I can see, Pin 10 pulls a ton of stuff high like the active-low CS pins and reset pins through some resistor networks in both this shield and the official Ethernet 2 shield, which will deselect the W5100 or W5500 chips responsible for ethernet on these shields. Pin 4, when pulled high, disables the SD card. Not too important but I can post some more about what I found it if becomes relevant.
Let us know if the SD library gets things working, otherwise we can dig a little deeper
To further test, I went over to Jaycar (which is close by) and got a Duratech SD Card module and connected it via the headers on the Hanrun Ethernet shield, having CS on pin5. Modified the code to CS on pin 5 for the Duratech, leaving the Hanrun with the fixed pin 4 CS.
SD cards in the Duratech worked perfectly, however, when running the pin 4 CS code - nothing/failed.
So have to conclude that there are a few of the Hanrun shields that are non-functioning for the SD Card integrated module.
Try running the included CardInfo example as-is, I ran that with stock hardware, and it worked without modification.
I’d be surprised if this doesn’t work, you might have a bad board if it doesn’t.
That was done within 10 minutes of opening the original box, and tested on both on Linux and a littel later with Win10, with several SD Cards formatted FAT32. As mentioned previously the SD Cards work with the Duratech module. Will return card for your verification of above.
Thanks for letting us know.
If it still doesn’t work, you may indeed have a faulty board, and you can email us at our Contact Page to go through the RMA process.
Keen to see this back on track either way!