accuracy of LPC1768 crytstals and IRC

16 Nov 2015

FWIW Using a linux NTP host (clock drift is typically disciplined to within a few ppm), I calculated the frequency offset of the 12mhz LPC1768 crystal (ASE-12-D-C-T spec'd at 50 ppm) running at 96mhz. The crystal was only off by -2 ppm. I also used a GPS PPS signal to confirm the -2 ppm value.

To measure the frequency accuracy of the 32khz RTC crystal (EPSON FC-135 spec'd at 20 ppm) I selected the RTC crystal as the WDT clock source. (The RTC has only 1-second resolution, while the WDT can tick at 8khz with the RTC source, so data collection is faster). Since the CPU crystal is good to -2 ppm, I just used Timer.read_us() for comparison. My RTC crystal was at 20 ppm.

The WDT can also be fed by the 4 MHz internal RC oscillator IRC (datasheet says 1% accuracy). I measured the IRC at -2979 ppm.

You could also measure RTC frequency vs MCU micros using the RTC's 1-second alarm ISR to measure elapsed microseconds between RTC 1 second ticks. With that method, I also measured 20ppm for the RTC crystal.

The longer the drift data collection runs, the more accurate the frequency estimate. Crystal frequency is effected by voltage, capacitance, age, and TEMPERATURE so your mileage may vary.

More anecdotal frequency measurements for other MCUs can be found at https://github.com/manitou48/crystals/blob/master/crystals.txt