Looks like you have a good xtal... wait until you find a bad one...
Most xtals are 4.0 MHz... their accuracy isn't 4.000000000 MHz, some could even be 4.09 or 3.90 MHz.
You want to spend $20 on a xtal, you'll get better accuracy, but what are you asking from a 20 cent device? Put in a 30pF trmmer capacitor and trim for exactly 4.0000000MHz with a 10-digit Frequency Counter phase-locked to a 10MHz Atomic Standard. Oh... don't forget to enclose the xtal and PIC in a temperature controlled oven +/- 0.1C as well... and then, and only then, you can start getting accuracy to better than 10 seconds per DAY.
Lets face it, I've used a Dallas/maxim DS1307 (which costs a fortune) and a quality EPSON 32kHz xtal, and I whoop for joy if I get an accuracy better than 15 minutes in a YEAR.
All this timekeeping using microprocessors is complete rubbish. You need to lock it to a high quality, high stability clock source for any kind of accuracy even approaching your cheap 99 cent Laser-Trimmed, digital wristwatch.
Bookmarks