Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

SD Cards

  • SD cards, or Secure Digital Memory Cards, are small solid-state cards that store data, which means they have no moving parts, so they are durable, since there are no moving parts to break
  • They work using flash memory, which is another way of describing electronically stored memory which is stored separate from the main computer
  • When the card is given power, the electrons in the circuits of the card are moved to the flash memory chip, where the digital patterns stored correspond to the data stored
  • A transistor works to either switch electrical power on or off, or amplify it. They are found in the circuitry of SD cards
  • Transistors have three pieces: a source, a drain and a gate. Electricity flows through the source, goes through the drain and then out the gate. When the gate is closed, no electricity goes through it, and it stores a value of 0. When electricity is let through, the transistor stores a value of 1. When the card is turned off, i.e. no electricity flows through it, all the transistors are turned off, and when it is turned on again, there is no way of knowing which ones previously stored values of 1 or 0, so the data is lost. The transistors in an SD card go around this problem by having two gates. When electricity flows through a transistor, some of it leaks in between the first and second gates, recording a value of one. Even when the power is turned off, the transistor maintains its value of one.
  • To erase the data on an SD card, a higher voltage must be applied, which allows for re-writing the contents of the SD card
  • SD cards can erase entire sections, or blocks, which makes them more efficient than other ways of storing data which may erase data one byte at a time

FAT File System

  • SD cards implement the FAT File System. FAT stands for File Allocation Table, and as the name implies, it organizes files
  • There is no organization to the system; files are stored to the first available location
  • Because of its simple nature, it is good for lighter implementations but does not hold up to larger file systems
  • FAT contains areas of volume for storage, called clusters, which each contain an indicator to the next cluster
  • FAT32 is a derivative of the FAT system, which has a maximum of 4GB of storage

Connecting to Microcontroller

  • The Micro SD card transmits information to the Microcontroller via the SPI protocol 
  • SPI, Serial Peripheral Interface, is a means of connecting periphery devices to a computer
  • It runs using a master-slave set up with full duplex mode - that means signals can be transmitted between the slave and master simultaneously
  • The side that generates the signal is the master, while the slave receives the signal
  • There is only one master, namely the microcontroller, while there can be multiple slaves, all of which can only communicate only with the master, while the master can communicate with all slaves
  • When data is sent from a master to a slave, it is done on the MOSI data line, which means Master Out/Slave In
  • Communication with an SD card can be done in two modes, in SD mode or SPI mode
  • To initially sent the SD card into SPI mode, the microcontroller sends CMD0
  • After that, various commands can be sent through the SPI protocol to and from the SD card

SPI and SD Cards: http://nerdclub-uk.blogspot.ca/2012/11/how-spi-works-with-sd-card.html

  • No labels