I do not see any pull-up resistors on the G400TH schematics for the SD Card reader SD.Dx lines but they are indeed pulled high. Are there any pull-up resistors on the SOM itself or are you using weak pull-ups from the MCU pins ?
And, if you are using pull-up resistors on the SOM, will they be always available on the G400TH ? (I mean, no change planned ?)
@ Bec a Fuel - As you discovered, there are no pull-ups on the SD pins on the TH board. The SoM also does not contain any pull-ups on those pins. It must be the weak pull-ups from the MCU.
Thank you, Mike.
I’ve gone thru all relevant document. Except the G400-D Dev Board schematic diagram, none concerns about the connection diagram of SD card (SPIO mode).
My code, SD card and files in the card run well in G400-D Dev Board. Now I am doing the prototype from G400TH as shown in the attached photo. The code can “New” the SD object and “Mount” the SD card. However, the disk format was damaged once after the following codes:-
VolumeInfo vi = VolumeInfo.GetVolumes()[0];
MediaEventArgs ma = new MediaEventArgs(vi, DateTime.Now);
The vi.isFormatted return 0.
Mike, I am sure the wiring connections were done according to pin assignment laid down in the G400-D Dev Board schematic diagram. Could you help me what i am going wrong?
You must use short wires. Also keep them away from all the other wires you have - I see there’s a random set of power wires with alligator clips behind those wires, keep everything away! Signal integrity on SD is sensitive on a high speed processor, so prototyping like this is fraught with risk.
You should also run thicker wires for power and GND, and as @ RoSchmi says adding extra capacitance on the SD card board is probably a good idea.
I re-wired the connections between the G400TH and my SD card module as shown on the attached photo.
However, the outcome did not change. After successfully “Mount” the SC card, the succeeding VolumeInfo.GetVolumes()[0] method returned an volume while the isFormatted property was zero. The Volume of SD card was found corrupted in my computer.
I followed your advices adding capacitors as close as possible to the SC card module. Now I can read my database stored in the SD card with SQLite.
However, I cannot update the database. I noted that there is a “Write Protect” pin attached with your SD card module in the development board. On G400TH through-hole board, I cannot find the pin PD5. How can I update my database in the SD card without pin PD5 for “Write Protect” setting?
Thank you for your reply, Gus. In fact I’m not writing a file in the SD card.
I am using your SQLite in dot net micro-framework and dragged on the following coding:
SQLite.ExexcuteNonQuery( "INSERT IN aTable ( Column1 ) VALUES ( Value1 ) " );
In G400D Dev board the code runs well. In G400 TH board, the above SQL statement stands still but SQL Select statements are still normal.