Content originally posted in LPCWare by stepe on Fri May 16 14:05:02 MST 2014
Hi all,
should you ever come across this discussion, consider it solved!
It took us several approaches to get there :)
The solution:
( using RDB1768cmsis_efsl_lib )
it is NOT sending the card into "Idle" state!! As Martin said above, you may not want to close the file and void all pointers only to reenter them a few seconds later again.
> In some datasheets you can find the statement that the SD card goes to power saving mode when it receives no command within 5ms - and should only
> consume 250uA at most there. This doesn't seem to happen though!?
Yes it does: we found a couple of cards that do exactly this without any assistance from firmware! But only a few of them (with the used library).
My experiences from other busses told me, that you can solve a buslock sometimes simply by asserting a few additional "empty" busclocks!
And with that single line...
nonsense=if_spiSend(&efs,0xFF);
... in our code (next line after a typical buffer flush) we solved this. The internal state machine of the (micro) SD-Card gets the needed clocks with
empty data or command arguments to switch to its sleep state, from which it can wake up very fast, drawing less than 1mW of power in between!
This is a huge saving, compared to cards that consume up to 250mW all the time even not writing anything most of the time. The hardware engineers did
their job, now it is up to you programmers to make use of this feature to save the planet.
=> All cards tested so far where doing it perfectly after this patch!
One final note: this is not depending on the speed class of SD-Cards nor their size. Some 8GB cards did it themselves, others not. It's the flash controller
inside that makes the difference. Also for the power consumtion. I won't tell the brand names thogh ...
Last note: since you made it up to here, you get another hint. With only a few additional lines the RDB1768cmsis_efsl_lib can be enhanced to be ready
for SDHC (high capacity) support! Drop a comment below it you need more on this.
Regards
Stepe.