I'm trying to charge 3 NiMH/NiCd AAA cells from USB. I've already got an atmega32u4, so I can use that to read battery voltage and stop when battery reaches 4.2V. I'm not sure about the capacity, but 100mA seems a safe charge rate. Board space is limited so I would like to use as few components as possible.
I can't use an LM317, the voltage drop is too high. Is there another voltage regulator that I can use with current limiting?
Alternatively, the atmega32u4 can do about 100mA total on it's io pins. Can I just use a few pins, add a diode or 2 in series for the voltage drop, and use that to charge the battery?