View previous topic :: View next topic |
Author |
Message |
EdWaugh
Joined: 07 Dec 2004 Posts: 127 Location: Southampton, UK
|
CRC7 routine |
Posted: Fri May 13, 2005 6:51 am |
|
|
Hi all,
Given the current excitement over MMC/SD cards I was just wondering if anyone had a working crc7 routine. I'm adding CRCs to the data (CCITT16) with the CCS function but my compiler version doesn't have 7bit version and the 8bit is different I think. Does anyone have a routine that works or a way to adjust the 8bit one? Otherwise I guess I'll just have to do the maths.
cheers
ed |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Oct 06, 2006 8:24 am |
|
|
I know it is an old thread but I stumbled upon some information that I want to share.
In another thread Ed wrote
EdWaugh wrote: | I don't suppose either of you guys have any tips for this crc7 thing? I have tried a couple of routines and i'm pretty sure I'm getting the starting and polynomial values correct but don't seem to be able to generate the same result for the one example I have which is for the out of reset instr (I think) Quote: | 0x40,0x00,0x00,0x00,0x00,0x95 | Any suggestionswould be welcome. | For the reset command the MMC card is still in MultiMediaCard bus mode where each message ends with an end bit, always set to '1'. So here the real CRC value is not 0x95 but
(0x95>>1) = 0x4A |
|
|
EdWaugh
Joined: 07 Dec 2004 Posts: 127 Location: Southampton, UK
|
nice work |
Posted: Fri Oct 06, 2006 9:12 am |
|
|
Hi ckielstra,
Thanks for the info, I always wondered what that was about. I got it working fine in the end just left shifting in a 1 everytime I calculate the CRC. The cards don't seem to care once they're in SPI mode so it worked for everything.
cheers
ed |
|
|
|