Saving SD card corruption

Please see this thread for why this is necessary.

I’m building a PCB for an application where a corrupt SD card would be a big no-no.

I decided to put a super cap on my 5v rail to provide a little time to flush the SD card. I also wired the input voltage rail to a interrupt pin with a 3v3 zener diode. It sort of works a treat. When the power drops out, my .47F super cap keeps it above 3v3 volts for about 5 seconds. The interrupt fires, stops the program writing to the SD card and flushes it in heaps of time to save it.

But I’ve created another problem that I didn’t see coming. The rise time of my 3v3 rail is crap and my board doesn’t start without hitting the reset button after the CAP is charged. :frowning: To make matters worse, if the power comes back on before it has completely discharged. It doesn’t start properly either.

I just found this document at ti
And I really would like to use all these 5.5v super caps I brought.

Does anybody know how to use a load switch to get around this. I’ve attached the diagram of my power rails.

Huge thanks in advance.


I can’t comment on a load switch but it will be interesting to hear of other people’s solutions to this. We ended up using a Linear LTC 3226 super cap management chip to address all the issues you raise and our specific requirements. The chips are relatively expensive (but compared to a broken device somewhere in the field, perhaps not…) and are a bit of a pain to work with due to the QFN package, but they take care of all the super cap issues allowing us to focus on other things.

I like the idea of the mcp130. Thanks for the tip.

Another problem is though, that during a “brown out” where the MCP130 would reset the g120. The SD Card seems to stop working also. And the only way to get the SD Card working again is to completely discharge the system. Can anyone expand on why this might be? I think I could get around it with a mosfet and an mcp130 I think. but i’d like to know why it is happening first.

I can confirm that this is repeatable, An SD card won’t re-mount if it has had a significant brown out. Resetting the g120 wont hack it. Can anyone shed any light on this.

I think this is down to the 220uF cap on the output of the LM1117MP3.3 and may be too big and looks like a short on the output as it switched on and takes time to charge causing your slow rise time.This regulator is only rated for 800mA so you could get away with a lower value cap and still have good stability. Can you try a lower value with something like 47uF?

It would also have an effect on your power down time too.

Thanks again Dave.
I think I need a more complete solution involving a special component to snap the voltage off and on harder. It’s always worked ok with the 220uf. It all goes to poo though when I start putting super caps on the 5v rail though. In this case I Need the super cap in order to do the clean fat32 shutdown thing. I’m going to contact GHI and offer to pay to get the power rails designed properly. I just keep buggering up these boards, and although in enjoy playing with things and learning as I go. It is getting a little expensive. Besides, I might get GHI to do the manufacturing in the end anyway, so it’s better to get them involved now I think.

Ah yes, it would take time to charge too. Supercaps are not really designed to go across the main supplies. Ideally what you need is to charge them via a small charge resistor and it only switches onto the supply rail when the main power input fails. You’ll need a FET to ideally do this and some logic on it’s gate.

Good luck with the project.

PS… Found this today.

That is right along the lines of what I need. Except maybe a little over kill as I only would have 1 cell only.

To quote the article, I’m just looking for that “dying gasp”.

The LTC3226 seems a little simpler. I might use this in future designs that need a short backup time prior to power off.

PS. The only thing that irks me with Linear Tech designs is the stupid need for precision resistors. Look at the values in the datasheet for the LTC3226 for instance. Almost all are not based on standard values. This bumps the cost up considerably and Linear devices are generally not cheap in the first place although to be fair, they are reliable and high quality.

Nice part, Crap footprint. That is along the lines of what I need though.

I’d love to be able to use one of these fancy load switches. Because of there auto discharge circuits would create a clean kill as well. Check out this little bad boy.

All I need is a little analog logic skills to switch the Enable pin.

See my diagram.

For got a diode in the picture. :-[

A capacitor with a charge resistor should be enough to do this. Like in the old days when we used them for the reset pins :slight_smile:

The EN threshold is 0.4 to 1.25V

I kept thinking this all seemed way more complex than it had to be (not that having a dedicated IC for a supercap might not have other benefits).

I tried your setup Jeff but ran into a couple of problems. The resistor causes it to charge to slowly once the voltage difference gets close together. and it doesn’t help with powering it down either. But Thankyou cause it gave me another idea. Check out how I’ve used your idea in the attached schematic. A 500ma ptc fuse will slow the charge of that bad boy! Now how to neatly kill it below 3v.

That sounds like exactly what a POR device does. I can’t think of a part number off the top of my head but the ones I have used in the past came in a T0-92 three lead transistor case. The output went low when the input voltage was below the POR device threshold, you tie the output to your reset line of your powered device.

What about one of these.


I might have been wrong I think. It’s not really clear to me if I need the APX809 or APX810.

My gut tells me the 809