Close

Bug fix: wait for linear regulator output to start up before enabling PMOS

A project log for Smart ML2032 Coin Cell Charger Module

ATtiny824-powered battery charger uses integrated analog-to-digital converter circuitry to monitor charging

zachary-murtishiZachary Murtishi 07/27/2025 at 01:520 Comments

I realized that switching on both the linear regulator and PMOS output transistor at the same time could result in a condition where the battery could discharge into the linear regulator during startup. To prevent this, I added a loop where the regulator voltage is checked with the ADC prior to activating the PMOS transistor for charging.

Also, instead of updating control pin states on every loop iteration, they are now only updated on state changes.

Discussions