I have read through a lot of discussion regarding the SdFat library. I couldn’t write or read any data from the sdcard. Here is the step by step process followed:
Flashed the sdcard with Fat32 using windows.
Connected the pins of the shield as follows,
CS -> A2
SCK -> A3
MISO -> A4
MOSI -> A5
VCC -> 3V3
GND -> GND
Now flashed the photon with the example firmwares in the sdfat library but nothing works.
The shield used is this. Is there anything I am missing?
Thanks for the help!
You also need to keep the wires from the Photon pins to the module short - best if you use a breadboard and the shortest wire links possible. Lastly, are you able to see what pull up resistors there are on the module for the MOSI, MISO and CS?
@ScruffR I thought the specifications said it will support the 3.3v, then I should throw this shield and buy a new one? @armor No I am not.
I am using a breadboard with jumper wires.
I don’t know about the pull up registers. Let me get back to you on this
You need to read carefully
The description states that the logic (interface) levels can be 5V or 3.3V due on-board regulator and level shifters. But for these to function the supply needs to be >4.5V.
Not necessarily. When you have your Photon powered off a 5V source you can use Vin instead of 3v3 (as @armor already stated above).
Just for the record: On Photon (and other Gen2 devices) A2 is the same thing as SS - both macros will be substituted with 12.
As pointed out by @armor in order to get "new" hardware going it's always advisable to start with a minimal test code and one baby-step at a time
There are many infinite loops that may trap your code and hence will probably starve the cloud process off controler timer.
To know which, where and why you need to look at the serial output - we can't do that for you.
@ScruffR@armor Thanks for the guidance. Now I am trying to use a simple logger firmware uses SdCardLogHandlerRK. This is to test the log files are created and the shield is working fine.
This is the example firmware I am using. Writing to the sdcard still fails. Is there anything I am missing.
BTW, since you are free to use your jumper wires wherever you want, so it would be preferable to adhere to common colour codes (Vcc red, GND black, the rest as you see fit).
You also still haven't provided us with any info about the debug output your code should produce
Can you add the basic SDFAT library (in webIDE) and try the SdInfo.ino app to validate if the card is functional. this is a simpler way to test for functionality. Dont forget to change the SS value to A2 for your card