Re: Reliability of SD Card

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Re: Reliability of SD Card

Post by liak » Sun Aug 03, 2008 2:54 pm

Dear All (esp Steven),
Hi! Following my previous thread, I have been trying to use the SD card which, I think out of the conventional method. I am trying to use the physical sector of SD card in replacement of EEPROM. I have abandoned the FAT structure and go direct to the low level sector itself.
I have successfully written and read from the SD card. But now I am having another problem. :cry:
My initial intention is to read data from a few sectors on the SD card and then transfer the data to an output device. My initial concern was with the speed of transfer as I need to do it as fast as the PIC allows. Now my problem is that what seems to me a failure of the SD card to read reliably. I am repeatingly reading from the SD card very fast, a few sectors at a time. But after a few repeats, the output does not match what it's supposed to be. The SD card sort of hanged. After a few cycles later, it resumed reading normally.
My suspicions are in the
1. Failure of SD card to respond to repeated read in short duration (ms)
2. Read error or checksum error? as I do not use the CRC mechanism

Anyone of you have any experience in this?
BTW, as for the read subroutine and module, I used the exact ReadSector sub provided by Steven. Do you have any comment Steven?

Any suggestions will be welcome. I have run out of ideas.

Regards.
Liak :?

liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Post by liak » Sun Aug 03, 2008 2:59 pm

Dear all,
Wanted to add this. I am wondering why the SD card protocol comes with a checksum for the data verification - The CRC mechanism. Does this mean that the SD card is not reliable?

Regards,
Liak

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Sun Aug 03, 2008 8:54 pm

Hi Liak - before I launch into a longer answer, can I just check if you are using the original SD library that came with the compiler, or the newer version downloaded from the Swordfish wiki?

liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Post by liak » Mon Aug 04, 2008 4:49 am

Dear Steven,
I am using the module you posted on the wiki version 4.0.9. However, I must say that with some modification, but not much; there are lots of low level command which I can only guess to understand; except to change the declaration of some subroutines and structure variables into public type.
I am currently off my workstation. I will submit my modifications for your inspection. Even so, I was suspecting something amiss with my modifications. Then I fell back to use the original ReadByte sub, with it declared public. This also seems to work intermittently.
I will work to see if my own codes have any error. If I can't find one, maybe I will need your help later, again.

Regards,
Liak :)

liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Post by liak » Tue Aug 05, 2008 3:03 pm

Dear Steven,
:oops: :oops: :oops:
Thanks Steven, your module works perfectly fine. My modifications are also correct. Finally, I found the root of my problem!
Well, I ported to a new PIC from 1320 to 2525. I have wrongly taken the CCP ports are the same with the two chips. So that's why I failed to get the expected output! Took me a day to trace this!
Thanks again. As I always say, the expert (Steven) is always right!
Now I hope the transfer rate is fast enough. Thanks :lol:

Regards,
Liak

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Tue Aug 05, 2008 7:58 pm

That's great news - I'm pleased to hear that you've sorted it. Let us know if you achieve the speed that you're after.

liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Post by liak » Mon Aug 25, 2008 3:50 pm

Dear Steven,
:lol: Just to inform you that, the modified SD module works perfectly. The transfer rate is good enough for my application even without sorting to PLL.

Thanks a lot. :lol:

Regards,
Liak

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Mon Aug 25, 2008 3:56 pm

That's good to hear. Thanks for letting me know.

Post Reply