Unstable oscillator using dsPIC
I've run into similar issues with other Microchip parts like their real-time clock. In our case the crystal we selected did not meet the Microchip requirements. We saw very similar results in that sometimes it would run fine for a while then stop or run slow all the time. Many of Microchips new low power designs use very low power oscillators that require very low capacitance crystals. Check the datasheet for your part and crystal to make sure they are compatible. If you still have any doubts check with an applications engineer at Microchip.