Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card doesnt Sleep after writing on it #14

Closed
kalaveras opened this issue Jan 9, 2017 · 1 comment
Closed

Card doesnt Sleep after writing on it #14

kalaveras opened this issue Jan 9, 2017 · 1 comment

Comments

@kalaveras
Copy link

My hardware is a atmega644PA and i use the SPI hardware module that it has.
I upload the code with Arduino IDE and ad-hoc third party board implemented by my self.

I only use a SD in the SPI. It doesnt have any hardware Pull-ups on spi lines.

I use this library in order to allow a micro SD to go to Sleep mode with low consumption.

If I SD.begin() the SD, it consumes 250 uA, so i assume it goes to sleep mode correctly.

The issue is that when I write something on a file, (open file, write on it, close file) the card consumes around 14 mA permanently. Even after a while. So probably the SD blocks on same state and doent allow it to sleep. I can write again whitout problems.

I solve it calling SD.begin function after "close file".
But this is just a temporal patch. Probably the problem is in some of the code that SdSpiCard::begin function does and the file write code doesnt. I dont know sd specs to go deeply to solve it.

@kalaveras kalaveras changed the title cards doesnt went to Sleep after writing on it cards doesnt Sleep after writing on it Jan 9, 2017
@kalaveras kalaveras changed the title cards doesnt Sleep after writing on it Card doesnt Sleep after writing on it Jan 9, 2017
@greiman
Copy link
Owner

greiman commented Jan 10, 2017

If you are using the official SD.h library, I don't maintain it.

It has had the sleep bug since it was written in 2009 and the Arduino company has not fixed it.

I test SdFat with Sandisk cards and the sleep at about 100 micro-amps.

@greiman greiman closed this as completed Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants