BMW have actually made a charger using the PIC16F series PIC
Have posted a pic of the charger in the schematics section (sorry if I got the forum wrong)