Here's PIC16F877 pin map to start with. It's not complete and may have some mistakes, but it's at least something.
P/N NAME DIR FUNCTION CONNECTIONS
1 RC7 I UART RX J10/5
2 RD4 O BATT LED U10
3 RD5 O BATT LED U10
4 RD6 O BATT LED U10
5 RD7 O BATT LED U10
6 VSS -
7 VDD +
8 RB0 I LOBAT(LOW)
9 RB1 O 3DM(LOW)
10 RB2 O DCIN (HI)
11 RB3 O PWR ON LED J20/10
12 NC x
13 NC x
14 RB4 I START OF BATTERY MONITORING? J52/4, R96
15 RB5 O BATDIS(LOW)
16 RB6 O SUSPEND to ADS? J6/1, J55/2
17 RB7 O STBY PWR ON (LOW), STDBY LED (LOW) U101, U11 - J20/7
18 RST R
19 RA0 A BATT TEMP
20 RA1 A BATT TEMP
21 RA2 O BATT TEMP STROBE
22 RA3 I CONFIG JUMPER J11/1
23 RA4 I DCIN DETECT U1
24 RA5 O BATT TEMP STROBE
25 RE0 A 3.3V SENSE 100K - J5/5,6
26 RE1 I PWR SW U203, J20/9
27 RE2 I ADS POWER DETECT
28 VDD +
29 VSS -
30 X1 C 4MHz clock in U100
31 X2 I NOT USED
32 RC0 O CHARGER OFF 100K - CR4, Q13 - Q12 - U8/2
33 NC x
34 NC x
35 RC1 O adjusts PROG A of U7 Q11 - 10K - U7/1
36 RC2 O charger output voltage setting Q14 - ?K - U8/6(Vosense)
37 RC3 I/O SCL Q20, J52/3
38 RD0 O CHGSEL
39 RD1 I BACKLIGHT DISABLE? (NOT USED) 100K to Q7, GND
40 RD2 O BATSEL
41 RD3 O MAIN POWER ON 18K to J5/10
42 RC4 I/O SDA Q16, J52/2
43 RC5 O I2C BATT MULTIPLEX U13
44 RC6 O UART TX J10/3
Q16, Q19, Q7 = NPN MMBT3904 1AM
B
C
E
PNP MMB3906 2A
B
C
E
n-MOS 2N7002 702P
G
D
S