Bidirectional 4 cell Li-Ion battery pack
This design uses PIN RA0 to measure Vbatt and sets Ibatt for the charge current in a continuous loop for each of the 4 modes.

Idle, Pre-charge, CC, CV, Idle Cutoff  &lt; 100mA