element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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
Experts, Learning and Guidance
  • Technologies
  • More
Experts, Learning and Guidance
Ask an Expert Forum SD card corruption. Bad communication?
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Experts, Learning and Guidance to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 1 reply
  • Subscribers 303 subscribers
  • Views 305 views
  • Users 0 members are here
  • debugging
  • corruption
  • sd
  • hardware_interfacing
Related
See a helpful answer?

Be sure to click 'more' and select 'suggest as answer'!

If you're the thread creator, be sure to click 'more' then 'Verify as Answer'!

SD card corruption. Bad communication?

Former Member
Former Member over 11 years ago

Hi,

 

I am having corruption occur on our SD card files and believe I am having an issue with ringing on our SD card communication lines. The corruption occurs anywhere between 2 days and 2 weeks or writing to the SD card every hour (simple logging).

 

Our current design has a PIC18F6722 connected via SPI to 3 peripherals (Flash memory, Ethernet IC and an SD card interface). In total there is at least 20cm of trace length for the SPI lines between these peripherals.  The traces also connect to other SPI peripherals, which are always disabled when we communicate with the SD card.

 

My current design does not have EMI filters or termination between the PIC and SD card. I am thinking our signal ringing, or reflections may have something to do with the fact there is no termination on the line.

 

Has anyone experienced this? Does anyone have an example schematic for interfacing a PIC with an SD card?

 

Thanks in advance for your help.

 

Cheers,

  • Sign in to reply
  • Cancel
Parents
  • robotop
    0 robotop over 11 years ago

    Hi, the SD card protocol used in many applications, is the basic SPI (one out data, one in data, one clock line). Such mode was implemented since first MMC cards, the real innovative flash memories. When you write a sector of data (512 bytes) on a card, you can verify the correctness of data, but this check is not accomplished in all the softwares. In my opinion, the wire length isn't very important, if you use a low clock frequency. I suggest to add some low value resistor on all lines, just to cancel the ringing effects of the lines, expecially on the clock line. Put a 220/330 Ohm resistor just near the processor SPI Clock line and look if the results are better. A fast speed clock, on a long line, can introduce ringing effects on fast transients. Some of these transients can be interpreted as "false clocks" from the SD card, then can corrupt writings, readings, commands, and obviously... generate errors. Hope this helps, bye

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • robotop
    0 robotop over 11 years ago

    Hi, the SD card protocol used in many applications, is the basic SPI (one out data, one in data, one clock line). Such mode was implemented since first MMC cards, the real innovative flash memories. When you write a sector of data (512 bytes) on a card, you can verify the correctness of data, but this check is not accomplished in all the softwares. In my opinion, the wire length isn't very important, if you use a low clock frequency. I suggest to add some low value resistor on all lines, just to cancel the ringing effects of the lines, expecially on the clock line. Put a 220/330 Ohm resistor just near the processor SPI Clock line and look if the results are better. A fast speed clock, on a long line, can introduce ringing effects on fast transients. Some of these transients can be interpreted as "false clocks" from the SD card, then can corrupt writings, readings, commands, and obviously... generate errors. Hope this helps, bye

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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