2018
February Thursday 22

Bookmark and Share

Related Articles...

MILWAUKEE WI Arduino Meet Up Make Space

WANTED: CORE TEAM MEMBER TO HELP START NON-PROFIT GROUP.

WANTED: Angle Investor Start-Up Funding

Large Industrial Zoned Arduino Make Space Acquired!

Email :

COASMailBox @ gmail.com

MILWAUKEE WI Raspberry Pi Meet Up Make Space

WANTED: CORE TEAM MEMBER TO HELP START NON-PROFIT GROUP.

WANTED: Angle Investor Start-Up Funding

Large Industrial Zoned Raspberry Pi Make Space Acquired!

Email :

COASMailBox @ gmail.com

MILWAUKEE WI Internet of Things (IoT) Meet Up Make Space

WANTED: CORE TEAM MEMBER TO HELP START NON-PROFIT GROUP.

WANTED: Angle Investor Start-Up Funding

Large Industrial Zoned Make Space Acquired!

Full Advanced Fabrication Facility, machine Shop, Welding, Electronics Lab Equipment Acquired!

Email :

COASMailBox @ gmail.com

MILWAUKEE WI Machine Repair, & Installation  - Tier 1 Business Support

Machine Technician Mechanic 20+ Years  Personal Experienced In Industrial Factory Machine Servicing, Rebuilding, Installation And Repair - Plus A 35+ Years Experienced Computer Engineer Service Technician Team Ready For Your Outsourced Market Advantage Needs!

Hartung Industrial - Member - CGI Science & Technology Group

Email :

COASMailBox @ gmail.com

2018 February REVIEW

 

SD Flash Memory Card Reader/Writer OEM Module

Arduino microSD & SD Flash Memory Cards
| Gene's Quick Lab Ref

EMBEDDED COMPUTING

2017 NOVEMBER | by Gene Casanova

Senior Systems/Network/Internet Engineer


Use Old SD Flash Memory Cards With Arduinos

Older small capacity SD flash-memory cards, can be a great storage device for use with Arduinos during learing, hobby projects, and during prototyping and beta testing stages.


SD & microSD Reader/Writer Modules Use 'ISP' Communication Interface

Arduino systembaords provide a ISP communication interface; for attachment of system perpherals; like a SD or microSD reader/writer device.  Generic OEM And CGI Computer Wares Produced OEM SD or microSD reader/writer modules come with the required ISP communication interface pins for connection to an Arduino Systemboard.

Connect an SD/microSD reader/writer circuitboard (PCB) module, to the 'ISP' communications interface pins, provided on the Ardunio systemboard to be used.


Arduino NANA, SD, ISP Connection

Arduino NANO to SD/MicroSD Reader/Writer Module Pinout Connections Using ISP Interface

The technical drawing above, illustrates the pin layout of an official Open-Source Aurduino NANO systembaord and a SD or microSD printed circuit board module (PCB); like the high-grade OEM Arduino systems and modules produced and supported by CGI Computer Wares in MILWAUKEE WI USA.  The CGI Computer Wares OEM products are production ready for system inclusion.

The 'CS' Clock Signal can be provided on any Arduino unused I/O pin. In The technical drawing above, digital I/O pin 4 is shown used to provide the 'CS' signal to the SD/microSD device.


microSD & SD Module Pinouts

CGI Computer Wares produces several OEM SD and microSD module configurations to meet many different system builder and applciation needs; providing the wideset array of options.

Below are the most common modules.

SD001000 Dual SD & microSD Reader/Writers Module

This module provides 2 units: U1 a microSD/microTF socket, and U2 a SD/TF socket.

J1 Pin Header (Parallel Pins, 8 Pins Per Row):

GND GND
5V 5V
3V3 3V3
CS1 CS1
CS2 CS2
MOSI MOSI
SCK SCK
MISO MISO

OEM microSD Module

J2 Pin Header:

CS
SCK
MOSI
MISO
VCC
GND

Arduino SD Card Test Sketch

Make sure you are using the latest version of the Arduino IDE, and test the latest version of the Arduino SD library.  I have wasited hours trying to use the Arduino organization's website community provided advise and website provided instructions without results.  I finnaly got the various reader/writer devices working by scientific proceedure testing each one with various versions of the Arduion IDE applcation and SD library versions.

SD/microSD Testing Sketch

The following is an Arduion SD or microSD flash memory card test program.

/*
 * SD Card Test Program
 *
 * This example illustrates how to use the utility libraries;
 * the SD library is based, in order to get info about an inserted SD memory card.
 *
 * Very useful for testing a SD memory card, to see if its working or damaged.
 *
 * The Circuit:
 * Use the SPI communication interface.
 * SD reader/writer module connection to the SPI interface on an Arduino systemboard:
 * Connections:
 *   MOSI to pin 11 on Arduino UNO/Duemilanove/Diecimila
 *   MISO to pin 12 on Arduino UNO/Duemilanove/Diecimila
 *   CLK  to pin 13 on Arduino UNO/Duemilanove/Diecimila
 *   CS   to I/O pin - Depends on The SD Card Shield Or Module Used.
 *    Pin 4 used here for consistency with other Arduino examples.
*/

// Include the SPI library:
#include <SPI.h>
// Include the SD library:
#include <SD.h>

// Set Variables using the SD utility library functions:
Sd2Card card;
SdVolume volume;
SdFile root;

/* Change the following "chipSelect" pin to match the SD shield or module being used;
 * chipSelect:
 *  'Arduino Ethernet Shield' : pin 4
 *  'Adafruit SD Shields' and Modules: pin 10
 *  'Sparkfun SD shield': pin 8
*/
const int chipSelect = 4;

void setup() {
		//	Open Serial Communications and wait for interface activation:
		Serial.begin(9600);
		while (!Serial) {
			; // wait for serial port to connect. Needed for native USB port only
    	}

    	Serial.print("\nInitializing SD/microSD Card...");
    	// Use the initialization code from the utility libraries, since just testing if the card is working.
    	if (!card.init(SPI_HALF_SPEED, chipSelect)) {
         Serial.println("initialization failed. Things to check:");
         Serial.println("* is a card inserted?");
         Serial.println("* is your wiring correct?");
         Serial.println("* did you change the chipSelect pin to match shield or module?");
         return;
         } else {
         Serial.println("Wiring is correct and a card is present.");
         }

		// Print the type of card:
		Serial.print("\nCard type: ");
		switch (card.type()) {
			case SD_CARD_TYPE_SD1:
			Serial.println("SD1");
			break;
			case SD_CARD_TYPE_SD2:
			Serial.println("SD2");
			break;
			case SD_CARD_TYPE_SDHC:
			Serial.println("SDHC");
			break;
			default:
			Serial.println("Unknown");
		}
 	
		// Now Try To Open The 'volume'/'partition' - it should be FAT16 or FAT32
     if (!volume.init(card)) {
     	Serial.println("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card");
     	return;
     }

		// Print Type and Size of the first FAT-type volume:
     uint32_t volumesize;
     Serial.print("\nVolume type is FAT");
     Serial.println(volume.fatType(), DEC);
     Serial.println();
     volumesize = volume.blocksPerCluster();    // clusters are collections of blocks
     volumesize *= volume.clusterCount();       // we'll have a lot of clusters
     volumesize *= 512;                            // SD card blocks are always 512 bytes
     Serial.print("Volume size (bytes): ");
     Serial.println(volumesize);
     Serial.print("Volume size (Kbytes): ");
     volumesize /= 1024;
     Serial.println(volumesize);
     Serial.print("Volume size (Mbytes): ");
     volumesize /= 1024;
     Serial.println(volumesize);
      
     Serial.println("\nFiles Found on Card (name, date and size in bytes): ");
     root.openRoot(volume);
     // list all files in the card with date and size
     root.ls(LS_R | LS_DATE | LS_SIZE);
}

void loop(void) {
}

Tutoring

Private tutoring in Milwaukee WI may be available.

Contact to continue the conversation.


Use The Technology Wisely & Keep It Simple

- Cheers!

Gene Casanova


Need More?   Need Help? ........Software, Network, System & Data Center Builder & Developer | Development Services Available - Freelance Small Jobs; To Outsourced Long Term Service Provider Contract Labor Available.

CGI Computer Wares | EST 1979

Send E-MailCONTACT: [click]@CGIComputerWares.com