Look at the grounds. Make sure they are very nice, short, and fat traces (or wires). The traces (or wires) from the crystal to the PIC should be as short as possible. The capacitors on the crystal should also be as close as possible to the PIC, with direct connection to GND. Pay good attention to the MCLR connection (follow the datasheet, they did not went through all that trouble for no reason).
This is what I tried to explain before. The 877A has external MCLR and external oscillator (the 887 has the capability to run both of them internally - not good comparison).
Bookmarks