Resolved: SD card init issues with Robotdyn MEGA2560 Eth r3 board

The Robotdyn Eth r3 is a nice compact single board for Internet of Things designs. It has the most modern Ethernet chip (W5500) the At Mega 2560 with lots of flash, eeprom, ram, and I/O, and both 5 v and 3.3 volt converters, and a SD card slot with Card Detect.

Before I ask my question, let me state that the Processor with its various memories and the Ethernet are working great, i fully understand the assertive low SPI selects, have tried to run all the SD examples (with appropriate modifications to deselect the Ethernet) , and have read every arduino and adafruit forum discussion I can find where users have had issues with SD initialization. Yes, I am aware of the SPI pins on 50-53. I have scoped the Clk, MISO, MOSI, and SS pins to ensure they are functioning to the card, and have tried two new SDHC class 10 cards (Ultra 32 GB San Disk and a 32 GB generic compliant to SD 2 spec). I have tried the cards as shipped and formatted, also formatted on Windows 10 to FAT32, formatted on a Macbook using the SD format program to FAT32, partitioned to 14 GB and formatted FAT16. The Robotdyne MEGA2560 board does the level convert to 3.3 volts on the CLK, MOSI, and CS using a 74HC244. However, it does not do voltage conversion from the SD card back to the Mega’s MISO pin, instead relying that the SD high level will be detected as a high at the Mega’ MISO and that the SD card will not be damaged by any 5 volt transients at power up and initialization.

In my case, no data is sent back from the SD card on MISO and the SD card is never initialized. Yes, I have sought help with Robotdyn support and they have responded, but I don’t believe they understand assertive low selects, or perhaps it is a language issue. Regardless, their suggestions were not helpful.

My question, has anyone else with a Robotdyne MEGA2560 Eth r3 board had an issue reading Class 10 SD cards formatted as FAT32?

Meanwhile I have ordered several different sizes of SD cards from two other vendors, and also another (in stock at multiple mainland locations) Robotdyn MEGA2560 Eth r3 from Amazon (who has been deliberately sitting on my non-prime order since Monday and not shipped. Today is Thursday.).

a basic question. do you set the CS pin of unused SPI device HIGH? if you experiment with SD card and the sketch doesn't use Ethernet library, set CS pin for Wiznet HIGH. if you try the Ethernet and you have SD card inserted but the sketch doesn't use the SD library, set in sketch the CS pin of SD HIGH

Yes, I set the Chip Select of the unused SPI device high. Chip select, also called slave select, is held high on all devices until one chooses to communicate with a particular device, in which case it is made low for that device. Thus it is called assertive low.

The Ethernet Wiznet 5500 works fine following the above procedure. The SD card does not.

according to datasheet ATmega running at at 5 V Vcc reads HIGH from 3 V.

all good SD card adapter modules for 5 V don't use level conversion on MISO. the adapters with logic converter on MISO disturb other SPI devices on the same bus

Thank you for that information. I did not know that the ATMega processor would read a high on MISO when held at 3 volts from the SD card. When the SD card is not selected and MISO goes to 5 v as driven by the Wiznet Ethernet or Mega input pullup, is the SD HC class 10 card put into some incorrect state?

BTW (by the way), my SD cards still work fine in my Windows and Macbook Pro after being repeatedly used in the Mega.

I assumed that the logic transition point would be at about 2.5 volts. Aside, if I were to design a level converter, I would tri-state the output to the MISO processor pin from the SD card when CS on the SD card was high.

Let me ask the question a different way.

What SD cards ( brands, capacities, format (FAT32, FAT16, exFAT), class (4 or 10), SDHC, Ultra, etc) have you used successfully on the Robotdyn MEGA2560 ETH r3?

I received 4 new SD cards today.
2GB unbranded class 4 microSD card FAT 16
4GB unbranded class 4 microSD card FAT 16
8GB unbranded class 4 microSD card FAT 32
16GB Kingston class 10 microSD card FAT 32

All initialized and I could read them without issues when I powered up the MEGA.

All I can surmise is that my 2 brand new 32 GB cards will not work in the Arduino.