IoT - Modular - SD Card.h

From The TinkerNet Wiki
Revision as of 20:09, 30 April 2021 by Tinker (talk | contribs) (Created page with "<syntaxhighlight lang="cpp" line="1"> // SD Pinout // Pin # Pin name SD Mode SPI Mode // 1 DAT3/CS Data Line 3 Chip Select // 2...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 1 //  SD Pinout
 2 // Pin #	Pin name	SD Mode	                    SPI Mode
 3 // 1	    DAT3/CS	    Data Line 3	                Chip Select
 4 // 2	    CMD/DI	    Command Line	            Data Input [MOSI]
 5 // 3	    VSS1	    Ground	                    Ground
 6 // 4	    Vdd	        Power 2.7v-3.6v	            Power Supply 2.7v-3.6v
 7 // 5	    Clock	    Clock	                    SerialClock [SCK]
 8 // 6	    Vss2	    Ground	                    Ground
 9 // 7	    DAT0/D0	    Data Line 0	                Data Out [MISO]
10 // 8	    DAT1/IRQ	Data Line 1	                Unused or IRQ
11 // 9	    DAT2/NC	    Data Line 2	                Unused
12 
13 //  microSD Pinout
14 // Pin #	Pin name	SD Mode	                    SPI Mode
15 // 1	    DAT2	    Data Line 2                 Unused
16 // 2	    CD/DAT3	    Card Detect / Data Bit 3    Chip Select
17 // 3	    CMD	        Command Line                Data Input [MOSI]
18 // 4	    Vdd	        Power 2.7v-3.6v	            Power Supply 2.7v-3.6v
19 // 5	    CLK	        Clock                       Serial Clock [SCK]
20 // 6	    Vss	        Ground                      Ground
21 // 7	    DAT0	    Data Line 0                 Data Out [MISO]
22 // 8	    DAT1	    Data Line 1                 Reserved
23 
24 //  miniSD Pinout
25 // Pin #	Pin name	SD Mode	                    SPI Mode
26 // 1	    DAT3/CD	    Chip Detect/Data Line 3	    Chip Select
27 // 2	    CMD/DI	    Command Line	            Data In [MOSI]
28 // 3	    VSS1	    Ground	                    Ground
29 // 4	    Vdd	        Power 2.7v-3.6v	            Power Supply 2.7v-3.6v
30 // 5	    Clock	    Clock	                    Clock [SCK]
31 // 6	    Vss2	    Ground	                    Ground
32 // 7	    DAT0/D0	    Data Line 0	                Data Out [MISO]
33 // 8	    DAT1/IRQ	Data Line 1	                Unused
34 // 9	    DAT2/NC	    Data Line 2	                Unused
35 // 10       NC          For future use              For future use
36 // 11       NC          For future use              For future use
37 
38 /*
39  * SD card usage with microcontrollers is generally based on SPI.
40  * 
41  * A resource to get started:
42  *  https://www.mischianti.org/2019/12/15/how-to-use-sd-card-with-esp8266-and-arduino/
43  *      NOTE!!!
44  *      core > 2.4.2
45  */
46 
47 /*
48 SD    =>  ESP8266  =>  WeMoS
49 CS    =>  GPIO2    =>  D4
50 SCK   =>  GPIO14   =>  D5
51 MOSI  =>  GPIO13   =>  D7
52 MISO  =>  GPIO12   =>  D6
53 */