Be aware of the 6.2 Absolute maximum ratings, Table 12 - on page 62 in the datasheet - of the Espruino Pico STM32 chip https://www.espruino.com/datasheets/STM32F401xD.pdf
To stay within the logic level specifications, an IO pin cannot drive more than 25mA - source or sink - and the whole chip cannot more than a total of 120mA...
If you go for more, the chip first browns out and then may get damaged...
I have a suggestion for a nice enhancement for this Battery charger: measuring the charge current! Tip how to go about that: put the resistor on the low side instead of the high side and measure the voltage drop on the resistor with additional ADC pin of which there are plenty of left to do so (5). The resistor has of course to be a precision resistor.
Switching the resistors onto the low side, may require a change in the software depending how it does the measuring of the voltage. You have to change how you measure/calculate the voltage - charge state - of the battery when you measure while it is charging: you subtract the voltage drop over the resistor.
© Espruino, powered by microcosm.
Report a problem