Hacker News new | ask | show | jobs
by kartoffelwaffel 2491 days ago
Also why not chuck a capacitor in the mix to provide a little power buffer to shutdown the filesystem gracefully.
2 comments

Many MCUs do not appreciate slow rise-times when using their internal regulators. Then you start oversizing your regulator or providing them replacement regulators. Which then opens more cans of worms, etc, etc.
Many voltage regulators have 'power good' pins that you can tie to the MCU's reset line, though.
And if you don't have this, I posted this circuit example I just made for a delayed power turn on time above. Capacitor is about 5 cents, the transistors are about 6 cents each. If you need it you need it, but power good to the reset line is better.

https://i.postimg.cc/Df9N8fM5/delayed-turn-on-circuit.png

Or just put a capacitor after the reset line pullup so that it effects delayed turn on during boot.

Oh, neat trick - thanks for sharing!
What is the voltage drop across D1 and Q2? Is that ever an issue?
The drop across D1 can be significant, using a Schottky helps. Usually within the tolerance of the power supply in any case.

But a capacitor on the reset pin is pretty good ;-)

Those microcontrollers aren't reliable anyways. If you design those in you have to accept that if they have persistent state they will eventually brick themselves. If they don't have persistent state they will hang and require user intervention on a regular basis.
It adds quite some space and probably costs as much as the MCU.
Yeah, paying thirty cents for a capacitor to coddle a ten-cent MCU doesn't make a bunch of sense. Much cheaper to teach your software folks how to write transactional updates to that flash. Typically you pay a small speed penalty to get update atomicity (in addition to having a more complicated implementation).
not as simple either, you still need to detect that the power is gone or fading independent of the capacitor...which all adds up