Electronics > Beginners
Cap Charge
Tnixsw:
Hi all,
Due to the way a circuit is switched on or off, I would like to have a small capacitor hold a processor on for about 50mS after detecting that the power was turned off so that I can store some data. The circuit voltage is about 4.4V, and if I use a Schottky isolation diode, then the capacitor charged voltage would be about 4.1V or so. If I allow around 20mA current, and use a 2.2mF capacitor, I should get about 200mS before the cap voltage drops below the microprocessor reset level of about 2.7V.
If this seems feasible, what sort of resistor should I use to limit the charge current at switch on. I don't know what is appropriate.
I would imagine the processor would have to track a minimum switch on time before it would attempt to save the data.
cheers
Tony
inse:
If the power is on for only 20ms, you need a low resistance, if it’s on for minutes, you can go for a higher one.
Just don’t over-stress your power supply to avoid brown-out (or is it brown-in?) condition for the uC
Tnixsw:
The power could be on for hours, but when switched off, I'd be relying on the capacitor charge to store data before the processor halts due to the reducing voltage dropping below its reset threshold.
I would have thought something like 5 - 10 seconds to fully charge - not sure.
srb1954:
--- Quote from: Tnixsw on March 28, 2023, 04:10:03 am ---Hi all,
Due to the way a circuit is switched on or off, I would like to have a small capacitor hold a processor on for about 50mS after detecting that the power was turned off so that I can store some data. The circuit voltage is about 4.4V, and if I use a Schottky isolation diode, then the capacitor charged voltage would be about 4.1V or so. If I allow around 20mA current, and use a 2.2mF capacitor, I should get about 200mS before the cap voltage drops below the microprocessor reset level of about 2.7V.
If this seems feasible, what sort of resistor should I use to limit the charge current at switch on. I don't know what is appropriate.
I would imagine the processor would have to track a minimum switch on time before it would attempt to save the data.
cheers
Tony
--- End quote ---
What is your power source for the circuit?
If it is powered via a linear regulator you might not need any additional resistance as the regulator current limit will protect against excessive current.
If you have a slowly charging capacitor powering your MCU I strongly recommend that you use an external CPU supervisor chip to hold the MCU in reset until such time as the power supply voltage has stabilised at an appropriate level, a little above the MCU's maximum internal reset voltage. The internal power-on reset circuit of many MCUs doesn't operate reliably with slowly rising power supply voltages so a CPU supervisor with a well defined reset release threshold is preferred.
A combined CPU supervisor/memory protection chip might be necessary if you are storing your data in a battery backed RAM. You wouldn't want to corrupt the RAM data on power up having so carefully saved it after a power failure.
Tnixsw:
I'll look into a supervisory IC - thanks.
Navigation
[0] Message Index
[#] Next page
Go to full version