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.
Zachary Murtishi
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.