Here are two schematics for the current control. Hope it helps. Also this applies to battery chargers also since the charging can be controlled by the PIC with the help of an LCD/keyboard or PC serial port.
Ioannis
P.S. By looking again the schematic I noticed that the I equation is not very clear. The numerator is R4+R3. Sorry for my writing...
Bookmarks