element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Cypress Kits
  • Products
  • Dev Tools
  • Cypress Kits
  • More
  • Cancel
Cypress Kits
Forum PSoC 4 Pioneer Kit Community Project#050 – SD Card Example
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Cypress Kits to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 30 replies
  • Subscribers 36 subscribers
  • Views 6376 views
  • Users 0 members are here
  • 100projects
Related

PSoC 4 Pioneer Kit Community Project#050 – SD Card Example

cy.wbz
cy.wbz over 12 years ago

Hello!

 

Today we are starting a short series targeting SD memory cards. In this first example we are introducing users to the SD card using the custom SD card component. This component will expose simple API level commands to read from and write to the SD card. In this example we are targeting a 2gig SD memory card.


  • PSoC 4 Pioneer Kit
  • SD Card shield
  • 2 gig SD card

 

image

 

Forum Post Attachments:

 

At the bottom of this post we are including the following items:

  • Example Project Zip File
  • Zip File of Images
    • Project Schematic
    • Component Configurations
  • Custom Component Datasheet

 

Components Used:

 

The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:

  • SD Card
  • CyClock
  • CyPins

 

The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.

 

Firmware Description:

 

The main.c firmware is included in the example project. Please review the commented sections for more details.

 

In this example we ship a custom SD card component and component datasheet to describe the functionality and available APIs and source files. The Component datasheet has been attached to this post. We have used custom components in the past so please refer to those examples for guidance. You will need to import the SD card component from the example project into your design if you want to use the custom component.

 

image

 

This SD card component uses the SPI interface to communicate to the SD card. The SPI interface is part of the SD card component and should be configured in the pin selections in the PSoC Creator DWR window.


In this example we show the user how to setup and initialize the SD card on the SD card shield. The remaining set of code in the example shows the user how to perform a number of common actions on the SD card:


  • Write File
  • Append File
  • Read File
  • Rename File
  • Copy File
  • Delete File

 

An important note before using the SD card, you will need to format the SD card prior to using it in this example. To format the SD card please navigate to the SD card web site to download the SDFormatter tool. Formatting the SD card is a one-time activity to enable it’s use. You will want to use a SD card reader or your SD card slot on your PC.

 

https://www.sdcard.org/downloads/formatter_4/

 

Hardware Connections:

 

The SD card shield uses the 6 pin header for SPI communications. This header on the Pioneer board is, by default, not populated. You will need to solder on a 6 pin header to enable this connection. The Seeedstudio SD card reader uses the 6 pin header to communicate over SPI to the SD card. Once you have added this header connect the Seeedstudio shield to the Pioneer kit.

 


image

 

Test Your Project:

 

Program the example into the PSoC 4 kit. Edit and play around with the commented code to create new files. Then remove the SD card and plug into an SD card reader or PC that has an SD card port to verify the PSoC 4 actions.

 

image

 

I hope this example can help you in your design.

 

Best,

Matt

Attachments:
SDCard_Mass_Storage_Example.zip
6305.Project Images.zip
imageSDCard_V1_0.pdf
  • Sign in to reply
  • Cancel

Top Replies

  • Former Member
    Former Member over 12 years ago in reply to Former Member +2
    Hi Andrew, Few things to check: 1. You need to format your SDCard with SDFormatter ( https://www.sdcard.org/downloads/formatter_4/ ). Windows formatting does not create a boot record. 2. SD Card should…
  • Former Member
    Former Member over 12 years ago in reply to Former Member +2
    Sriram V S, Thank you, thank you, thank you! I was using a 16GB SD card (I must have missed the 2GB limit in my enthusiasm to try things out). Using a smaller card, everything is working well with my data…
  • danadak
    danadak over 11 years ago +1
    I am trying to bring up the shield and project in Creator 3.0. Some ques/observations - 1) In 3.0 Creator produces ~ 40 warnings on type mismatches used in code. But compiles. 2) In Creator debug I cannot…
Parents
  • DAB
    DAB over 12 years ago

    Hi Matt,

     

    I have been waiting for this example.  I want to set up the Psoc 4 as a data logging system.

     

    Hopefully I can get this project done before your series is over.

     

    Thanks

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • DAB
    DAB over 12 years ago

    Hi Matt,

     

    I have been waiting for this example.  I want to set up the Psoc 4 as a data logging system.

     

    Hopefully I can get this project done before your series is over.

     

    Thanks

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube