Reply to topic  [ 1 post ] 
TinyCircuits MicroSD TinyShield Adapter (HCTICI0004) 
Author Message
Site Admin

Joined: Sun Aug 05, 2012 4:02 pm
Posts: 667
Post TinyCircuits MicroSD TinyShield Adapter (HCTICI0004)
Image

See our Tiny Circuits Range Here.


Description:

Sometimes you need to add a little storage to your projects, and sometimes you need a lot. This TinyShield microSD Adapter lets you add a huge amount of storage by connecting a microSD card to your TinyDuino. And with SD card support libraries included with the Arduino Software environment, you can have your project using microSD cards in a matter of minutes!

This TinyShield incorporates level shifters and a local power supply to ensure proper and safe operation over the entire TinyDuino operating voltage range up to 5V – no need to worry about damaging your microSD cards if you’re running at 5V.

Note: You need to supply your own microSD card, this is just an Adapter (sorry).

Specifications:

Ultra compact size and weight (smaller than a US Quarter!)
Square Version: 20mm x 20mm (.787 inches x .787 inches) Note: microSD car overhanges the edge by approx 3mm for easy removal
Max Height (from lower bottom TinyShield Connector to upper top TinyShield Connector): 5.11mm (0.201 inches)
Weight: TBD grams (TBD ounces)
SPI Mode used
Arduino pins 10 – 13 used by this shield
ChipSelect is pin 10
Built in level shifters and linear power supply to allow your TinyDuino to run up to 5.0V operation.


Schematic:

Attachment:
ASD2201.pdf


Write Example Sketch:
Code:
/* FILE:    TinyDuino_MicroSD_Adapter_Write_Example
   DATE:    17/02/14
   VERSION: 0.1
   
REVISIONS:

17/02/14 Created version 0.1

This is an example of how to use the TinyCircuits TinyShield HCTICI0004 / ASD2201
MicroSD adapter. This module allows reading and writing of data to a standard
MicroSD card and is useful for applications such as data loggers where a large
amount of data needs to be stored. The module works with the standard
Arduino SD card library (CS pin must be set to D10)

This example program will create a test file on the SD card called test.txt
If the file already exists it will first delete it and then create a new
one.

You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used for the purpose of premoting or selling products
that directly compete with Hobby Components Ltd's own range of products.

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER. */

/* Include the standard SD card library */
#include <SD.h>

#define SD_CARD_CD_DIO 10 /* DIO pin used to control the modules CS pin */

File SDFileData;

/* Initialise serial and DIO */
void setup()
{
  Serial.begin(9600);
 
  /* DIO pin used for the CS function. */
  pinMode(10, OUTPUT);
}

/* Main program loop */
void loop()
{

  /* Initialise the SD card */
  if (!SD.begin(SD_CARD_CD_DIO))
  {
    /* If there was an error output this to the serial port and go no further */
    Serial.println("ERROR: SD card failed to initiliase");
    while(1);
  }else
  {
    Serial.println("SD Card OK");
  }
 
 
   /* Check if the text file already exists */
   while(SD.exists("test.txt"))
   {
     /* If so then delete it */
     Serial.println("test.txt already exists...DELETING");
     SD.remove("test.txt");
   }
 
  /* Create a new text file on the SD card */
  Serial.println("Creating test.txt");
  SDFileData = SD.open("test.txt", FILE_WRITE);
 
  /* If the file was created ok then add come content */
  if (SDFileData)
  {
    SDFileData.println("It worked !!!");
 
    /* Close the file */
    SDFileData.close();   
   
    Serial.println("done.");
  }else
  {
      Serial.println("Error writing to file !");
  }
 
  /* Do nothing */
  while (1);
}


Read Example Sketch:
Code:
/* FILE:    TinyDuino_MicroSD_Adapter_Read_Example
   DATE:    09/07/12
   VERSION: 17/02/14

REVISIONS:

17/02/14 Created version 0.1
   

This is an example of how to use the TinyCircuits TinyShield HCTICI0004 / ASD2201
MicroSD adapter. This module allows reading and writing of data to a standard
SD card and is useful for applications such as data loggers where a large
amount of data needs to be stored. The module works with the standard
Arduino SD card library.

This example program will attempt to read a text file named text.txt and
output its contents to the serial port.

You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used for the purpose of premoting or selling products
that directly compete with Hobby Components Ltd's own range of products.

THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER. */

/* Include the standard SD card library */
#include <SD.h>

#define SD_CARD_CD_DIO 10 /* DIO pin used to control the modules CS pin */

File SDFileData;

/* Initialise serial and DIO */
void setup()
{
  Serial.begin(9600);
 
  /* DIO pin used for the CS function. */
  pinMode(10, OUTPUT);
}

/* Main program loop */
void loop()
{

  /* Initiliase the SD card */
  if (!SD.begin(SD_CARD_CD_DIO))
  {
    /* If there was an error output this to the serial port and go no further */
    Serial.println("ERROR: SD card failed to initiliase");
    while(1);
  }else
  {
    Serial.println("SD Card OK");
  }
 
 
   /* Check if the text file exists */
   if(SD.exists("test.txt"))
   {
     Serial.println("test.txt exists, attempting to read file...");

     /* The file exists so open it */
     SDFileData = SD.open("test.txt");
     
     /* Sequentially read the data from the file and output it's
        contents to the UART */
     while (SDFileData.available())
     {
       Serial.write(SDFileData.read());
     }
     
     /* Close the file */
     SDFileData.close(); 
   }
 
 
  /* Do nothing */
  while (1);
}


You do not have the required permissions to view the files attached to this post.


Mon Feb 17, 2014 4:25 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD