Giter Site home page Giter Site logo

sc_sdcard's Introduction

SD Card Libary

Stable release:1.0.1
Status: alpha
Maintainer:interactive_matter
Description:SD card driver library

Key Features

  • Read and write data operations on SD cards using either the SPI interface or native 4bit interface
  • Port of FatFS - FAT file system module R0.09 (C)ChaN, 2011 (http://elm-chan.org/fsw/ff/00index_e.html).
  • Beware: FAT with long file names may be covered by various patents (in particular those held by Microsoft). Use of this code may require licensing from the patent holders
  • Beware: 4bit SD protocol is subject to petents of the SD Association. When enabled on commercial products a license may be required. (see: https://www.sdcard.org/developers/howto/ )
  • Benchmark with 4bit interface multiblock read speed is about 4MBytes/sec. 1.2MBytes/sec with SPI.

To Do

  • Initialization at low clock speed (400KHz max) for the 4bit interface.
  • Test with SDXC card, SD physical layer ver 1.0 compliant card and MMC card (currently supported only with SPI interface).
  • support for MMC/eMMC at 4 and 8bit bus.
  • Date/Time function for files timestamp returning real date/time.

Firmware Overview

This module provides functions to initialize SD cards, read and write data. To enable the 4bit SD native bus interface functions it is necessary to uncomment the "//#define BUS_MODE_4BIT" in the "module_FatFs/src/diskio.h". Resources (ports and clock blocks) used for the interface need to be specified in either "module_sdcardSPI/SDCardHostSPI.xc" or "module_sdcard4bit/SDCardHost4bit.xc" in the initialization of the SDif structure. If you run it in a core other than XS1_G you need pull-up resistor for miso line (if in spi mode) or Cmd line and D0(=Dat port bit 3) line (if in 4bit bus mode)

Known Issues

  • Initialization for the 4bit protocol not done at correct clock speed of 400KHz maximum.

Required Repositories

Support

Issues may be submitted via the Issues tab in this github repo. Response to any issues submitted are at the discretion of the maintainers of this component.

sc_sdcard's People

Contributors

henkmuller avatar leleb avatar xmos-corin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sc_sdcard's Issues

Can't read data from memory card.

Hello !!!
I tried to interface with a memory card but could not get it.
I am using SanDisk ultra sd card with the adapter because you can't directly connect on it.
My pin connections should be,

Pin1 (CS ) ----> P1L
Pin2 (MOSI[DI]) ---> P1K
Pin3 (GND) ---> GND
Pin4 (3V) ---> 3V3
Pin5 (CLK) ---> P1I
Pin6 (GND) ---> GND
Pin7 (MISO[DO]) ---> P1J
Pin8 (NC) --->NC
Pin9 (NC) --->NC

I tried to place 10k pull up on pin2[MOSI] and pin7[MISO]. Still do not get any response.

I tested the same thing Arduino sd card module it works well.

In SDCardHostSPI.xc,

static SDHostInterface SDif[] = // LIST HERE THE PORTS USED FOR THE INTERFACES
// cs, sclk, Mosi, miso
{{XS1_CLKBLK_1, XS1_CLKBLK_2, XS1_PORT_1L, XS1_PORT_1I, XS1_PORT_1K, XS1_PORT_1J, 0, 0}}; // resources used for interface #0

changed as per defined output.

I hope anyone helps me get out this problem.

Use of hard coded pull-up is harmful

Both module_sdcard4bit and module_sdcardSPI hard coded enables the internal pull-up resistors on some ports. This will work fine on XS1-G devices that have pull-up resistors, but it will cause an exception on XS1-L devices because they do not have internal pull-up resistors (instead they have pull-down resistors).

Assumptions about the target device cannot be made implicitly. I propose to either fully rely on external pull-up resistors regarding the software or to pass a parameter to an initialization routine that will either do nothing or enable the internal pull-up depending on the value of the parameter.

FatFs is an old version

module FatFs is baed on FatFs R0.09. Later versions are now available. It would be good to move up to the latest version,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.