Posts

Showing posts with the label charging

Batteries, lithium, ions, chargers...

At last :) I've managed to get charging work correctly, red led blinks when charging is in progress, and lights solid when charging finished. (Denis reported that his PDA has yellow led, btw, it does not matter :)) Problem was stupid: GPJ2, GPJ3 and GPJ6 (and not GPJ4 as I've reported before!) are affected in battery charging. I'll post patch after some testing ;) Here's short description: when charger connected, GPF2 goes to 0, and EINT2 interrupt occurs. In that case we should: set GPA2 and GPA3 to 1 wait for some time, GPF3 should become 0 (not sure that it's necessary) then we need to set GPJ2, GPJ3 and GPJ6 to 1 when charging is finished, GPF3 becomes 1 (GPF2 still 0!), in that case we should: set GPA2 and GPA3 to 0, set GPA6 and GPA7 to 1 set GPJ2, GPJ3, GPJ6 to 0  when charger is disconnected, GPF2 = 1. Each charger connecting/disconnecting event EINT2 occurs. But it doesn't when charging finished - so we should poll GPF3 periodically to prevent battery o...