There's already a design available on the net for a PIC based NiCd/NiMh battery charger - although the source code isn't available, he sells pre-programmed PIC's - probably not a bad idea to get in touch with him? (a google search should find it).
For that matter, why not simply use the Atmel application note as a basis for your design, instead of a PIC? - I'm a big PIC fan, but why reinvent the wheel?.