Shop OBEX P1 Docs P2 Docs Learn Events
SD card CRC trouble — Parallax Forums

SD card CRC trouble

AKruzelAKruzel Posts: 25
edited 2011-10-08 14:09 in General Discussion
I'm having a bit of trouble understanding how to do CRC for a SD Card. It appears that Maxim has two different APP notes on how to do the same thing and each one shows two different ways to do the same thing...which i would think to be incorrect. One app note says to augment with 6 zeroes and another says to augment with 7 zeros. In the app note for the MAXQ2000, the XOR result even appears to be wrong.

www.maxim-ic.com/appnotes.cfm/an_pk/3969

www.maxim-ic.com/appnotes.cfm/an_pk/4068

The app note for the TINI system appears to have the correct XOR result but how do they get to the final checksum?! they say to shift in zeroes into the register and then you can read the checksum..but if you do that, the checksum will be all zeroes!! I don't see how they go from the result of the XOR to the value that they say is to be the checksum.

i've googled and looked and it still isn't clicking. If someone could give a simpler response i would greatly appreciate it!!!

Thanks

Comments

  • David BDavid B Posts: 592
    edited 2011-10-07 11:12
    There are some comments at the bottom of appnote 3969 about this issue, and the response says that the description has been changed to state that 7 zeroes must be added. Maybe the TINI note used the same original source but never got fixed.

    I can't help with actually doing the CRC. I've always just used the fact that the initialization into SPI mode can use a precalculated CRC, after which CRCs are not needed.

    I've also tried to find exact instructions on doing the SD CRC but have not had success. There are some partial and casual explanations out there, but I've never found one complete enough to take a CRC newby all the way from the initial bits to the expected final result.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-10-07 11:17
    Why do you need the CRC? All of the Propeller SD card I/O drivers operate in SPI mode where the CRC (a fixed value) is only needed to enter SPI mode, a one-time initialization operation.

    For details on calculating a CRC, look at the Wikipedia article on the subject and its links.
  • KyeKye Posts: 2,200
    edited 2011-10-08 14:09
    Its 7 zeros. http://www.tty1.net/pycrc/#whouses

    If you try to make CRC's work for the SD card code note that it will kill preformance due to the sheer number of calculations that need to be preformed per second.

    Thanks,
Sign In or Register to comment.